-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
RUBY_VERSION # => "3.0.0"
require 'parser/current'
sexp = Parser::CurrentRuby.parse <<~RUBY
def omg = 123
def wat
123
end
RUBY
one, three = sexp.children
# => [s(:def, :omg,
# s(:args),
# s(:int, 123)),
# s(:def, :wat,
# s(:args),
# s(:int, 123))]
one.loc.assignment # => #<Parser::Source::Range (string) 8...9>
one.loc.end # => nil
three.loc.assignment # => nil
three.loc.end # => #<Parser::Source::Range (string) 29...32>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels