-
-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix lexing escapes in string literal and minor refactor #1079
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1079 +/- ##
==========================================
+ Coverage 58.70% 58.74% +0.04%
==========================================
Files 176 176
Lines 12391 12459 +68
==========================================
+ Hits 7274 7319 +45
- Misses 5117 5140 +23
Continue to review full report at Codecov.
|
Test262 conformance changes:
|
The new panic is fixed. Now the changes become Passed +7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good job!
Thanks a lot. This looks good to me. There is a very last tiny corner case that is not handled: when a string contains And this is not related to octal escape sequence, but this is part of escape sequence, there is an issue with |
Ok, I just renamed this PR and will do all the fixes in it. I will re-request reviews after I finish it. For recording the issue that will be fixed in this PR: |
@tofpie the bugs you mentioned are addressed. I cannot request your review through github so I tagged you in this comment :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really like the refactor, separating into functions helps a lot in understanding the code.
Don't like the loose unsafe
, either we remove it for a minor performance penalty or add a comment (I'm fine with either solution).
Updated @Razican's comment with the conformance numbers, improved a bit more.
* Refactor StringLiteral * Fix octal escape in string literal * Add tests * Fix zero escape * Fix zero escape lookahead * Rename variables * Rename helper functions * Refactor match arms * Fix escape line terminator sequence * Fix single character escape * Fix escape followed by unicode char * Add NonOctalDecimalEscapeSequence * Fix comment * Refactor * Modify error message * Add tests * Rename tests * Add test for error * Add comments for unsafe bytes to str * Update boa/src/syntax/lexer/string.rs Co-authored-by: tofpie <[email protected]> * Minor refactor * Remove unsafe bytes to str * Fix panic when reading invalid utf-8 chars Co-authored-by: tofpie <[email protected]>
This Pull Request fixes/closes #1078 and some bugs mentioned in the discussion of this PR.
It changes the following:
\
followed by a line terminator sequence\v
\8
and\9
in strict mode.