Example #1
0
        public object VisitSetExpr(Expr.Set expr)
        {
            object objekt = Evaluate(expr.Objekt);

            if (!(objekt is BasilInstance))
            {
                throw new RuntimeError(expr.Name, "Only instances have fields.");
            }

            object value = Evaluate(expr.Value);

            ((BasilInstance)objekt).Set(expr.Name, value);
            return(value);
        }
Example #2
0
 public string VisitSetExpr(Expr.Set expr)
 {
     throw new System.NotImplementedException();
 }
Example #3
0
 public object VisitSetExpr(Expr.Set expr)
 {
     Resolve(expr.Value);
     Resolve(expr.Objekt);
     return(null);
 }