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/default.ml | 47 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 8 deletions(-) (limited to 'lib/checks/default.ml') diff --git a/lib/checks/default.ml b/lib/checks/default.ml index 0c4d761..0ec1084 100644 --- a/lib/checks/default.ml +++ b/lib/checks/default.ml @@ -21,25 +21,56 @@ struct type t' = T'.t - let ident : (S.pos, T'.t) S.variable -> T'.t = fun _ -> T'.default + let ident : + ctx:Qsp_syntax.S.extract_context -> (S.pos, T'.t) S.variable -> T'.t = + fun ~ctx _ -> + ignore ctx; + T'.default (* Basic values, text, number… *) - let integer : S.pos -> string -> T'.t = fun _ _ -> T'.default - let literal : S.pos -> T'.t T.literal list -> T'.t = fun _ _ -> T'.default + let integer : ctx:Qsp_syntax.S.extract_context -> S.pos -> string -> T'.t = + fun ~ctx _ _ -> + ignore ctx; + T'.default + + let literal : + ctx:Qsp_syntax.S.extract_context -> S.pos -> T'.t T.literal list -> T'.t = + fun ~ctx _ _ -> + ignore ctx; + T'.default (** Call a function. The functions list is hardcoded in lib/lexer.mll *) - let function_ : S.pos -> T.function_ -> T'.t list -> T'.t = - fun _ _ _ -> T'.default + let function_ : + ctx:Qsp_syntax.S.extract_context -> + S.pos -> + T.function_ -> + T'.t list -> + T'.t = + fun ~ctx _ _ _ -> + ignore ctx; + T'.default (** Unary operator like [-123] or [+'Text']*) - let uoperator : S.pos -> T.uoperator -> T'.t -> T'.t = fun _ _ _ -> T'.default + let uoperator : + ctx:Qsp_syntax.S.extract_context -> S.pos -> T.uoperator -> T'.t -> T'.t = + fun ~ctx _ _ _ -> + ignore ctx; + T'.default (** Binary operator, for a comparaison, or an operation *) - let boperator : S.pos -> T.boperator -> T'.t -> T'.t -> T'.t = - fun _ _ _ _ -> T'.default + let boperator : + ctx:Qsp_syntax.S.extract_context -> + S.pos -> + T.boperator -> + T'.t -> + T'.t -> + T'.t = + fun ~ctx _ _ _ _ -> + ignore ctx; + T'.default end module Instruction (Expression : sig -- cgit v1.2.3