Class: WhileNode
- Inherits:
-
Struct
- Object
- Struct
- WhileNode
- Defined in:
- lib/turmali/nodes.rb,
lib/turmali/interpreter.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#condition ⇒ Object
Returns the value of attribute condition.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
48 49 50 |
# File 'lib/turmali/nodes.rb', line 48 def body @body end |
#condition ⇒ Object
Returns the value of attribute condition
48 49 50 |
# File 'lib/turmali/nodes.rb', line 48 def condition @condition end |
Instance Method Details
#eval(context) ⇒ Object
129 130 131 132 133 134 |
# File 'lib/turmali/interpreter.rb', line 129 def eval(context) while @condition.eval(context).ruby_value @body.eval(context) end Constants["nil"] end |