Class: LibRubyParser::Nodes::ArrayPatternWithTail

Inherits:
LibRubyParser::Node show all
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

Instance Attribute Details

#begin_lLoc? (readonly)

Location of the open bracket

[1, ^a, 3 => foo,]
~

None for pattern like 1, 2, without brackets

Returns:



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

Returns:



250
251
252
# File 'lib/lib-ruby-parser/nodes.rb', line 250

def elements
  @elements
end

#end_lLoc? (readonly)

Location of the closing bracket

[1, ^a, 3 => foo,]
                 ~

None for pattern like 1, 2, without brackets

Returns:



272
273
274
# File 'lib/lib-ruby-parser/nodes.rb', line 272

def end_l
  @end_l
end

#expression_lLoc (readonly)

Location of the full expression

[1, ^a, 3 => foo,]
~~~~~~~~~~~~~~~~~~

Returns:



281
282
283
# File 'lib/lib-ruby-parser/nodes.rb', line 281

def expression_l
  @expression_l
end