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:, condition: nil, body:, **opts) ⇒ Loop
constructor
kind: :while, :until, :loop.
Methods inherited from Node
Constructor Details
#initialize(kind:, condition: nil, body:, **opts) ⇒ Loop
kind: :while, :until, :loop
317 318 319 320 321 322 |
# File 'lib/t_ruby/ir.rb', line 317 def initialize(kind:, condition: nil, body:, **opts) super(**opts) @kind = kind @condition = condition @body = body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
314 315 316 |
# File 'lib/t_ruby/ir.rb', line 314 def body @body end |
#condition ⇒ Object
Returns the value of attribute condition.
314 315 316 |
# File 'lib/t_ruby/ir.rb', line 314 def condition @condition end |
#kind ⇒ Object
Returns the value of attribute kind.
314 315 316 |
# File 'lib/t_ruby/ir.rb', line 314 def kind @kind end |
Instance Method Details
#children ⇒ Object
324 325 326 |
# File 'lib/t_ruby/ir.rb', line 324 def children [@condition, @body].compact end |