aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/qsp_parser.ml11
1 files changed, 5 insertions, 6 deletions
diff --git a/bin/qsp_parser.ml b/bin/qsp_parser.ml
index 8ab442b..cf64fed 100644
--- a/bin/qsp_parser.ml
+++ b/bin/qsp_parser.ml
@@ -1,8 +1,6 @@
open StdLabels
module Report = Qsp_syntax.Report
-type result = Report.t list [@@deriving show]
-
(** Filter the results given by the analysis *)
let filter_report : Args.filters -> Report.t list -> Report.t -> Report.t list =
fun filters reports r ->
@@ -19,8 +17,8 @@ type ctx = { error_nb : int; warn_nb : int; debug_nb : int }
(*
List all the controls to apply
*)
-let _, _, _, e1 = Qsp_syntax.Check.build (module Qsp_syntax.Type_of)
-let _, _, _, e2 = Qsp_syntax.Check.build (module Qsp_syntax.Dead_end)
+let _, e1 = Qsp_syntax.Check.build (module Qsp_syntax.Type_of)
+let _, e2 = Qsp_syntax.Check.build (module Qsp_syntax.Dead_end)
module Check = Qsp_syntax.Check.Make (struct
let t = [| e1; e2 |]
@@ -34,7 +32,8 @@ let parse_location : ctx:ctx -> Qparser.Lexbuf.t -> Args.filters -> ctx =
let result =
Qparser.Analyzer.parse (module Check) lexbuf
|> Result.map (fun (_, f) ->
- List.fold_left f ~init:[] ~f:(filter_report filters))
+ List.fold_left f ~init:[] ~f:(filter_report filters)
+ |> List.sort ~cmp:Report.compare)
in
match result with
| Ok report -> (
@@ -44,7 +43,7 @@ let parse_location : ctx:ctx -> Qparser.Lexbuf.t -> Args.filters -> ctx =
| _ ->
let start_position, _ = Qparser.Lexbuf.positions lexbuf in
Format.fprintf Format.std_formatter "Location@ %s@;@[%a@]@."
- start_position.Lexing.pos_fname pp_result report;
+ start_position.Lexing.pos_fname Report.pp_result report;
List.fold_left report ~init:ctx ~f:(fun ctx report ->
match report.Report.level with