This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,4 @@
(library
(name fooppx)
(kind ppx_rewriter)
(libraries ppxlib))

View file

@ -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

View file

@ -0,0 +1,3 @@
Running dune utop with directory containing a PPX rewriter
$ dune utop ppx -- use_ppx.ml
PPX extension

View file

@ -0,0 +1,3 @@
let () =
Printf.printf "%s\n" [%foo];
exit 0