Skip to content
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

Line terminator in string literal should raise a syntax error #1083

Closed
jevancc opened this issue Jan 19, 2021 · 0 comments · Fixed by #1084
Closed

Line terminator in string literal should raise a syntax error #1083

jevancc opened this issue Jan 19, 2021 · 0 comments · Fixed by #1084
Labels
bug Something isn't working
Milestone

Comments

@jevancc
Copy link
Contributor

jevancc commented Jan 19, 2021

Describe the bug
The lexer does not throw a syntax error when there are line terminators, like \n, in string literal.

To Reproduce

"Hello
World";

Expected behavior
Should throw a syntax error

Additional context
There are some broken tests that exploit this bug and should be fixed when addressing this bug.
In the current implementation, the template literal share the character lexing function with the string literal. We should consider separating them since their grammar and semantic are subtly different.

@jevancc jevancc added the bug Something isn't working label Jan 19, 2021
@Razican Razican added this to the v0.12.0 milestone Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants