Skip to content

Include generated } tokens when fixing closing token positions#4350

Merged
lydell merged 1 commit intojashkenas:masterfrom
alangpierce:upstream-fix-generated-close-curly-location
Oct 31, 2016
Merged

Include generated } tokens when fixing closing token positions#4350
lydell merged 1 commit intojashkenas:masterfrom
alangpierce:upstream-fix-generated-close-curly-location

Conversation

@alangpierce
Copy link
Contributor

This is an upstream port of decaffeinate#10
See that PR for links to the issues that this fixes.

Just like OUTDENT and CALL_END tokens, close-curly-brace tokens can be generated
without having a real location, and if that position overlaps with a later
token, it can cause the AST to have bad location data. Just like the other two
token types, we now give } tokens the position of the previous real token,
which makes all AST nodes have reasonable locations.

See #4296 for more context.

This is an upstream port of decaffeinate#10
See that PR for links to the issues that this fixes.

Just like OUTDENT and CALL_END tokens, close-curly-brace tokens can be generated
without having a real location, and if that position overlaps with a later
token, it can cause the AST to have bad location data. Just like the other two
token types, we now give `}` tokens the position of the previous real token,
which makes all AST nodes have reasonable locations.
@lydell lydell merged commit aca72f9 into jashkenas:master Oct 31, 2016
EsrefDurna added a commit to EsrefDurna/coffeescript that referenced this pull request Nov 12, 2025
…ated-close-curly-location

Include generated } tokens when fixing closing token positions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants