aboutsummaryrefslogtreecommitdiff
path: root/discocaml/ast.ml
diff options
context:
space:
mode:
Diffstat (limited to 'discocaml/ast.ml')
-rw-r--r--discocaml/ast.ml10
1 files changed, 10 insertions, 0 deletions
diff --git a/discocaml/ast.ml b/discocaml/ast.ml
index b5ebba3..a706a19 100644
--- a/discocaml/ast.ml
+++ b/discocaml/ast.ml
@@ -142,6 +142,16 @@ let parsetree_of_subexpr (ast : 'a ast) : expr -> Parsetree.expression =
(Pexp_apply
( Wrap.expression (Pexp_ident (Wrap.ident "+")),
[ (Nolabel, loop (subexpr l)); (Nolabel, loop (subexpr r)) ] ))
+ | Prim (`Sub, [| l; r |]) ->
+ Wrap.expression
+ (Pexp_apply
+ ( Wrap.expression (Pexp_ident (Wrap.ident "-")),
+ [ (Nolabel, loop (subexpr l)); (Nolabel, loop (subexpr r)) ] ))
+ | Prim (`Mul, [| l; r |]) ->
+ Wrap.expression
+ (Pexp_apply
+ ( Wrap.expression (Pexp_ident (Wrap.ident "*")),
+ [ (Nolabel, loop (subexpr l)); (Nolabel, loop (subexpr r)) ] ))
| Prim (p, xs) ->
failwith
("illegal Prim: " ^ [%derive.show: prim * expr index array] (p, xs))