public Void Visit(Expr.Assign expr) { Resolve(expr.Value); ResolveLocal(expr, expr.Name); return(Void.Instance); }
object Expr.IVisitor <object> .VisitAssignExpr(Expr.Assign expr) { object value = Evaluate(expr.value); environment.Assign(expr.name, value); return(value); }
public object VisitAssignExpr(Expr.Assign expr) { object value = Evaluate(expr.Value); if (locals.ContainsKey(expr)) { environment.AssignAt(locals[expr], expr.name, value); } else { environment.Assign(expr.name, value); } return(value); }
public object VisitAssign(Expr.Assign expr) { var value = Evaluate(expr.Value); int distance; if (_locals.TryGetValue(expr, out distance)) { _environment.AssignAt(distance, expr.Name, value); } else { _globals.Assign(expr.Name, value); } return(value); }
public string VisitAssign(Expr.Assign expr) { return(Parenthesize("set", expr.Name.Lexeme, expr.Value)); }
public object VisitAssignExpr(Expr.Assign expr) { Resolve(expr.Value); ResolveLocal(expr, expr.name); return(null); }
public string VisitAssignExpr(Expr.Assign expr) { return(parenthesize(expr.name.Lexeme, expr.Value)); }
public Unit VisitAssign(Expr.Assign expr) { Resolve(expr.Value); ResolveLocal(expr, expr.Name); return(Unit.Default); }
object Expr.IVisitor <object> .VisitAssignExpr(Expr.Assign expr) { Resolve(expr.value); ResolveLocal(expr, expr.name); return(null); }