Class: LibRubyParser::Nodes::While

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

Overview

Represents while loop

Instance Attribute Summary collapse

Instance Attribute Details

#begin_lLoc? (readonly)

Location of the do keyword

while cond do; foo; end
           ~~

do is optional, and so begin_l can be None

Returns:



4236
4237
4238
# File 'lib/lib-ruby-parser/nodes.rb', line 4236

def begin_l
  @begin_l
end

#bodyNode? (readonly)

Body of the loop.

None if body is empty

Returns:



4216
4217
4218
# File 'lib/lib-ruby-parser/nodes.rb', line 4216

def body
  @body
end

#condNode (readonly)

Condition of the loop

Returns:



4210
4211
4212
# File 'lib/lib-ruby-parser/nodes.rb', line 4210

def cond
  @cond
end

#end_lLoc? (readonly)

Location of the end keyword

while cond do; foo; end
                    ~~~

None if loop is a modifier (i.e. foo while bar)

Returns:



4247
4248
4249
# File 'lib/lib-ruby-parser/nodes.rb', line 4247

def end_l
  @end_l
end

#expression_lLoc (readonly)

Location of the full expression

while cond do; foo; end
~~~~~~~~~~~~~~~~~~~~~~~

foo while bar
~~~~~~~~~~~~~

Returns:



4259
4260
4261
# File 'lib/lib-ruby-parser/nodes.rb', line 4259

def expression_l
  @expression_l
end

#keyword_lLoc (readonly)

Location of the while keyword

while cond do; foo; end
~~~~~

Returns:



4225
4226
4227
# File 'lib/lib-ruby-parser/nodes.rb', line 4225

def keyword_l
  @keyword_l
end