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

Ruby heredoc in method arguments breaks parenthese recognition #124

Open
alexr00 opened this issue Nov 20, 2018 · 3 comments
Open

Ruby heredoc in method arguments breaks parenthese recognition #124

alexr00 opened this issue Nov 20, 2018 · 3 comments

Comments

@alexr00
Copy link

alexr00 commented Nov 20, 2018

From @amerov on November 8, 2018 21:16

The closing paren gets classified incorrectly as string.unquoted.heredoc.ruby on line 7.

Highlighting example, incorrect on the left, correct on the right.
screenshot from 2018-11-09 02-15-58

Copied from original issue: microsoft/vscode#62812

@alexr00
Copy link
Author

alexr00 commented Nov 20, 2018

From @rebornix on November 19, 2018 17:7

@alexr00 the heredoc content starts from the line following the heredoc identifier (LOG in our case) and we can use the heredoc identifier as a variable in that line, so log(<<-LOG) is a valid function call and <<-LOG is referring to the content after this line (and also ends with LOG). https://docs.ruby-lang.org/en/2.5.0/syntax/literals_rdoc.html

For short, ) is not part of the multiline string, our grammar is kind of wrong.

@alexr00
Copy link
Author

alexr00 commented Nov 20, 2018

Thanks for checking!

@alexr00 alexr00 changed the title Ruby heredoc in method arguments break braces syntax Ruby heredoc in method arguments breaks parenthese recognition Nov 20, 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

No branches or pull requests

1 participant