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
333 334 335 336 337 338 |
# File 'lib/t_ruby/ir.rb', line 333 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.
330 331 332 |
# File 'lib/t_ruby/ir.rb', line 330 def body @body end |
#condition ⇒ Object
Returns the value of attribute condition.
330 331 332 |
# File 'lib/t_ruby/ir.rb', line 330 def condition @condition end |
#kind ⇒ Object
Returns the value of attribute kind.
330 331 332 |
# File 'lib/t_ruby/ir.rb', line 330 def kind @kind end |
Instance Method Details
#children ⇒ Object
340 341 342 |
# File 'lib/t_ruby/ir.rb', line 340 def children [@condition, @body].compact end |