Class: LibRubyParser::Nodes::ConstPattern

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

Overview

Const pattern used in pattern matching (e.g. ‘in A(1, 2)`)

Instance Attribute Summary collapse

Instance Attribute Details

#begin_lLoc (readonly)

Location of the open parenthesis

“‘text case 1; in Foo(42); end

~

“‘

Returns:



839
840
841
# File 'lib/lib-ruby-parser/nodes.rb', line 839

def begin_l
  @begin_l
end

#constNode (readonly)

Constant that is used, ‘Const(“Foo”)` for `in For(42)`

Returns:



824
825
826
# File 'lib/lib-ruby-parser/nodes.rb', line 824

def const
  @const
end

#end_lLoc (readonly)

Location of the closing parenthesis

“‘text case 1; in Foo(42); end

~

“‘

Returns:



848
849
850
# File 'lib/lib-ruby-parser/nodes.rb', line 848

def end_l
  @end_l
end

#expression_lLoc (readonly)

Location of the full expression

“‘text case 1; in Foo(42); end

~~~~~~~

“‘

Returns:



857
858
859
# File 'lib/lib-ruby-parser/nodes.rb', line 857

def expression_l
  @expression_l
end

#patternNode (readonly)

Inner part of the constant pattern

‘ArrayPattern(vec![ Int(“1”) ])` for `Foo(1)`

Returns:



830
831
832
# File 'lib/lib-ruby-parser/nodes.rb', line 830

def pattern
  @pattern
end