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,2 @@
let () =
print_endline {|print_endline "Hello, World"|}

View file

@ -0,0 +1,11 @@
(executable
(name main)
(modules main))
(executable
(name cppo)
(modules cppo))
(rule
(alias show)
(action (cat main.cppo.ml.ml)))

View file

@ -0,0 +1,8 @@
(dialect
(name cppo)
(implementation
(extension cppo.ml)
(preprocess (run ./cppo.exe %{input-file})))
(interface
(extension cppo.mli)
(preprocess (run ./cppo.exe %{input-file}))))

View file

@ -0,0 +1,23 @@
Test the (dialect ...) stanza inside the `dune-project` file.
$ { echo '(lang dune 3.8)'; cat dune-project.in; } >dune-project
$ dune build --display short
File "dune-project", line 5, characters 13-20:
5 | (extension cppo.ml)
^^^^^^^
Error: the possibility of defining extensions containing periods is only
available since version 3.9 of the dune language. Please update your
dune-project file to have (lang dune 3.9).
[1]
$ { echo '(lang dune 3.9)'; cat dune-project.in; } >dune-project
$ dune build --display short 2>&1 | grep -i cppo
ocamlc .cppo.eobjs/byte/dune__exe__Cppo.{cmi,cmti}
ocamlopt .cppo.eobjs/native/dune__exe__Cppo.{cmx,o}
ocamlopt cppo.exe
cppo main.cppo.ml.ml
$ dune build @show
print_endline "Hello, World"