Esempio n. 1
0
        public object VisitAssignExpr(Expr.Assign expr)
        {
            object value = Evaluate(expr.value);

            if (locals.TryGetValue(expr, out int distance))
            {
                environment.AssignAt(distance, expr.name, value);
            }
            else
            {
                globals.Assign(expr.name, value);
            }
            return(value);
        }
Esempio n. 2
0
 public string VisitAssignExpr(Expr.Assign expr)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 3
0
 public object VisitAssignExpr(Expr.Assign expr)
 {
     Resolve(expr.value);
     ResolveLocal(expr, expr.name);
     return(null);
 }