aboutsummaryrefslogtreecommitdiff
path: root/bin/qsp_parser.ml
diff options
context:
space:
mode:
Diffstat (limited to 'bin/qsp_parser.ml')
-rw-r--r--bin/qsp_parser.ml14
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/qsp_parser.ml b/bin/qsp_parser.ml
index 1b2b90c..70f474e 100644
--- a/bin/qsp_parser.ml
+++ b/bin/qsp_parser.ml
@@ -48,7 +48,7 @@ let pp_modules formatter =
(* Print the name, left justified, with enought spaces for the all the
identifiers *)
- Format.fprintf formatter "%-*s" (max_length + 1) "Name";
+ Format.fprintf formatter "%-*s" (succ max_length) "Name";
(* Tab delimiter *)
Format.pp_set_tab formatter ();
Format.fprintf formatter "Active ";
@@ -65,6 +65,10 @@ let pp_modules formatter =
Format.pp_close_tbox formatter ();
Format.pp_print_break formatter 0 0
+(** Get all the tests to apply.
+
+ The expression is declared lazy in order to be sure to apply the filters
+ from the command line before. *)
let checkers : (module Qsp_syntax.S.Analyzer) Lazy.t =
lazy
(let module Check = Qsp_syntax.Check.Make (struct
@@ -102,14 +106,14 @@ let parse_location : ctx:ctx -> Qparser.Lexbuf.t -> Args.filters -> ctx =
List.fold_left report ~init:ctx ~f:(fun ctx report ->
match report.Report.level with
- | Error -> { ctx with error_nb = ctx.error_nb + 1 }
- | Warn -> { ctx with warn_nb = ctx.warn_nb + 1 }
- | Debug -> { ctx with debug_nb = ctx.debug_nb + 1 }))
+ | Error -> { ctx with error_nb = succ ctx.error_nb }
+ | Warn -> { ctx with warn_nb = succ ctx.warn_nb }
+ | Debug -> { ctx with debug_nb = succ ctx.debug_nb }))
| Error e ->
let start_position, _ = Qparser.Lexbuf.positions lexbuf in
Format.fprintf Format.std_formatter "Location@ %s@;@[%a]@."
start_position.Lexing.pos_fname Report.pp e;
- { ctx with error_nb = ctx.error_nb + 1 }
+ { ctx with error_nb = succ ctx.error_nb }
let default_ctx = { error_nb = 0; warn_nb = 0; debug_nb = 0 }