Skip to content

Commit

Permalink
Support for [let..and] expressions.
Browse files Browse the repository at this point in the history
This fixes ocaml-gospel#21.
  • Loading branch information
mariojppereira committed Nov 16, 2022
1 parent 5bce9d8 commit a71a35d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/expression.ml
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,13 @@ let rec expression_desc info expr_loc expr_desc =
| Uast.Sexp_constant c -> Econst (T.constant c)
| Uast.Sexp_let (Nonrecursive, [ svb ], expr) ->
let_match info (expression info expr) svb
| Sexp_let (Nonrecursive, svbs, expr) ->
let mk_let svb acc = mk_expr (let_match info acc svb) in
(List.fold_right mk_let svbs (expression info expr)).expr_desc
| Uast.Sexp_let (Recursive, svb_list, expr) ->
let rs_kind, id_fun_expr_list = id_expr_rs_kind_of_svb_list svb_list in
let expr_in = expression info expr in
mk_erec (List.map (mk_fun_def false rs_kind) id_fun_expr_list) expr_in
| Sexp_let _ -> assert false (* TODO *)
| Uast.Sexp_function _ -> assert false (* TODO *)
| Uast.Sexp_fun (Nolabel, None, pat, expr_fun, spec) ->
let spec = match spec with Some s -> S.fun_spec s | _ -> empty_spec in
Expand Down

0 comments on commit a71a35d

Please sign in to comment.