examples: annotate examples
[nit.git] / lib / niti_runtime.nit
index a618fba..198f3a8 100644 (file)
@@ -27,17 +27,10 @@ redef class Sys
        # Read the next useful line from file-name arguments
        private fun read_next_line
        do
-               if stdin.eof then
+               while stdin.eof do
                        open_next_stream
                end
-               var line = stdin.read_line
-               loop
-                       if not stdin.eof then break
-                       open_next_stream
-                       if not line.is_empty then break
-                       line = stdin.read_line
-               end
-               self.line = line
+               self.line = stdin.read_line
        end
 
        # Open the next file until there is no more arguments
@@ -45,9 +38,9 @@ redef class Sys
        do
                if args.is_empty then exit(0)
                stdin.close
-               stdin = new IFStream.open(args.shift)
+               stdin = new FileReader.open(args.shift)
        end
 
        # The next line to process by the main program
-       var line: String
+       var line: String is noautoinit
 end