예제 #1
0
 public object visitThisExpr(Expr.This _this)
 {
     if (currentClass == ClassType.NONE)
     {
         Lox.error(_this.keyword, "Can't use 'this' outside of a class.");
         return(null);
     }
     resolveLocal(_this, _this.keyword);
     return(null);
 }
예제 #2
0
 public Void VisitThisExpr(Expr.This expr)
 {
     if (_currentClass == ClassType.NONE)
     {
         Lox.Error(expr.Keyword, "Can't use 'this' outside of a class.");
         return(null);
     }
     ResolveLocal(expr, expr.Keyword);
     return(null);
 }
예제 #3
0
 public object VisitThisExpr(Expr.This expr)
 {
     if (currentClass == ClassType.NONE)
     {
         Lox.Error(expr.keyword, "Cannot use 'this' outside of a class.");
         return(null);
     }
     // When "this" is encountered, we just look it up like it was any other variable.
     ResolveLocal(expr, expr.keyword);
     return(null);
 }
예제 #4
0
 object Expr.IVisitor <object> .Visit(Expr.This _this)
 {
     return(LookUpVariable(_this.keyword, _this));
 }
예제 #5
0
 string Expr.IVisitor <string> .Visit(Expr.This _this)
 {
     throw new NotImplementedException();
 }
예제 #6
0
 public object VisitThisExpr(Expr.This expr)
 => LookUpVariable(expr.Keyword, expr);
예제 #7
0
 public string visitThisExpr(Expr.This _this)
 {
     return("(this)");
 }
예제 #8
0
 public object VisitThisExpr(Expr.This expr)
 {
     return(LookupVariable(expr.keyword, expr));
 }
예제 #9
0
 public string VisitThisExpr(Expr.This expr)
 {
     throw new NotImplementedException();
 }
예제 #10
0
 public object visitThisExpr(Expr.This _this)
 {
     return(lookUpVariable(_this.keyword, _this));
 }
예제 #11
0
        public object Visit(Expr.This _this)
        {
            ResolveLocal(_this, _this.keyword);

            return(null);
        }