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
Comments in the tree mess up all sorts of things. cf #371, #393, and others. We currently have to either make them into the lowest common denominator and add every scoped variable used anywhere to them, or make queries needlessly specific in what they'll match, which couples them overly tightly to the grammar and in any case doesn't work out so well for adjacency patterns (the ones with .s in them).
Most or all comments are unnecessary to stack graph rules, in that we aren't trying to resolve name lookups in or through them (although maybe we would want to jump to definition from within doctests or documentation comments), so maybe we could filter them out of the tree altogether?
The text was updated successfully, but these errors were encountered:
To be precise, we have at least two problems stemming from the intrusion of comments:
Queries matching multiple children of a given node will match comments as well, requiring antimodular treatment of the comment nodes (e.g. adding lots of scoped variables to them which are asemantic and treat comments as sort of the lowest common denominator since they can occur anywhere).
Queries matching a single child of a given node, e.g. a parenthesized expression's… parenthesized… expression… will match comments as well, often requiring rules to be split into one which will run once for the given parent node, and one which will run for every child node (even though there is, semantically, only the one that matters).
TL;DR: We're working with a CST, we think of ourselves as working with an AST, bugs and hacks are the result.
Comments in the tree mess up all sorts of things. cf #371, #393, and others. We currently have to either make them into the lowest common denominator and add every scoped variable used anywhere to them, or make queries needlessly specific in what they'll match, which couples them overly tightly to the grammar and in any case doesn't work out so well for adjacency patterns (the ones with
.
s in them).Most or all comments are unnecessary to stack graph rules, in that we aren't trying to resolve name lookups in or through them (although maybe we would want to jump to definition from within doctests or documentation comments), so maybe we could filter them out of the tree altogether?
The text was updated successfully, but these errors were encountered: