Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1009 Bytes

README.md

File metadata and controls

46 lines (33 loc) · 1009 Bytes

ppxlib-simple-example

A simple ppx to examplify the initial setup of ppxlib, part of the talk The needed introduction to writing a ppx given at Reason STHLM Meetup..

It uses opam

  • OCaml 5.2.0
  • dune 3.12
  • ppxlib 0.27

Installation

make install

Building

make build # Builds the project, once
make dev # Watch the filesystem and re-builds the project on each change

Testing

make test # Runs snapshot tests
make test-watch # Watch the filesystem and re-runs the tests on each change
make test-update # Updates the snapshot tests

Usage

Users of your ppx need to add the ppx name to their dune stanza:

(preprocess
  (pps ppx-simple-example))

And then you can use it in your code:

print_endline [%yay]
(* Transforms to *)
print_endline "Hello future compiler engineer!"