示例#1
0
        public object VisitThisExpr(Expr.This 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
文件: Resolver.cs 项目: leddt/cslox
        public Void Visit(Expr.This expr)
        {
            if (currentClass == ClassType.None)
            {
                Lox.Error(expr.Keyword, "Cannot use 'this' outside of a class.");
            }
            else
            {
                ResolveLocal(expr, expr.Keyword);
            }

            return(Void.Instance);
        }
示例#3
0
 public object VisitThisExpr(Expr.This expr)
 {
     return(LookUpVariable(expr.Keyword, expr));
 }
示例#4
0
 object Expr.IVisitor <object> .VisitThisExpr(Expr.This expr)
 {
     return(LookUpVariable(expr.keyword, expr));
 }
示例#5
0
 public string VisitThisExpr(Expr.This expr)
 {
     throw new NotImplementedException();
 }
示例#6
0
 object Expr.IVisitor <object> .VisitThisExpr(Expr.This expr)
 {
     ResolveLocal(expr, expr.keyword);
     return(null);
 }