well this is a toplevel, now to add a ppx ast printer?

This commit is contained in:
cqc
2023-03-03 13:48:46 -06:00
parent 8c16946650
commit 272778ad7b
4 changed files with 974 additions and 5 deletions

120
dune
View File

@ -1,20 +1,22 @@
(env
(dev (flags (:standard -warn-error -A))
(js_of_ocaml (flags --no-inline --pretty --source-map-inline --debug-info)
(build_runtime_flags --no-inline --pretty --source-map-inline --debug-info)
(link_flags --source-map-inline))))
(js_of_ocaml (flags :standard --no-inline --debug-info --target-env browser --disable shortvar)
(build_runtime_flags :standard --no-inline --debug-info)
(link_flags :standard))))
(executable
(name boot_js)
(modes byte js)
(preprocess (pps js_of_ocaml-ppx))
(flags (:standard -rectypes -linkall))
(modules boot_js human)
(libraries
fmt
logs
graphv_webgl
js_of_ocaml-lwt
js_of_ocaml-compiler
js_of_ocaml-toplevel
digestif.ocaml
checkseum.ocaml
irmin.mem
@ -23,8 +25,116 @@
cohttp-lwt-jsoo
mimic
uri
zed
gg
lwd
))
(executables
(names toplevel)
(modules
(:standard \ human boot_js test_dynlink examples))
(libraries
js_of_ocaml-compiler
js_of_ocaml-tyxml
js_of_ocaml-toplevel
lwt
js_of_ocaml-lwt
;; not used directly
graphics
js_of_ocaml.deriving
react
reactiveData
str
(select
ocp_indent.ml
from
(ocp-indent.lib -> ocp_indent.ok.ml)
(-> ocp_indent.fake.ml))
(select
colorize.ml
from
(higlo -> colorize.higlo.ml)
(!higlo -> colorize.fake.ml))
(select
graphics_support.ml
from
(js_of_ocaml-lwt.graphics -> graphics_support.enabled.ml)
(-> graphics_support.disabled.ml))
(select
ppx_support.ml
from
(js_of_ocaml-ppx -> ppx_support.enabled.ml)
(-> ppx_support.disabled.ml)))
(flags
(:standard -rectypes -linkall))
(modes byte)
(preprocess
(pps js_of_ocaml-ppx)))
(rule
(targets test_dynlink.cmo test_dynlink.cmi)
(action
(run ocamlc -c %{dep:test_dynlink.ml})))
(rule
(targets test_dynlink.js)
(action
(run %{bin:js_of_ocaml} --pretty --toplevel %{dep:test_dynlink.cmo})))
(rule
(targets export.txt)
(deps
(package js_of_ocaml-ppx)
(package js_of_ocaml)
(package js_of_ocaml-compiler)
(package js_of_ocaml-lwt)
(package js_of_ocaml-tyxml)
(package js_of_ocaml-toplevel))
(action
(run
jsoo_listunits
-o
%{targets}
stdlib
graphics
str
dynlink
js_of_ocaml-compiler.runtime
js_of_ocaml-lwt.graphics
js_of_ocaml-ppx.as-lib
js_of_ocaml.deriving
lwt
tyxml.functor
tyxml.functor:html_types.cmi
react
reactiveData
js_of_ocaml
js_of_ocaml-lwt
js_of_ocaml-tyxml
js_of_ocaml-toplevel
dynlink)))
(rule
(targets toplevel.js)
(action
(run
%{bin:js_of_ocaml}
compile
--pretty
--Werror
--target-env
browser
--export
%{dep:export.txt}
--toplevel
--disable
shortvar
+toplevel.js
+dynlink.js
%{dep:toplevel.bc}
-o
%{targets})))
(alias
(name default)
(deps toplevel.js index.html))