Class: LibRubyParser::Nodes::ArrayPattern
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::ArrayPattern
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents an array pattern used in pattern matching
Instance Attribute Summary collapse
-
#begin_l ⇒ Loc?
readonly
Location of the open bracket.
-
#elements ⇒ ::Array<Node>
readonly
A list of elements.
-
#end_l ⇒ Loc?
readonly
Location of the closing bracket.
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
Instance Attribute Details
#begin_l ⇒ Loc? (readonly)
Location of the open bracket
[1, ^a, 3 => foo]
~
None
for pattern like 1, 2
without brackets
220 221 222 |
# File 'lib/lib-ruby-parser/nodes.rb', line 220 def begin_l @begin_l end |
#elements ⇒ ::Array<Node> (readonly)
A list of elements
209 210 211 |
# File 'lib/lib-ruby-parser/nodes.rb', line 209 def elements @elements end |
#end_l ⇒ Loc? (readonly)
Location of the closing bracket
[1, ^a, 3 => foo]
~
None
for pattern like 1, 2
without brackets
231 232 233 |
# File 'lib/lib-ruby-parser/nodes.rb', line 231 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
[1, ^a, 3 => foo]
~~~~~~~~~~~~~~~~~
240 241 242 |
# File 'lib/lib-ruby-parser/nodes.rb', line 240 def expression_l @expression_l end |