Skip to content

Ruby heredoc in method arguments breaks parenthese recognition #124

Open

Description

@alexr00

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

Activity

  1. alexr00 commented on Nov 20, 2018

    @alexr00
    Author

    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.

  2. alexr00 commented on Nov 20, 2018

    @alexr00
    Author

    Thanks for checking!

  3. changed the title [-]Ruby heredoc in method arguments break braces syntax[/-] [+]Ruby heredoc in method arguments breaks parenthese recognition[/+] on Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions