diff options
author | Chimrod <> | 2025-07-19 11:18:24 +0200 |
---|---|---|
committer | Chimrod <> | 2025-08-01 14:12:14 +0200 |
commit | 3046fb0d0c1ceac2c6a6ca9456e9e05671e0cef9 (patch) | |
tree | 8ba2700e541a6753499ceac54ced4f1d02a3b625 /bin/qsp_parser.ml | |
parent | 406b7b79cd375b071f92ddee9cee14a98dc91281 (diff) |
Diffstat (limited to 'bin/qsp_parser.ml')
-rw-r--r-- | bin/qsp_parser.ml | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/bin/qsp_parser.ml b/bin/qsp_parser.ml index 65a4e4a..7ec3eff 100644 --- a/bin/qsp_parser.ml +++ b/bin/qsp_parser.ml @@ -27,17 +27,17 @@ let dynamic_context_id : Qsp_checks.Dynamics.context Type.Id.t = Type.Id.make () *) let available_checks = [ - Qsp_syntax.Catalog.build ~context_id:dynamic_context_id + Qsp_syntax.Identifier.build ~context_id:dynamic_context_id (module Qsp_checks.Dynamics); - Qsp_syntax.Catalog.build (module Qsp_checks.Type_of); - Qsp_syntax.Catalog.build (module Qsp_checks.Dead_end); - Qsp_syntax.Catalog.build (module Qsp_checks.Nested_strings); - Qsp_syntax.Catalog.build (module Qsp_checks.Locations); - Qsp_syntax.Catalog.build (module Qsp_checks.Dup_test); - Qsp_syntax.Catalog.build (module Qsp_checks.Write_only); + Qsp_syntax.Identifier.build (module Qsp_checks.Type_of); + Qsp_syntax.Identifier.build (module Qsp_checks.Dead_end); + Qsp_syntax.Identifier.build (module Qsp_checks.Nested_strings); + Qsp_syntax.Identifier.build (module Qsp_checks.Locations); + Qsp_syntax.Identifier.build (module Qsp_checks.Dup_test); + Qsp_syntax.Identifier.build (module Qsp_checks.Write_only); ] -let pp_module formatter (module A : Qsp_syntax.S.Analyzer) = +let pp_module formatter (module A : Qsp_syntax.Analyzer.T) = Format.fprintf formatter "%s" A.identifier; Format.pp_print_tab formatter (); (match !A.active with @@ -51,8 +51,8 @@ let pp_module formatter (module A : Qsp_syntax.S.Analyzer) = 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_checks.Check.get_module v + let (module A : Qsp_syntax.Analyzer.T) = + Qsp_syntax.Identifier.get_module v in max l (String.length A.identifier)) in @@ -71,7 +71,7 @@ let pp_modules formatter = Format.fprintf formatter "%a" (Format.pp_print_list (fun f v -> - let m = Qsp_checks.Check.get_module v in + let m = Qsp_syntax.Identifier.get_module v in pp_module f m) ~pp_sep:(fun f () -> Format.pp_force_newline f ())) available_checks; @@ -83,15 +83,15 @@ let pp_modules formatter = 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 + (module Qsp_syntax.Analyzer.T with type context = Qsp_checks.Check.result array) Lazy.t = lazy (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_checks.Check.get_module v + let (module A : Qsp_syntax.Analyzer.T) = + Qsp_syntax.Identifier.get_module v in !A.active) |> Array.of_list @@ -144,7 +144,7 @@ let display_result : The function update the context (list of errors) passed in arguments. *) let parse_location : ctx:ctx ref -> - (module Qsp_syntax.S.Analyzer + (module Qsp_syntax.Analyzer.T with type context = Qsp_checks.Check.result array) -> Qsp_checks.Check.result array -> Qparser.Lexbuf.t -> @@ -210,8 +210,8 @@ let () = | ".qsrc" -> (* 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_checks.Check.get_module t + let (module C : Qsp_syntax.Analyzer.T) = + Qsp_syntax.Identifier.get_module t in if C.is_global && !C.active then C.active := false); |