public object visitAssignExpr(Expr.Assign expr) { object value = evaluate(expr.value); environment.assign(expr.name, value); return(value); }
public object Visit(Expr.Assign _assign) { Resolve(_assign.value); ResolveLocal(_assign, _assign.name); return(null); }
object Expr.IVisitor <object> .Visit(Expr.Assign _assign) { object value = Evaluate(_assign.value); if (_locals.TryGetValue(_assign, out int distance)) { _environment.AssignAt(distance, _assign.name, value); } else { Globals.Assign(_assign.name, value); } return(value); }
public object VisitAssignExpr(Expr.Assign expr) { var value = Evaluate(expr.Value); if (_locals.TryGetValue(expr, out var distance)) { _environment.AssignAt(distance, expr.Name, value); } else { Globals.Assign(expr.Name, value); } return(value); }
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 { environment.Assign(expr.name, value); } return(value); }
string Expr.IVisitor <string> .Visit(Expr.Assign _assign) { throw new NotImplementedException(); }
public string visitAssignExpr(Expr.Assign expr) { return($"Assign {expr.name.lexeme}"); }
public object VisitAssignExpr(Expr.Assign expr) { Resolve(expr.value); ResolveLocal(expr, expr.name); return(null); }
public Void VisitAssignExpr(Expr.Assign expr) { Resolve(expr.Value); ResolveLocal(expr, expr.Name); return(null); }
public string VisitAssignExpr(Expr.Assign expr) { return($"({expr.name} <- {expr.value.Accept(this)})"); }