Class: LibRubyParser::Nodes::While
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::While
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents while
loop
Instance Attribute Summary collapse
-
#begin_l ⇒ Loc?
readonly
Location of the
do
keyword. -
#body ⇒ Node?
readonly
Body of the loop.
-
#cond ⇒ Node
readonly
Condition of the loop.
-
#end_l ⇒ Loc?
readonly
Location of the
end
keyword. -
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#keyword_l ⇒ Loc
readonly
Location of the
while
keyword.
Instance Attribute Details
#begin_l ⇒ Loc? (readonly)
Location of the do
keyword
while cond do; foo; end
~~
do
is optional, and so begin_l
can be None
4236 4237 4238 |
# File 'lib/lib-ruby-parser/nodes.rb', line 4236 def begin_l @begin_l end |
#body ⇒ Node? (readonly)
Body of the loop.
None
if body is empty
4216 4217 4218 |
# File 'lib/lib-ruby-parser/nodes.rb', line 4216 def body @body end |
#cond ⇒ Node (readonly)
Condition of the loop
4210 4211 4212 |
# File 'lib/lib-ruby-parser/nodes.rb', line 4210 def cond @cond end |
#end_l ⇒ Loc? (readonly)
Location of the end
keyword
while cond do; foo; end
~~~
None
if loop is a modifier (i.e. foo while bar
)
4247 4248 4249 |
# File 'lib/lib-ruby-parser/nodes.rb', line 4247 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
while cond do; foo; end
~~~~~~~~~~~~~~~~~~~~~~~
foo while bar
~~~~~~~~~~~~~
4259 4260 4261 |
# File 'lib/lib-ruby-parser/nodes.rb', line 4259 def expression_l @expression_l end |
#keyword_l ⇒ Loc (readonly)
Location of the while
keyword
while cond do; foo; end
~~~~~
4225 4226 4227 |
# File 'lib/lib-ruby-parser/nodes.rb', line 4225 def keyword_l @keyword_l end |