tests: tests.sh detects directories before trying to execute them
[nit.git] / src / test_parser.nit
index 193a734..89682cc 100644 (file)
@@ -22,7 +22,7 @@ import parser_util
 
 class PrintTreeVisitor
        super Visitor
-       private var rank: Int
+       private var rank: Int = 0
        redef fun visit(n)
        do
                if n isa Token then
@@ -34,11 +34,6 @@ class PrintTreeVisitor
                n.visit_all(self)
                rank = rank - 1
        end
-
-       init
-       do
-               rank = 0
-       end
 end
 
 var no_print = false
@@ -120,7 +115,7 @@ else
                if no_file then
                        source = new SourceFile.from_string("", a)
                else
-                       var f = new IFStream.open(a)
+                       var f = new FileReader.open(a)
                        source = new SourceFile(a, f)
                        f.close
                end