-
Notifications
You must be signed in to change notification settings - Fork 588
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing flag from regex literal in corner case (#529)
In the specific corner case where a regex contains a flag but is not followed by any symbols, the ast.RegExpLiteral.Literal value would drop (part of) that flag. This happens because the p.next() call during the parsing of the flag wouldn't actually advance the p.chrOffset, and thus endOffset would be erroneously adjusted. The fix is just to use the current p.chrOffset and then call p.next() afterwards.
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
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