Class: Pione::Lang::VariableBindingDeclaration
- Inherits:
-
Declaration
- Object
- StructX
- Declaration
- Pione::Lang::VariableBindingDeclaration
- Defined in:
- lib/pione/lang/declaration.rb
Overview
VariableBindingDeclaration is a declaration for binding variable to expression.
Instance Method Summary collapse
-
#eval(env) ⇒ Object
Update variable table in the environment with the variable and bound expression.
Methods inherited from Declaration
Methods included from Util::Positionable
#line_and_column, #pos, #set_source_position
Instance Method Details
#eval(env) ⇒ Object
Update variable table in the environment with the variable and bound expression. We expect +expr1+ is a variable or variable generating expression.
63 64 65 66 67 68 69 |
# File 'lib/pione/lang/declaration.rb', line 63 def eval(env) var = get_reference(env, expr1, Variable) val = expr2 # update variable table env.variable_set(var, val) end |