public object VisitSetExpr(Expr.Set expr) { switch (Evaluate(expr.obj)) { case LoxInstance objectInstance: object value = Evaluate(expr.value); objectInstance.Set(expr.name, value); return(value); } throw new RuntimeError(expr.name, "Only instances have fields"); }
public string VisitSetExpr(Expr.Set expr) { return("Printing set expression not implemeneted"); }
public MyVoid VisitSetExpr(Expr.Set expr) { resolve(expr.value); resolve(expr.obj); return(null); }