Class: LibRubyParser::Nodes::Begin
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::Begin
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents compound statement (i.e. a multi-statement)
Basically all blocks of code are wrapped into Begin
node (e.g. method/block body, rescue/ensure handler etc)
Instance Attribute Summary collapse
-
#begin_l ⇒ Loc?
readonly
Begin of the block.
-
#end_l ⇒ Loc?
readonly
End of the block.
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#statements ⇒ ::Array<Node>
readonly
A list of statements.
Instance Attribute Details
#begin_l ⇒ Loc? (readonly)
Begin of the block
(1; 2)
~
None
if the block of code is "implicit", like
if true; 1; 2; end
327 328 329 |
# File 'lib/lib-ruby-parser/nodes.rb', line 327 def begin_l @begin_l end |
#end_l ⇒ Loc? (readonly)
End of the block
(1; 2)
~
None
if the block of code is "implicit", like
if true; 1; 2; end
342 343 344 |
# File 'lib/lib-ruby-parser/nodes.rb', line 342 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
(1; 2)
~~~~~~
351 352 353 |
# File 'lib/lib-ruby-parser/nodes.rb', line 351 def expression_l @expression_l end |
#statements ⇒ ::Array<Node> (readonly)
A list of statements
312 313 314 |
# File 'lib/lib-ruby-parser/nodes.rb', line 312 def statements @statements end |