Class: LibRubyParser::Nodes::CaseMatch

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

Overview

Represents a case statement used for pattern matching (for regular case see Case node)

Instance Attribute Summary collapse

Instance Attribute Details

#else_bodyNode? (readonly)

Body of the else branch, None if there’s no else branch

Returns:



573
574
575
# File 'lib/lib-ruby-parser/nodes.rb', line 573

def else_body
  @else_body
end

#else_lLoc? (readonly)

Location of the else keyword

“‘text case 1; in 2; else; end

~~~~

“‘

None if there’s no else branch

Returns:



593
594
595
# File 'lib/lib-ruby-parser/nodes.rb', line 593

def else_l
  @else_l
end

#end_lLoc (readonly)

Location of the end keyword

“‘text case 1; in 2; end

~~~

“‘

Returns:



602
603
604
# File 'lib/lib-ruby-parser/nodes.rb', line 602

def end_l
  @end_l
end

#exprNode (readonly)

Expression given to case, ‘Int(“1”)` for `case 1; in 1; end` None for code like

“‘text case in pattern end “`

Returns:



565
566
567
# File 'lib/lib-ruby-parser/nodes.rb', line 565

def expr
  @expr
end

#expression_lLoc (readonly)

Location of the full expression

“‘text case 1; in 2; end ~~~~~~~~~~~~~~~~~ “`

Returns:



611
612
613
# File 'lib/lib-ruby-parser/nodes.rb', line 611

def expression_l
  @expression_l
end

#in_bodies::Array<Node> (readonly)

A list of InPattern nodes (each has pattern, guard and body)

Returns:



569
570
571
# File 'lib/lib-ruby-parser/nodes.rb', line 569

def in_bodies
  @in_bodies
end

#keyword_lLoc (readonly)

Location of the case keyword

“‘text case 1; in 2; end ~~~~ “`

Returns:



582
583
584
# File 'lib/lib-ruby-parser/nodes.rb', line 582

def keyword_l
  @keyword_l
end