From 3046fb0d0c1ceac2c6a6ca9456e9e05671e0cef9 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Sat, 19 Jul 2025 11:18:24 +0200 Subject: Added dependencies system between the modules in the checks --- lib/checks/dynamics.ml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'lib/checks/dynamics.ml') diff --git a/lib/checks/dynamics.ml b/lib/checks/dynamics.ml index 0c16ff8..f88550b 100644 --- a/lib/checks/dynamics.ml +++ b/lib/checks/dynamics.ml @@ -7,7 +7,9 @@ let identifier = "dynamics" let description = "Report all dynamics string in the module" let is_global = true let active = ref false +let depends = [] +type ex = Qsp_syntax.Identifier.t type text = { content : string; position : S.pos } [@@deriving eq, ord] module StringSet = Set.Make (struct @@ -54,8 +56,10 @@ module Expression = struct let v : t -> t' = Fun.id (** Only keep the raw strings *) - let literal : S.pos -> t T.literal list -> t = - fun position content -> + let literal : + ctx:Qsp_syntax.S.extract_context -> S.pos -> t T.literal list -> t = + fun ~ctx position content -> + ignore ctx; ignore position; match content with | [ T.Text content ] -> Text { content; position } @@ -91,13 +95,16 @@ module Expression = struct (** Consider the integer as text. This is easier for evaluating the indices in the arrays (it use the same code as text indices), and will report bad use of dynamics. *) - let integer : S.pos -> string -> t = - fun position content -> Text { content; position } + let integer : ctx:Qsp_syntax.S.extract_context -> S.pos -> string -> t = + fun ~ctx position content -> + ignore ctx; + Text { content; position } (** If the identifier uses any unmanaged expression in the indices, ignore it. *) - let ident : (S.pos, t) S.variable -> t = - fun ({ index; _ } as ident) -> + let ident : ctx:Qsp_syntax.S.extract_context -> (S.pos, t) S.variable -> t = + fun ~ctx ({ index; _ } as ident) -> + ignore ctx; let is_valid = Option.fold ~none:true index ~some:(fun opt -> match opt with None -> false | _ -> true) -- cgit v1.2.3