Class: Sol::SetLocalNode
- Inherits:
-
Struct
- Object
- Struct
- Sol::SetLocalNode
- Defined in:
- lib/sol/nodes.rb,
lib/sol/interpreter.rb
Overview
Setting the value of a local variable.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
70 71 72 |
# File 'lib/sol/nodes.rb', line 70 def name @name end |
#value ⇒ Object
Returns the value of attribute value
70 71 72 |
# File 'lib/sol/nodes.rb', line 70 def value @value end |
Instance Method Details
#eval(context) ⇒ Object
151 152 153 154 155 |
# File 'lib/sol/interpreter.rb', line 151 def eval(context) context.locals[name] = value.eval(context) end |