Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Place ending heregex tokens one index earlier
This is an upstream port of decaffeinate#17 The lexer generates fake tokens for interpolated heregexes, and the ending tokens were being placed where the start (inclusive) and end (inclusive) index were one past the end of the heregex. This meant that in a case like `[a ///#{b}///]`, the end tokens of the heregex and also the implicit function call end were all being placed at the `]`, so the AST location data would say that the function call ends at the end of the `]`. To fix, I can just subtract 1 from the position of those ending heregex tokens so that their end lines up with the end of the heregex itself. This is similar to previous fixes that changed `OUTDENT` and `CALL_END` tokens so that the end of the token lines up with the end of the AST node.
- Loading branch information
1 parent
0d13231
commit f757614
Showing
3 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters