Class: LibRubyParser::Nodes::FindPattern

Inherits:
LibRubyParser::Node show all
Defined in:
lib/lib-ruby-parser/nodes.rb

Overview

Represents a find pattern using in pattern matching (i.e. in [*x, 1 => a, *y])

It's different from ArrayPattern/ConstPattern because it supports multiple wildcard pattern

Instance Attribute Summary collapse

Instance Attribute Details

#begin_lLoc? (readonly)

Location of the begin

case foo; in [*x, 1 => a, *y]; end
             ~

None if there are no brackets/parentheses

Returns:



1458
1459
1460
# File 'lib/lib-ruby-parser/nodes.rb', line 1458

def begin_l
  @begin_l
end

#elements::Array<Node> (readonly)

Inner part of the find pattern

Returns:



1447
1448
1449
# File 'lib/lib-ruby-parser/nodes.rb', line 1447

def elements
  @elements
end

#end_lLoc? (readonly)

Location of the end

case foo; in [*x, 1 => a, *y]; end
                            ~

None if there are no brackets/parentheses

Returns:



1469
1470
1471
# File 'lib/lib-ruby-parser/nodes.rb', line 1469

def end_l
  @end_l
end

#expression_lLoc (readonly)

Location of the full expression

case foo; in [*x, 1 => a, *y]; end
             ~~~~~~~~~~~~~~~~

Returns:



1478
1479
1480
# File 'lib/lib-ruby-parser/nodes.rb', line 1478

def expression_l
  @expression_l
end