class ToolContext
special MMContext
# Number of errors
- readable attr _error_count: Int
+ readable attr _error_count: Int = 0
# Number of warnings
- readable attr _warning_count: Int
+ readable attr _warning_count: Int = 0
# Display an error
meth error(s: String)
# Display a warning
meth warning(s: String)
do
- if not _opt_warn.value then return
+ if _opt_warn.value == 0 then return
stderr.write("{s}\n")
- _warning_count = _warning_count + 1
+ if _opt_warn.value == 1 then
+ _warning_count = _warning_count + 1
+ else
+ _error_count = _error_count + 1
+ end
end
# Paths where to locate modules files
readable attr _option_context: OptionContext = new OptionContext
# Option --warn
- readable attr _opt_warn: OptionBool = new OptionBool("Show warnings", "-W", "--warn")
+ readable attr _opt_warn: OptionCount = new OptionCount("Show warnings", "-W", "--warn")
# Option --path
readable attr _opt_path: OptionArray = new OptionArray("Set include path for loaders (may be used more than once)", "-I", "--path")
abort
end
var m = parse_file(context, file, filename, module_name, dir)
- m.filename = filename
if file != stdin then file.close
return m
end
end
redef class MMModule
- # The filename of the module
- readable writable attr _filename: String
-
- # Last modification time
- readable writable attr _mtime: Int
-
# Recurcivelty process an import modules
meth import_supers_modules(names: Collection[Symbol])
do