Class: LibRubyParser::Nodes::ArrayPatternWithTail
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::ArrayPatternWithTail
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents an array pattern with trailing comma used in pattern matching
It's slightly different from ArrayPattern
, trailing comma at the end works as , *
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
261 262 263 |
# File 'lib/lib-ruby-parser/nodes.rb', line 261 def begin_l @begin_l end |
#elements ⇒ ::Array<Node> (readonly)
A list of elements
250 251 252 |
# File 'lib/lib-ruby-parser/nodes.rb', line 250 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
272 273 274 |
# File 'lib/lib-ruby-parser/nodes.rb', line 272 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
[1, ^a, 3 => foo,]
~~~~~~~~~~~~~~~~~~
281 282 283 |
# File 'lib/lib-ruby-parser/nodes.rb', line 281 def expression_l @expression_l end |