Legend:
Library
Module
Module type
Parameter
Class
Class type
Sail error reporting
Reporting contains functions to report errors and warnings. It contains functions to print locations (Parse_ast.l and Ast.l) and lexing positions.
The main functionality is reporting errors. This is done by raising a Fatal_error exception. This is caught internally and reported via report_error. There are several predefined types of errors which all cause different error messages. If none of these fit, Err_general can be used.
val opt_warnings : bool Stdlib.ref
If this is false, Sail will never generate any warnings
val opt_backtrace_length : int Stdlib.ref
How many backtrace entries to show for unreachable code errors
val err_lex : Stdlib.Lexing.position ->string -> exn
val unreachable : Parse_ast.l->(string * int * int * int)->string ->'a
Raise an unreachable exception.
This should always be used over an assert false or a generic OCaml failwith exception when appropriate
val print_error : ?interactive:bool ->error-> unit
Print an error to stdout.
parameterinteractive
If this is true (default false) then unreachable errors are reported as general errors. This is used by the interactive read-eval-print loop. The interactive mode exposes a lot of internal features, so it's possible to excute code paths from the interactive mode that would otherwise be unreachable during normal execution.
val forbid_errors : (string * int * int * int)->('a->'b)->'a->'b
This function transforms all errors raised by the provided function into internal Err_unreachable errors
val warn :
?once_from:(string * int * int * int)->string ->Parse_ast.l->string ->
unit
Print a warning message. The first string is printed before the location, the second after.
val simple_warn : string -> unit
Print a simple one-line warning without a location.
val suppress_warnings_for_file : string -> unit
Will suppress all warnings for a given (Sail) file name. Used by $suppress_warnings directive in process_file.ml