public object visitAssignExpr(Expr.AssignExpr assignExpr) { object value = evaluate(assignExpr.value); if (locals.TryGetValue(assignExpr, out int distance)) { environment.assignAt(distance, assignExpr.name, value); } else { globals.assign(assignExpr.name, value); } return(value); }
public object visitAssignExpr(Expr.AssignExpr assignExpr) { resolve(assignExpr.value); resolveLocal(assignExpr, assignExpr.name); return(null); }
public string VisitAssignExpr(Expr.AssignExpr expr) { return(Parenthesize2("=", expr.Name.Lexeme, expr.Value)); }
public string visitAssignExpr(Expr.AssignExpr assignExpr) { return(parenthesize("= " + assignExpr.name.lexeme, new Expr[] { assignExpr.value })); }
public object VisitAssignExpr(Expr.AssignExpr expr) { Resolve(expr.Value); ResolveLocal(expr, expr.Name); return(null); }