From 9e7b9de243e488e15d2c7528ce64e569eba8add2 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Fri, 15 Nov 2024 18:45:34 +0100 Subject: Fix a correction in the location identification in the unused variable parser --- bin/qsp_parser.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin/qsp_parser.ml') 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, -- cgit v1.2.3