public object visitAssignmentExpr(Expr.Assignment expr) { object value = Evaluate(expr.value); if (locals.TryGetValue(expr, out var exprLocation)) { environment.AssignAt(exprLocation.depth, exprLocation.index, value); } else { globals.Assign(globalIndices[expr], value); } return(value); }
public object visitAssignmentExpr(Expr.Assignment expr) { Resolve(expr.value); ResolveLocal(expr, expr.name.lexeme, AccessType.LHS); return(null); }
public string visitAssignmentExpr(Expr.Assignment expr) { return(parenthesize(expr.name.lexeme + "=", expr.value)); }