From 75f3eabb46eded01460f7700a75d094100047438 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Sat, 14 Dec 2024 23:06:12 +0100 Subject: Added dynamic check mecanism --- lib/syntax/catalog.ml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'lib/syntax/catalog.ml') diff --git a/lib/syntax/catalog.ml b/lib/syntax/catalog.ml index b516976..5ad0bbd 100644 --- a/lib/syntax/catalog.ml +++ b/lib/syntax/catalog.ml @@ -18,31 +18,31 @@ type ex = -> ex (** Type of check to apply *) let build : + ?location_id:'a Type.Id.t -> + ?context_id:'b Type.Id.t -> (module S.Analyzer with type Expression.t = _ and type Expression.t' = _ and type Instruction.t = _ and type Instruction.t' = _ and type Location.t = 'a - and type context = _) -> - 'a Type.Id.t * ex = - fun module_ -> + and type context = 'b) -> + ex = + fun ?location_id ?context_id module_ -> let expr_witness = Type.Id.make () and expr' = Type.Id.make () and instr_witness = Type.Id.make () and instr' = Type.Id.make () - and location_witness = Type.Id.make () - and context = Type.Id.make () in - let t = - E - { - module_; - expr_witness; - expr'; - instr_witness; - instr'; - location_witness; - context; - } - in - (location_witness, t) + and location_witness = + match location_id with Some v -> v | None -> Type.Id.make () + and context = match context_id with Some v -> v | None -> Type.Id.make () in + E + { + module_; + expr_witness; + expr'; + instr_witness; + instr'; + location_witness; + context; + } -- cgit v1.2.3