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
Doesn't adding this to green tree make all green nodes unique and unshareable in normal parse trees? Is the width info not enough to reconstruct origin info in the red trees?
Yes and yes. Adding origins will makes each node unique and therefore unshareable, and the width info should be enough to reconstruct the origin info.
However, once we start moving subtrees and terms around (term rewriting, transformations, desugarings), the only way to know where a term came from (e.g. for error reporting, highlighting, etc) is by storing the origin information explicitly with the term.
I can think of other ways.. Like a transformed term points back to the origin parse tree, where it came from. Of course this might be problematic with the original parse tree needing to stay alive all the time and further and further away from the information source that you derive origin info from..
Spoofax uses origin tracking to track where terms came from. This information must be added to the green tree, and be kept under transformations.
withChild
).The text was updated successfully, but these errors were encountered: