Class: TRuby::IR::Loop
Overview
Loop constructs
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#kind ⇒ Object
Returns the value of attribute kind.
Attributes inherited from Node
#location, #metadata, #type_info
Instance Method Summary collapse
- #children ⇒ Object
-
#initialize(kind:, body:, condition: nil, **opts) ⇒ Loop
constructor
kind: :while, :until, :loop.
Methods inherited from Node
Constructor Details
#initialize(kind:, body:, condition: nil, **opts) ⇒ Loop
kind: :while, :until, :loop
329 330 331 332 333 334 |
# File 'lib/t_ruby/ir.rb', line 329 def initialize(kind:, body:, condition: nil, **opts) super(**opts) @kind = kind @condition = condition @body = body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
326 327 328 |
# File 'lib/t_ruby/ir.rb', line 326 def body @body end |
#condition ⇒ Object
Returns the value of attribute condition.
326 327 328 |
# File 'lib/t_ruby/ir.rb', line 326 def condition @condition end |
#kind ⇒ Object
Returns the value of attribute kind.
326 327 328 |
# File 'lib/t_ruby/ir.rb', line 326 def kind @kind end |
Instance Method Details
#children ⇒ Object
336 337 338 |
# File 'lib/t_ruby/ir.rb', line 336 def children [@condition, @body].compact end |