Example #1
0
        public object visitExprAssignExpr(ExprAssign expr)
        {
            object value = evaluate(expr.value);

            int distance;

            if (locals.TryGetValue(expr, out distance))
            {
                enviroment.assignAt(distance, expr.name, value);
            }
            else
            {
                globals.assign(expr.name, value);
            }

            return(value);
        }
Example #2
0
 public object visitExprAssignExpr(ExprAssign expr)
 {
     resolve(expr.value);
     resolveLocal(expr, expr.name);
     return(null);
 }
Example #3
0
 public object visitExprAssignExpr(ExprAssign expr)
 {
     throw new NotImplementedException();
 }