Closed jasonforal closed 3 months ago
Not opposed to the change but how will we get the unnamed nodes? It's generally not useful for the analysis but it's often required for calculating the fixes (like the place of a comma, etc). We need a way to get the unnamed nodes. What about we name a node.getChildren()
and node.getNamedChildren()
?
Yes, I should've been more clear in the initial description. I just edited it, however, in sum:
This PR only matches the ddsa behavior to what we currently have with stella.
What problem are you trying to solve?
Currently, when a rule requests the children of a tree-sitter node, they get both anonymous and named nodes, which is unintuitive and does not follow the semantics of what we currently do with the stella library.
For the query:
The (anonymous + named) children of
@paramList
are:(
,a
,,
,b
,,
,c
,)
The named children are:
a
,b
,c
What is your solution?
Use tree-sitter's
named_children
API instead ofchildren
.Alternatives considered
What the reviewer should know