From 77ae152ece4efbf8dde983c03bd995c982522bfd Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Sat, 28 Oct 2023 22:17:24 +0200 Subject: Updated the interface --- lib/syntax/check.ml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lib/syntax/check.ml') diff --git a/lib/syntax/check.ml b/lib/syntax/check.ml index 7db3286..2528914 100644 --- a/lib/syntax/check.ml +++ b/lib/syntax/check.ml @@ -112,10 +112,20 @@ module Make (A : App) = struct type t = result array type t' = result array - let literal : S.pos -> string -> t = - fun pos value -> - Array.map A.t ~f:(fun (E { module_ = (module S); expr_witness; _ }) -> - let value = S.Expression.literal pos value in + let literal : S.pos -> t T.literal list -> t = + fun pos values -> + Array.mapi A.t ~f:(fun i (E { module_ = (module S); expr_witness; _ }) -> + (* Map every values to the Checker *) + let values' = + List.map values ~f:(function + | T.Text t -> T.Text t + | T.Expression e -> + let exprs = + List.rev (Helper.expr_i e expr_witness i).values + in + T.Expression exprs) + in + let value = S.Expression.literal pos values' in R { value; witness = expr_witness }) let integer : S.pos -> string -> t = -- cgit v1.2.3