Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

nested heredocs #109

Closed
schmurfy opened this issue Aug 3, 2015 · 3 comments
Closed

nested heredocs #109

schmurfy opened this issue Aug 3, 2015 · 3 comments
Labels

Comments

@schmurfy
Copy link

schmurfy commented Aug 3, 2015

That is a unusual sight but I needed to do it in a project and found out it is highlighted incorrectly, I looked at the grammar but I am not sure how to fix it if it can even be done :(

def some_function(str1, str2)
  p [str1, str2]
end


some_function(<<-EOS1, <<-EOS2)
string 1
EOS1
string 2
EOS2

This code is valid, you can try executing it but the part between EOS1 and EOS2 has an incorrect highlighting.
I think the most sensible thing in this case would be to consider everything between EOS2 and EOS2 as string, is there any grammar guru around here ?:p

PS: github also get the highlighting wrong ^^

@mamenama
Copy link
Contributor

Edited the ruby.cson file to add this in 5789cbf within PR #113

In that version, all the heredoc is highlighted until the last heredoc (above, EOS2) is reached.

The closing parenthesis, alas, remains considered part of the string. There's probably some way around that, but it's probably more complicated.

@50Wliu
Copy link
Contributor

50Wliu commented Nov 18, 2015

Fixed by #113.

@50Wliu 50Wliu closed this as completed Nov 18, 2015
@schmurfy
Copy link
Author

thanks ! :)

The parenthesis considered inside the string is really a minor issue compared to how the code was shown as before ^^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants