aboutsummaryrefslogtreecommitdiff
path: root/bin/qsp_parser.ml
diff options
context:
space:
mode:
authorChimrod <>2024-12-02 09:05:18 +0100
committerChimrod <>2024-12-02 09:05:18 +0100
commit53c02501935b3cb2db78e79deb4d38c997505a95 (patch)
tree88a75e012ee186ffb6c6e3e0c53ba80610ec3b0b /bin/qsp_parser.ml
parent9e7b9de243e488e15d2c7528ce64e569eba8add2 (diff)
Moved the checks in a dedicated library
Diffstat (limited to 'bin/qsp_parser.ml')
-rw-r--r--bin/qsp_parser.ml22
1 files changed, 11 insertions, 11 deletions
diff --git a/bin/qsp_parser.ml b/bin/qsp_parser.ml
index 4eb5c66..cdd509c 100644
--- a/bin/qsp_parser.ml
+++ b/bin/qsp_parser.ml
@@ -19,12 +19,12 @@ type ctx = { error_nb : int; warn_nb : int; debug_nb : int; fatal_error : bool }
*)
let available_checks =
[
- snd @@ Qsp_syntax.Check.build (module Qsp_syntax.Type_of);
- snd @@ Qsp_syntax.Check.build (module Qsp_syntax.Dead_end);
- snd @@ Qsp_syntax.Check.build (module Qsp_syntax.Nested_strings);
- snd @@ Qsp_syntax.Check.build (module Qsp_syntax.Locations);
- snd @@ Qsp_syntax.Check.build (module Qsp_syntax.Dup_test);
- snd @@ Qsp_syntax.Check.build (module Qsp_syntax.Write_only);
+ snd @@ Qsp_checks.Check.build (module Qsp_checks.Type_of);
+ snd @@ Qsp_checks.Check.build (module Qsp_checks.Dead_end);
+ snd @@ Qsp_checks.Check.build (module Qsp_checks.Nested_strings);
+ snd @@ Qsp_checks.Check.build (module Qsp_checks.Locations);
+ snd @@ Qsp_checks.Check.build (module Qsp_checks.Dup_test);
+ snd @@ Qsp_checks.Check.build (module Qsp_checks.Write_only);
]
let pp_module formatter (module A : Qsp_syntax.S.Analyzer) =
@@ -42,7 +42,7 @@ let pp_modules formatter =
let max_length =
List.fold_left available_checks ~init:0 ~f:(fun l v ->
let (module A : Qsp_syntax.S.Analyzer) =
- Qsp_syntax.Check.get_module v
+ Qsp_checks.Check.get_module v
in
max l (String.length A.identifier))
in
@@ -61,7 +61,7 @@ let pp_modules formatter =
Format.fprintf formatter "%a"
(Format.pp_print_list
(fun f v ->
- let m = Qsp_syntax.Check.get_module v in
+ let m = Qsp_checks.Check.get_module v in
pp_module f m)
~pp_sep:(fun f () -> Format.pp_force_newline f ()))
available_checks;
@@ -74,11 +74,11 @@ let pp_modules formatter =
from the command line before. *)
let checkers : (module Qsp_syntax.S.Analyzer) Lazy.t =
lazy
- (let module Check = Qsp_syntax.Check.Make (struct
+ (let module Check = Qsp_checks.Check.Make (struct
let t =
List.filter available_checks ~f:(fun v ->
let (module A : Qsp_syntax.S.Analyzer) =
- Qsp_syntax.Check.get_module v
+ Qsp_checks.Check.get_module v
in
!A.active)
|> Array.of_list
@@ -142,7 +142,7 @@ let () =
(* Deactivate the tests which only applies to a global file *)
List.iter available_checks ~f:(fun t ->
let (module C : Qsp_syntax.S.Analyzer) =
- Qsp_syntax.Check.get_module t
+ Qsp_checks.Check.get_module t
in
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