Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for 5.2 AST bump #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions ppx/vlt_ppx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,19 @@ module StructureItem = struct
Pexp_letmodule(m, self#module_expr ctxt me, map_expr e)
end
| Pexp_let(r, vbl, e) -> Pexp_let(r, List.map (self#value_binding ctxt) vbl, map_expr e)
| Pexp_function c -> Pexp_function (self#cases ctxt c)
| Pexp_fun(a, e_opt, p, e) -> Pexp_fun(a, map_expr_opt e_opt, p, map_expr e)
| Pexp_function (params, constraint_, body) -> (
let params = List.map (function
| { pparam_desc = Pparam_val (lbl, e_opt, pat); _ } as p ->
{ p with pparam_desc = Pparam_val (lbl, map_expr_opt e_opt, pat) }
| v -> v
) params
in
match body with
| Pfunction_body expr ->
Pexp_function (params, constraint_, Pfunction_body (map_expr expr))
| Pfunction_cases (cases, locs, attrs) ->
Pexp_function (params, constraint_, Pfunction_cases (self#cases ctxt cases, locs, attrs))
)
| Pexp_apply(e, al) -> Pexp_apply(map_expr e, List.map (fun(l, e) -> l, map_expr e) al)
| Pexp_match(e, c) -> Pexp_match(map_expr e, self#cases ctxt c)
| Pexp_try(e, c) -> Pexp_try(map_expr e, self#cases ctxt c)
Expand Down