Skip to content

Commit

Permalink
flambda-backend: Handle exclave in pprintast (#2298)
Browse files Browse the repository at this point in the history
* handle exclave in pprintast

* fix indentation

* fix test
  • Loading branch information
riaqn authored Feb 19, 2024
1 parent 42b545b commit 906de5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions parsing/pprintast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,10 @@ and expression ?(jane_syntax_parens = false) ctxt f x =
({ pexp_desc = Pexp_extension({txt = "extension.local"}, PStr []) },
[Nolabel, sbody]) ->
pp f "@[<2>local_ %a@]" (expression ctxt) sbody
| Pexp_apply
({ pexp_desc = Pexp_extension({txt = "extension.exclave"}, PStr []) },
[Nolabel, sbody]) ->
pp f "@[<2>exclave_ %a@]" (expression ctxt) sbody
| Pexp_apply (e, l) ->
begin if not (sugar_expr ctxt f x) then
match view_fixity_of_exp e with
Expand Down
5 changes: 5 additions & 0 deletions testsuite/tests/parsetree/source_jane_street.ml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ let g () = local_
let f x y = local_ (x + y) in
local_ ();;

(* exclaves *)
let f () = exclave_
let f x y = exclave_ (x + y) in
()

(* types *)
type record =
{ global_ field : int
Expand Down

0 comments on commit 906de5e

Please sign in to comment.