コード例 #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
ファイル: Interpreter.cs プロジェクト: andrewl33/cslox
 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);
 }