-# Global context for tools
-class ToolContext
-special MMContext
- # Number of errors
- readable attr _error_count: Int = 0
-
- # Number of warnings
- readable attr _warning_count: Int = 0
-
- # Display an error
- meth error(s: String)
- do
- stderr.write("{s}\n")
- _error_count = _error_count + 1
- end
-
- # Display a warning
- meth warning(s: String)
- do
- if _opt_warn.value == 0 then return
- stderr.write("{s}\n")
- if _opt_warn.value == 1 then
- _warning_count = _warning_count + 1
- else
- _error_count = _error_count + 1
- end
- end