You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code here refers to the the ruby code and content is the html content. However, the parser doesn't recognise content node as a sibling of the code node. All code and content nodes are considered siblings of the root template node.
For a cleanup perspective this isn't helpful since it parses individual ruby lines without getting the nested sibling content nodes.
This API allows for great flexibility in how languages can be composed. Tree-sitter is not responsible for mediating the interactions between languages. Instead, you are free to do that using arbitrary application-specific logic.
Any thoughts on if it is possible to support cleanup for Erb files in the existing polyglot piranha implementation?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
For the below Erb code snippet
The corresponding tree generated by (https://github.com/tree-sitter/tree-sitter-embedded-template) parser is
The
code
here refers to the the ruby code andcontent
is the html content. However, the parser doesn't recognisecontent
node as a sibling of thecode
node. Allcode
andcontent
nodes are considered siblings of the roottemplate
node.For a cleanup perspective this isn't helpful since it parses individual ruby lines without getting the nested sibling content nodes.
From (https://tree-sitter.github.io/tree-sitter/using-parsers#multi-language-documents)
Any thoughts on if it is possible to support cleanup for Erb files in the existing polyglot piranha implementation?
Beta Was this translation helpful? Give feedback.
All reactions