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] Highlight #{} interpolation in heredoc #134

Closed
zufuliu opened this issue Feb 15, 2023 · 2 comments
Closed

[Ruby] Highlight #{} interpolation in heredoc #134

zufuliu opened this issue Feb 15, 2023 · 2 comments
Labels
committed Issue fixed in repository but not in release ruby Caused by the ruby lexer

Comments

@zufuliu
Copy link
Contributor

zufuliu commented Feb 15, 2023

Per https://docs.ruby-lang.org/en/master/syntax/literals_rdoc.html#label-Here+Document+Literals
interpolation is allowed in double (or none) quoted or backtick quoted heredoc (SCE_RB_HERE_QQ and SCE_RB_HERE_QX).

# SCE_RB_HERE_Q
puts <<-'EXPECTED'
One plus one is #{1 + 1}
EXPECTED

# SCE_RB_HERE_QQ
puts <<-EXPECTED.chomp
One plus one is #{1 + 1}
EXPECTED

# SCE_RB_HERE_QX
puts <<-`HEREDOC`
cat #{__FILE__}
HEREDOC
zufuliu added a commit to zufuliu/notepad2 that referenced this issue Feb 15, 2023
@zufuliu
Copy link
Contributor Author

zufuliu commented Feb 15, 2023

ruby-0215.zip

Patch contains three changes:

  1. Set SCE_RB_HERE_QQ and SCE_RB_HERE_QX based on HereDoc.Quoted.
  2. Add InnerExpression class to encapsulate enterInnerExpression() and exitInnerExpression().
  3. Highlight #{} in SCE_RB_HERE_QQ and SCE_RB_HERE_QX.

@nyamatongwe nyamatongwe added the ruby Caused by the ruby lexer label Feb 16, 2023
nyamatongwe pushed a commit that referenced this issue Feb 16, 2023
SCE_RB_HERE_QX for backticks-quoted heredocs.
@nyamatongwe nyamatongwe added the committed Issue fixed in repository but not in release label Feb 16, 2023
@nyamatongwe
Copy link
Member

Included in 5.2.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
committed Issue fixed in repository but not in release ruby Caused by the ruby lexer
Projects
None yet
Development

No branches or pull requests

2 participants