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

Fix #3909: Backslash to break line is inconsistent in 'for ... of' and 'for ... in' loops #4861

Merged
merged 1 commit into from
Jan 28, 2018

Conversation

zdenko
Copy link
Collaborator

@zdenko zdenko commented Jan 19, 2018

Fixes #3909.
A syntax error is thrown when the backslash is used in for of and for in loops, and in or of tags aren't in the same line with for tag.
The issue is in Lexer::lineToken where for tag is closed (@seenFor = no). This PR corrects this by checking the previous tag, e.g. tag before the TERMINATOR.

x = ( key for \
  own key of obj )

x = ( key for own \
  key of obj )

x = ( key for own key \
  of obj )

x = ( key for \
  key of obj )

x = ( key for \
  key of obj )

x = ( key for key \
  of obj )

x = ( key for \
  key in obj )

x = ( key for \
  key in obj )

x = ( key for key \
  in obj )

@GeoffreyBooth GeoffreyBooth merged commit 74bd537 into jashkenas:master Jan 28, 2018
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.

Lexer: Backslash to break line is inconsistent in object comprehension
2 participants