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
347 348 349 350 351 352 |
# File 'lib/t_ruby/ir.rb', line 347 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.
344 345 346 |
# File 'lib/t_ruby/ir.rb', line 344 def body @body end |
#condition ⇒ Object
Returns the value of attribute condition.
344 345 346 |
# File 'lib/t_ruby/ir.rb', line 344 def condition @condition end |
#kind ⇒ Object
Returns the value of attribute kind.
344 345 346 |
# File 'lib/t_ruby/ir.rb', line 344 def kind @kind end |
Instance Method Details
#children ⇒ Object
354 355 356 |
# File 'lib/t_ruby/ir.rb', line 354 def children [@condition, @body].compact end |