This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
(lang dune 2.5)
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
(library
|
||||
(name fooppx)
|
||||
(kind ppx_rewriter)
|
||||
(libraries ppxlib))
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
open Ppxlib
|
||||
|
||||
let rules =
|
||||
let extension =
|
||||
Extension.declare "foo" Expression Ast_pattern.__ (fun ~loc ~path:_ _ ->
|
||||
Ast_builder.Default.estring ~loc "PPX extension")
|
||||
in
|
||||
[ Context_free.Rule.extension extension ]
|
||||
|
||||
let () = Ppxlib.Driver.register_transformation "rules" ~rules
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
Running dune utop with directory containing a PPX rewriter
|
||||
$ dune utop ppx -- use_ppx.ml
|
||||
PPX extension
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
let () =
|
||||
Printf.printf "%s\n" [%foo];
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue