Class: LibRubyParser::Nodes::KwBegin
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::KwBegin
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents an explicit begin; end
block.
The reason why it's different is that
begin; foo; end while cond
is a post-while loop (same with post-until loop)
Instance Attribute Summary collapse
-
#begin_l ⇒ Loc?
readonly
Location of the
begin
keyword. -
#end_l ⇒ Loc?
readonly
Location of the
end
keyword. -
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#statements ⇒ ::Array<Node>
readonly
A list of statements.
Instance Attribute Details
#begin_l ⇒ Loc? (readonly)
Location of the begin
keyword
begin; foo; end
~~~~~
2315 2316 2317 |
# File 'lib/lib-ruby-parser/nodes.rb', line 2315 def begin_l @begin_l end |
#end_l ⇒ Loc? (readonly)
Location of the end
keyword
begin; foo; end
~~~
2324 2325 2326 |
# File 'lib/lib-ruby-parser/nodes.rb', line 2324 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
begin; foo; bar
~~~~~~~~~~~~~~~
2333 2334 2335 |
# File 'lib/lib-ruby-parser/nodes.rb', line 2333 def expression_l @expression_l end |
#statements ⇒ ::Array<Node> (readonly)
A list of statements
2306 2307 2308 |
# File 'lib/lib-ruby-parser/nodes.rb', line 2306 def statements @statements end |