public object VisitSetExpr(Expr.Set expr) { object @object = Evaluate(expr.Object); if (!(@object is LoxInstance)) { throw new RuntimeError(expr.Name, "Only instances have fields"); } object value = Evaluate(expr.Value); ((LoxInstance)@object).Set(expr.Name, value); return(value); }
public object VisitSetExpr(Expr.Set expr) { Resolve(expr.Value); Resolve(expr.Object); return(null); }
public string Visit(Expr.Set expr) { throw new NotImplementedException(); }