-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dialects: allow embedded dots in extensions
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
- Loading branch information
Showing
13 changed files
with
72 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
let () = | ||
print_endline {|print_endline "Hello, World"|} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(executable | ||
(name main) | ||
(modules main)) | ||
|
||
(executable | ||
(name cppo) | ||
(modules cppo)) | ||
|
||
(rule | ||
(alias show) | ||
(action (cat main.cppo.ml.ml))) |
8 changes: 8 additions & 0 deletions
8
test/blackbox-tests/test-cases/dialects/dots.t/dune-project.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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})))) |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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 with embedded dots 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 | ||
ocamlc .cppo.eobjs/byte/dune__exe__Cppo.{cmi,cmti} | ||
ocamlc .main.eobjs/byte/dune__exe__Main.{cmi,cmti} | ||
ocamlopt .cppo.eobjs/native/dune__exe__Cppo.{cmx,o} | ||
ocamlopt cppo.exe | ||
cppo main.cppo.ml.ml | ||
ocamlopt .main.eobjs/native/dune__exe__Main.{cmx,o} | ||
ocamlopt main.exe | ||
|
||
$ dune build @show | ||
print_endline "Hello, World" |