From f135a5fcb6c9827d07025a143b190cbbf8eddc15 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Fri, 13 Oct 2023 16:18:34 +0200 Subject: Made the interface more parametrized --- lib/syntax/tree.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/syntax/tree.ml') diff --git a/lib/syntax/tree.ml b/lib/syntax/tree.ml index 02c6b36..db8abd9 100644 --- a/lib/syntax/tree.ml +++ b/lib/syntax/tree.ml @@ -89,10 +89,12 @@ module Instruction : let expression : expression -> t S.repr = fun expr report -> (Ast.Expression (fst (expr [])), report) - type clause = S.pos * expression * t S.repr list - let if_ : - S.pos -> clause -> elifs:clause list -> else_:t S.repr list -> t S.repr = + S.pos -> + (expression, t) S.clause -> + elifs:(expression, t) S.clause list -> + else_:t S.repr list -> + t S.repr = fun pos predicate ~elifs ~else_ report -> let clause (pos, expr, repr) = let repr = List.map ~f:(fun instr -> fst @@ instr []) repr in -- cgit v1.2.3