Class: LibRubyParser::Nodes::For
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::For
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents a for
loop
Instance Attribute Summary collapse
-
#begin_l ⇒ Loc
readonly
Location of the
do
keyword. -
#body ⇒ Node?
readonly
Body of the loop.
-
#end_l ⇒ Loc
readonly
Location of the
end
keyword. -
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#iteratee ⇒ Node
readonly
Collection that is for iteration.
-
#iterator ⇒ Node
readonly
Variable that is used in loop,
Lvasgn("a")
infor a in b; end
. -
#keyword_l ⇒ Loc
readonly
Location of the
for
keyword. -
#operator_l ⇒ Loc
readonly
Location of the
in
keyword.
Instance Attribute Details
#begin_l ⇒ Loc (readonly)
Location of the do
keyword
for a in b do; end
~~
Note: this do
is optional, and so begin_l
can be None
.
1549 1550 1551 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1549 def begin_l @begin_l end |
#body ⇒ Node? (readonly)
Body of the loop. None
if there's no body
1520 1521 1522 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1520 def body @body end |
#end_l ⇒ Loc (readonly)
Location of the end
keyword
for a in b; end
~~~
1558 1559 1560 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1558 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
for a in b; end
~~~~~~~~~~~~~~~
1567 1568 1569 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1567 def expression_l @expression_l end |
#iteratee ⇒ Node (readonly)
Collection that is for iteration. Lvar("b")
in for a in b; end
1516 1517 1518 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1516 def iteratee @iteratee end |
#iterator ⇒ Node (readonly)
Variable that is used in loop, Lvasgn("a")
in for a in b; end
1512 1513 1514 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1512 def iterator @iterator end |
#keyword_l ⇒ Loc (readonly)
Location of the for
keyword
for a in b; end
~~~
1529 1530 1531 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1529 def keyword_l @keyword_l end |
#operator_l ⇒ Loc (readonly)
Location of the in
keyword
for a in b; end
~~
1538 1539 1540 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1538 def operator_l @operator_l end |