aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/qsp_parser.ml6
-rw-r--r--lib/syntax/write_only.ml2
2 files changed, 5 insertions, 3 deletions
diff --git a/bin/qsp_parser.ml b/bin/qsp_parser.ml
index 9a19664..4eb5c66 100644
--- a/bin/qsp_parser.ml
+++ b/bin/qsp_parser.ml
@@ -129,7 +129,9 @@ let () =
let file_names, parameters =
Args.parse ~modules:available_checks ~list_tests:pp_modules
in
- let file_name = List.hd file_names in
+ let file_name =
+ List.filter ~f:(fun name -> name.[0] != '+') file_names |> List.hd
+ in
let ic = Stdlib.open_in_bin file_name in
@@ -142,7 +144,7 @@ let () =
let (module C : Qsp_syntax.S.Analyzer) =
Qsp_syntax.Check.get_module t
in
- if C.is_global then C.active := false);
+ if C.is_global && !C.active then C.active := false);
(* The source file are in UTF-8, and we can use the file line number as
we have only a single location. *)
( Sedlexing.Utf8.from_channel ic,
diff --git a/lib/syntax/write_only.ml b/lib/syntax/write_only.ml
index e77ad88..ec2e368 100644
--- a/lib/syntax/write_only.ml
+++ b/lib/syntax/write_only.ml
@@ -180,7 +180,7 @@ module Location = struct
let location : context -> S.pos -> instruction list -> t =
fun context pos instructions ->
- let file_name = (fst pos).Lexing.pos_fname in
+ let file_name = (snd pos).Lexing.pos_fname in
ignore pos;
ignore context;
let () = List.iter ~f:(fun v -> v file_name context) instructions in