예제 #1
0
파일: Resolver.cs 프로젝트: mhorskaya/cslox
        public object VisitThisExpr(Expr.ThisExpr expr)
        {
            if (_currentClass == ClassType.NONE)
            {
                Lox.Error(expr.Keyword, "Cannot use 'this' outside of a class.");
                return(null);
            }

            ResolveLocal(expr, expr.Keyword);
            return(null);
        }
예제 #2
0
 public string VisitThisExpr(Expr.ThisExpr expr)
 {
     return("this");
 }