Class: LibRubyParser::Nodes::ConstPattern
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::ConstPattern
- 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
-
#begin_l ⇒ Loc
readonly
Location of the open parenthesis.
-
#const ⇒ Node
readonly
Constant that is used, ‘Const(“Foo”)` for `in For(42)`.
-
#end_l ⇒ Loc
readonly
Location of the closing parenthesis.
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#pattern ⇒ Node
readonly
Inner part of the constant pattern.
Instance Attribute Details
#begin_l ⇒ Loc (readonly)
Location of the open parenthesis
“‘text case 1; in Foo(42); end
~
“‘
839 840 841 |
# File 'lib/lib-ruby-parser/nodes.rb', line 839 def begin_l @begin_l end |
#const ⇒ Node (readonly)
Constant that is used, ‘Const(“Foo”)` for `in For(42)`
824 825 826 |
# File 'lib/lib-ruby-parser/nodes.rb', line 824 def const @const end |
#end_l ⇒ Loc (readonly)
Location of the closing parenthesis
“‘text case 1; in Foo(42); end
~
“‘
848 849 850 |
# File 'lib/lib-ruby-parser/nodes.rb', line 848 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
“‘text case 1; in Foo(42); end
~~~~~~~
“‘
857 858 859 |
# File 'lib/lib-ruby-parser/nodes.rb', line 857 def expression_l @expression_l end |
#pattern ⇒ Node (readonly)
Inner part of the constant pattern
‘ArrayPattern(vec![ Int(“1”) ])` for `Foo(1)`
830 831 832 |
# File 'lib/lib-ruby-parser/nodes.rb', line 830 def pattern @pattern end |