Skip to content

Endless method support #158

@JoshCheek

Description

@JoshCheek
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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions