-
-
Notifications
You must be signed in to change notification settings - Fork 96
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect argument formatting for HEREDOC #50
Labels
enhancement
New feature or request
Comments
ianks
changed the title
code within module_eval breaks things
Incorrect argument formatting for HEREDOC
Feb 8, 2019
also interesting how |
Thanks for the report! Yeah definitely need to fix this up. I'll take a look next chance I get. |
Just consolidating some concise examples created from the above snippet/issues that could be used as test cases: (PARSER_EVENTS - events).each do |event|
module_eval(<<-End, __FILE__, __LINE__ + 1)
def on_#{event}(*args)
true
End
end module_eval <<-RUBY, __FILE__, __LINE__ + 1
def respond_to_missing?(name, include_private = false)
false
end
RUBY class_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{key}; _get(#{key.inspect}); end
RUBY Person.where(<<~WHERE, arg1)
some sql
WHERE I've never seen the syntax for multiple heredocs as arguments before, but here we are: combined = concatenate(<<~EOF1, <<~EOF2)
first string
EOF1
second string
EOF2 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have an easily reproducible error case for you, hope you dont mind 馃槃
With this input:
prettier-ruby creates syntactically incorrect output:
The text was updated successfully, but these errors were encountered: