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); }
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); }
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); }
object Expr.IVisitor <object> .Visit(Expr.This _this) { return(LookUpVariable(_this.keyword, _this)); }
string Expr.IVisitor <string> .Visit(Expr.This _this) { throw new NotImplementedException(); }
public object VisitThisExpr(Expr.This expr) => LookUpVariable(expr.Keyword, expr);
public string visitThisExpr(Expr.This _this) { return("(this)"); }
public object VisitThisExpr(Expr.This expr) { return(LookupVariable(expr.keyword, expr)); }
public string VisitThisExpr(Expr.This expr) { throw new NotImplementedException(); }
public object visitThisExpr(Expr.This _this) { return(lookUpVariable(_this.keyword, _this)); }
public object Visit(Expr.This _this) { ResolveLocal(_this, _this.keyword); return(null); }