diff options
author | Chimrod <> | 2023-10-13 16:18:34 +0200 |
---|---|---|
committer | Chimrod <> | 2023-10-18 09:49:47 +0200 |
commit | f135a5fcb6c9827d07025a143b190cbbf8eddc15 (patch) | |
tree | 6dd0ce2c1ab0a827872289336c732378f04f81fd /lib/syntax/tree.ml | |
parent | 4b47c572fc7122154813c8bb5da477c0f152f002 (diff) |
Made the interface more parametrized
Diffstat (limited to 'lib/syntax/tree.ml')
-rw-r--r-- | lib/syntax/tree.ml | 8 |
1 files changed, 5 insertions, 3 deletions
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 |