-
-
Notifications
You must be signed in to change notification settings - Fork 52
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 StrNode#last_line
and StrNode#line_count
for heredocs
#40
base: master
Are you sure you want to change the base?
Conversation
Heredocs are complicated. The notion of 'source' of a heredoc is strange as the source is disconnected. It's important to realize how disconnected it is... foo(<<~RUBY, other, arguments(:here), not(related_to_here_doc))
inside heredoc
RUBY I don't think that including |
Yeah, agreed. |
Feel free to ping me if there would be any interest in this. |
Thanks for the ping, sorry I didn't answer before. I'm 👍 on
|
We can consider |
1e5b738
to
ca5886e
Compare
StrNode#last_line
and StrNode#line_count
for heredocs
On master branch, for heredocs: |
Parser's heredoc format:
Right now, heredocs are not handled correctly, imo. Every updated method in this PR in the original implementation only deals with
expression
part. And so returns incorrect values (look at tests for expected behavior).Rubocop needs a couple of changes (2-3 very small) due to new behavior to let the CI pass. But this gem depends on
rubocop
, andrubocop
depends on this gem, so I need and advise on how to proceed and in what order.