Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 public string visitThisExpr(Expr.This expr)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 3
0
 public object visitThisExpr(Expr.This expr)
 {
     return(LookUpVariable(expr));
 }