Class: LibRubyParser::Nodes::Begin

Inherits:
LibRubyParser::Node show all
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

Instance Attribute Details

#begin_lLoc? (readonly)

Begin of the block

(1; 2)
~

None if the block of code is "implicit", like

if true; 1; 2; end

Returns:



327
328
329
# File 'lib/lib-ruby-parser/nodes.rb', line 327

def begin_l
  @begin_l
end

#end_lLoc? (readonly)

End of the block

(1; 2)
     ~

None if the block of code is "implicit", like

if true; 1; 2; end

Returns:



342
343
344
# File 'lib/lib-ruby-parser/nodes.rb', line 342

def end_l
  @end_l
end

#expression_lLoc (readonly)

Location of the full expression

(1; 2)
~~~~~~

Returns:



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

Returns:



312
313
314
# File 'lib/lib-ruby-parser/nodes.rb', line 312

def statements
  @statements
end