示例#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)");
 }
 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);
        }