public object visitThisExpr(Expr.This expr) { if (currentClass == ClassType.NONE) { Lox.ReportError(expr.keyword, "Can't use 'this' outside of a class."); } else if (currentFunction == FunctionType.STATIC) { Lox.ReportError(expr.keyword, "Can't use 'this' in a static method."); } else { ResolveLocal(expr, expr.keyword.lexeme, AccessType.RHS); } return(null); }
public string visitThisExpr(Expr.This expr) { throw new NotImplementedException(); }
public object visitThisExpr(Expr.This expr) { return(LookUpVariable(expr)); }