Class: LibRubyParser::Nodes::FindPattern
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::FindPattern
- 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
-
#begin_l ⇒ Loc?
readonly
Location of the begin.
-
#elements ⇒ ::Array<Node>
readonly
Inner part of the find pattern.
-
#end_l ⇒ Loc?
readonly
Location of the end.
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
Instance Attribute Details
#begin_l ⇒ Loc? (readonly)
Location of the begin
case foo; in [*x, 1 => a, *y]; end
~
None
if there are no brackets/parentheses
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
1447 1448 1449 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1447 def elements @elements end |
#end_l ⇒ Loc? (readonly)
Location of the end
case foo; in [*x, 1 => a, *y]; end
~
None
if there are no brackets/parentheses
1469 1470 1471 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1469 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
case foo; in [*x, 1 => a, *y]; end
~~~~~~~~~~~~~~~~
1478 1479 1480 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1478 def expression_l @expression_l end |