forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(melange): support `(select ...)` in `melange.emit` Signed-off-by: Antonio Nuno Monteiro <[email protected]>
- Loading branch information
1 parent
c7a0049
commit d429530
Showing
10 changed files
with
125 additions
and
112 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
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,40 @@ | ||
using `(select ...)` in melange.emit | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.7) | ||
> (using melange 0.1) | ||
> EOF | ||
$ cat >bar.melange.ml <<EOF | ||
> let message = "hello from melange" | ||
> EOF | ||
$ cat >bar.native.ml <<EOF | ||
> let message = print_endline "hello from native" | ||
> EOF | ||
$ cat >foo.fake.ml <<EOF | ||
> let message = "foo has fake " ^^ Fakefoobar.fake | ||
> EOF | ||
$ cat >foo.no_fake.ml <<EOF | ||
> let message = "foo has no fake" | ||
> EOF | ||
$ cat >main.ml <<EOF | ||
> let () = Js.log Bar.message | ||
> let () = Js.log Foo.message | ||
> EOF | ||
$ cat >dune <<EOF | ||
> (melange.emit | ||
> (target output) | ||
> (alias melange) | ||
> (libraries | ||
> (select bar.ml from | ||
> (melange -> bar.melange.ml) | ||
> (!melange -> bar.native.ml)) | ||
> (select foo.ml from | ||
> (fakefoobar -> foo.fake.ml) | ||
> (!fakefoobar -> foo.no_fake.ml)))) | ||
> EOF | ||
|
||
$ dune build @melange | ||
$ node ./_build/default/output/main.js | ||
hello from melange | ||
foo has no fake | ||
|