boa
boa copied to clipboard
Span nodes
It would be nice for the nodes to have a Span for better error messages.
A Span would contain a start Position and end Position.
- [x]
Expressions(#4273) - [ ]
Statements - [ ]
Declarations
I think this would be nice, yes, but for this, we would also need that Span for tokens, as we have tokens of more than 1 character.
I don't think anything in the tokens needs to change right?
You generate these when you generate the Node, at that point you have all the information you need. (first token and last token)
btw I purposely left this functionality out as it caused more complication in the new parser (added scope), but im glad to see an issue for it going forward
I don't think anything in the tokens needs to change right?
I think it depends on what we consider the span of a Node. The position of the last token is where the last token starts, not where the last token ends.