From 65164f2ebe61a566d96119c2cde23eee6771007b Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Mon, 9 Dec 2024 10:13:50 +0100 Subject: Splitted the code and declare the test catalog in it’s own module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/args.ml | 2 +- bin/args.mli | 2 +- bin/qsp_parser.ml | 19 +++++++++---------- 3 files changed, 11 insertions(+), 12 deletions(-) (limited to 'bin') diff --git a/bin/args.ml b/bin/args.ml index b124575..1503d18 100644 --- a/bin/args.ml +++ b/bin/args.ml @@ -74,7 +74,7 @@ let speclist printer = common_arguments @ windows_arguments let parse : - modules:Qsp_checks.Check.t list -> + modules:Qsp_syntax.Catalog.ex list -> list_tests:(Format.formatter -> unit) -> string list * t = fun ~modules ~list_tests -> diff --git a/bin/args.mli b/bin/args.mli index 0041b59..a98b258 100644 --- a/bin/args.mli +++ b/bin/args.mli @@ -4,6 +4,6 @@ type t = { reset_line : bool; filters : filters } (** All the arguments given from the command line *) val parse : - modules:Qsp_checks.Check.t list -> + modules:Qsp_syntax.Catalog.ex list -> list_tests:(Format.formatter -> unit) -> string list * t diff --git a/bin/qsp_parser.ml b/bin/qsp_parser.ml index cdd509c..a8ee457 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_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); + snd @@ Qsp_syntax.Catalog.build (module Qsp_checks.Type_of); + snd @@ Qsp_syntax.Catalog.build (module Qsp_checks.Dead_end); + snd @@ Qsp_syntax.Catalog.build (module Qsp_checks.Nested_strings); + snd @@ Qsp_syntax.Catalog.build (module Qsp_checks.Locations); + snd @@ Qsp_syntax.Catalog.build (module Qsp_checks.Dup_test); + snd @@ Qsp_syntax.Catalog.build (module Qsp_checks.Write_only); ] let pp_module formatter (module A : Qsp_syntax.S.Analyzer) = @@ -70,8 +70,8 @@ let pp_modules formatter = (** Get all the tests to apply. - The expression is declared lazy in order to be sure to apply the filters - from the command line before. *) + 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) Lazy.t = lazy (let module Check = Qsp_checks.Check.Make (struct @@ -89,8 +89,7 @@ let checkers : (module Qsp_syntax.S.Analyzer) Lazy.t = read properly), or until the first syntax error. The function update the context (list of errors) passed in arguments. *) -let parse_location : - type context. +let parse_location : type context. ctx:ctx ref -> (module Qsp_syntax.S.Analyzer with type context = context) -> context -> -- cgit v1.2.3