Actions
Backport #7255
closedRipper inside class_eval ommits :string_content between new line and :string_embexpr
Status:
Closed
Assignee:
Description
See the following Code parsed by Ripper using
content = 'class_eval <<-RUBY, __FILE__, __LINE__+1
def #{parent}contents(*args)
""
end
RUBY
'
Ripper::SexpBuilder.new(content).parse
The resulting sexp ommits truncates the first string_add to " \n" instead of " \n def "
- - :string_literal
- - :string_add
- - :string_add
- - :string_add
- - :string_content
- - :@tstring_content
- " \n"
- - 2
- 0
If you remove the empty line, it works fine and the " def " is part of the string. As well it works without any embed #{}.
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0