This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
23
unikernel/duniverse/ppxlib/test/502_pexpfun/test.ml
Normal file
23
unikernel/duniverse/ppxlib/test/502_pexpfun/test.ml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
open Ppxlib
|
||||
|
||||
module B = Ast_builder.Make (struct
|
||||
let loc = !Ast_helper.default_loc
|
||||
end)
|
||||
[%%ignore]
|
||||
|
||||
(** Using multiple calls to [pexp_fun] still produces a maximum arity function
|
||||
*)
|
||||
let _ =
|
||||
let inner =
|
||||
B.pexp_fun Nolabel None
|
||||
(B.ppat_var { txt = "y"; loc = B.loc })
|
||||
(B.pexp_apply (B.evar "Int.add")
|
||||
[ (Nolabel, B.evar "x"); (Nolabel, B.evar "y") ])
|
||||
in
|
||||
let e =
|
||||
B.pexp_fun Nolabel None (B.ppat_var { txt = "x"; loc = B.loc }) inner
|
||||
in
|
||||
Format.asprintf "%a" Pprintast.expression e
|
||||
[%%expect{|
|
||||
- : string = "fun x y -> Int.add x y"
|
||||
|}]
|
||||
Loading…
Add table
Add a link
Reference in a new issue