Class: LibRubyParser::Nodes::IfGuard

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

Overview

Represents an if guard used in pattern matching (i.e. case foo; in pattern if guard; end)

Instance Attribute Summary collapse

Instance Attribute Details

#condNode (readonly)

Condition of the guard, Lvar("foo") in in pattern if guard

Returns:



1852
1853
1854
# File 'lib/lib-ruby-parser/nodes.rb', line 1852

def cond
  @cond
end

#expression_lLoc (readonly)

Location of the full expression

case foo; in pattern if cond; end
                     ~~~~~~~

Returns:



1870
1871
1872
# File 'lib/lib-ruby-parser/nodes.rb', line 1870

def expression_l
  @expression_l
end

#keyword_lLoc (readonly)

Location of the if keyword

case foo; in pattern if cond; end
                     ~~

Returns:



1861
1862
1863
# File 'lib/lib-ruby-parser/nodes.rb', line 1861

def keyword_l
  @keyword_l
end