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,3 @@
(test
(name test)
(preprocess (action (run pp/pp.exe %{input-file}))))

View file

@ -0,0 +1 @@
print_endline _STRING_

View file

@ -0,0 +1,4 @@
(executable
(name pp))
(ocamllex pp)

View file

@ -0,0 +1,10 @@
rule main = parse
| eof { () }
| "_STRING_" { Printf.printf "%S" "Hello, world!"; main lexbuf }
| _ as c { print_char c; main lexbuf }
{
let () =
set_binary_mode_out stdout true;
main (Lexing.from_channel (open_in_bin Sys.argv.(1)))
}

View file

@ -0,0 +1,4 @@
This test check that we can preprocess source code with actions
$ dune runtest --display short 2>&1 | grep " pp"
pp dune/test.pp.ml