Remove Nit source files from a list of arguments.

Items of args that can be loaded as a nit file will be removed from args and returned.

Property definitions

nitc :: loader $ ModelBuilder :: filter_nit_source
	# Remove Nit source files from a list of arguments.
	#
	# Items of `args` that can be loaded as a nit file will be removed from `args` and returned.
	fun filter_nit_source(args: Array[String]): Array[String]
	do
		var keep = new Array[String]
		var res = new Array[String]
		for a in args do
			var stat = a.to_path.stat
			if stat != null and stat.is_dir then
				res.add a
				continue
			end
			var l = identify_module(a)
			if l == null then
				keep.add a
			else
				res.add a
			end
		end
		args.clear
		args.add_all(keep)
		return res
	end
src/loader.nit:711,2--734,4