public object VisitSetExpr(Expr.Set expr) { Resolve(expr.value); Resolve(expr.obj); return(null); }
public LoxVoid VisitSetExpr(Expr.Set expr) { Resolve(expr.Value); Resolve(expr.Instance); return(null); }
public object visitSetExpr(Expr.Set setExpr) { compile(setExpr.object_); compile(setExpr.value); captureToken(setExpr.name); byte name = identifierConstant(setExpr.name); emitBytes((byte)OpCode.OP_SET_PROPERTY, name); return(null); }
public object VisitSetExpr(Expr.Set expr) { var obj = Evaluate(expr.obj); if (obj is LoxInstance li) { var value = Evaluate(expr.value); li.Set(expr.name, value); return(value); } throw new RuntimeException(expr.name, "Only instances have fields."); }
public object VisitSetExpr(Expr.Set expr) { object instanceObj = Evalutate(expr.Instance); if (instanceObj is LoxInstance instance) { object value = Evalutate(expr.Value); instance.Set(expr.Name, value); return(value); } throw new RuntimeError(expr.Name, "Only instnaces have fields."); }
public object Visit(Expr.Set expr) { object obj = Evaluate(expr.Object); if (!(obj is LoxInstance)) { throw new RuntimeErrorException(expr.Name, "only instances have fields."); } object value = Evaluate(expr.Value); ((LoxInstance)obj).Set(expr.Name, value); return(value); }
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) { object obj = Evaluate(expr.Obj); if (!(obj is LoxInstance)) { throw new InterpretingException(expr.Name, "Only instances have fields."); } object value = Evaluate(expr.Value); ((LoxInstance)obj).Set(expr.Name, value); return(value); }
public object VisitSetExpr(Expr.Set expr) { object expression = Evaluate(expr.Expression); if (!(expression is LoxInstance)) { throw new RuntimeException(expr.Name, "Only instances have fields."); } object value = Evaluate(expr.Value); ((LoxInstance)expression).Set(expr.Name, value); return(value); }
public Unit VisitSetExpr(Expr.Set expr) { Resolve(expr.Value); Resolve(expr.Object); return(new Unit()); }
public object VisitSetExpr(Expr.Set expr, object options) { return(Parenthesize2("=", expr.obj, expr.token.lexeme, expr.value)); }
public string visitSetExpr(Expr.Set expr) { throw new NotImplementedException(); }
public Token visitSetExpr(Expr.Set set) { return(set.name); }
public object VisitSetExpr(Expr.Set expr, object options = null) { return(null); }
public object VisitSetExpr(Expr.Set expr) { Resolve(expr.Value); Resolve(expr.Expression); return(null); }
public string VisitSetExpr(Expr.Set expr) { return($"{PrintExpr(expr.Instance)}.{expr.Name.Lexeme}"); }
public string VisitSetExpr(Expr.Set expr) { return(Parenthesize("set", expr.@object, expr.value)); }
/// <summary> /// Resolve a property set /// </summary> /// <param name="expr"></param> /// <returns></returns> public object Visit(Expr.Set expr) { Resolve(expr.Value); Resolve(expr.Object); return(null); }
public object visitSetExpr(Expr.Set expr) { resolve(expr.value); resolve(expr.object_); return(null); }