Open JoshCheek opened 3 years ago
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>