Skip to content

Instantly share code, notes, and snippets.

@Kakadu
Created January 12, 2021 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kakadu/f3c30f292edcfe7e3af78d88933b1303 to your computer and use it in GitHub Desktop.
Save Kakadu/f3c30f292edcfe7e3af78d88933b1303 to your computer and use it in GitHub Desktop.
demo with camlp5 rewriter for OCaml
(env
(dev
(flags (:standard -rectypes -warn-error -A -w -33))
))
(library
(name lib1)
(modules lib1)
(preprocess (action
(run %{project_root}/rewriter.exe %{input-file})))
(preprocessor_deps (file %{project_root}/rewriter.exe))
)
(rule
(targets rewriter.exe)
(action
(run mkcamlp5.opt -package
camlp5,camlp5.pa_o %{deps} pr_dump.cmx
-o %{targets} -)))
open List
open Option
let _ = map
let _ = List.fold_left
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment