This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
(library
|
||||
(name fooppx)
|
||||
(modules fooppx)
|
||||
(libraries ppxlib)
|
||||
(kind ppx_rewriter))
|
||||
|
||||
(toplevel
|
||||
(name tt)
|
||||
(preprocess (pps fooppx)))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 2.5)
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
open Ppxlib
|
||||
|
||||
let rules =
|
||||
let extension =
|
||||
Extension.declare "test" Expression Ast_pattern.__ (fun ~loc ~path:_ _ ->
|
||||
Ast_builder.Default.eint ~loc 42)
|
||||
in
|
||||
[ Context_free.Rule.extension extension ]
|
||||
|
||||
let () = Ppxlib.Driver.register_transformation "rules" ~rules
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
let () =
|
||||
Printf.printf "PPX extension: %d\n%!" [%test];
|
||||
exit 0
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
Running toplevel with preprocessor
|
||||
$ dune exec ./tt.exe -- -init init.ml | sed -E 's/OCaml version .*$/Ocaml version REDACTED/g'
|
||||
Ocaml version REDACTED
|
||||
Enter #help;; for help.
|
||||
|
||||
PPX extension: 42
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
(library
|
||||
(name foo)
|
||||
(modules (:standard \ init)))
|
||||
|
||||
(toplevel
|
||||
(name tt)
|
||||
(libraries foo))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.7)
|
||||
|
|
@ -0,0 +1 @@
|
|||
let x = 42
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
let () =
|
||||
Printf.printf "Foo.x = %d\n%!" Foo.x;
|
||||
exit 0
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
Simple example to run toplevel
|
||||
|
||||
$ dune exec ./tt.exe -- -init init.ml | sed -E 's/OCaml version .*$/OCaml version REDACTED/g'
|
||||
OCaml version REDACTED
|
||||
Enter #help;; for help.
|
||||
|
||||
Foo.x = 42
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue