1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # This file is free software, which comes along with NIT. This software is
4 # distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
5 # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
6 # PARTICULAR PURPOSE. You can modify it is you want, provided this header
7 # is kept unaltered, and a notification of the changes is added.
8 # You are allowed to redistribute it and sell it, alone or is a part of
11 # Runtime library to loop around the main program for each line in file-name arguments
13 # Used by the interpreter when `-n` is used
18 if not args
.is_empty
then
27 # Read the next useful line from file-name arguments
28 private fun read_next_line
33 self.line
= stdin
.read_line
36 # Open the next file until there is no more arguments
37 private fun open_next_stream
39 if args
.is_empty
then exit
(0)
41 stdin
= new FileReader.open
(args
.shift
)
44 # The next line to process by the main program
45 var line
: String is noautoinit