From f58bca1d069d32dad0a536dca1089ca637965bff Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Fri, 27 Jul 2018 12:55:11 +0200 Subject: [PATCH 1/4] ocamllex does not need the list of modules to be in a list Noticed this issue while finding another issue in #1056. Signed-off-by: Marek Kubica --- doc/dune-files.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/dune-files.rst b/doc/dune-files.rst index 21ed5db5..8d7564c2 100644 --- a/doc/dune-files.rst +++ b/doc/dune-files.rst @@ -503,7 +503,7 @@ To use a different rule mode, use the long form: .. code:: scheme (ocamllex - (modules ()) + (modules ) (mode )) ocamlyacc From 371c863a324645f9ca8746032d6ce13b90b39518 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Fri, 27 Jul 2018 13:03:44 +0200 Subject: [PATCH 2/4] Parens not required Closes #1054 Closes #1056 Signed-off-by: Marek Kubica --- doc/dune-files.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/dune-files.rst b/doc/dune-files.rst index 8d7564c2..b77d7886 100644 --- a/doc/dune-files.rst +++ b/doc/dune-files.rst @@ -488,7 +488,7 @@ stanza is rejected by dune: ocamllex -------- -``(ocamllex ())`` is essentially a shorthand for: +``(ocamllex )`` is essentially a shorthand for: .. code:: scheme From ed5f2c5b4046c30a7c291fe71fd40c00483d0e85 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Fri, 27 Jul 2018 13:06:00 +0200 Subject: [PATCH 3/4] ocamlyacc does not require parens either Signed-off-by: Marek Kubica --- doc/dune-files.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/dune-files.rst b/doc/dune-files.rst index b77d7886..c74dadc9 100644 --- a/doc/dune-files.rst +++ b/doc/dune-files.rst @@ -509,7 +509,7 @@ To use a different rule mode, use the long form: ocamlyacc --------- -``(ocamlyacc ())`` is essentially a shorthand for: +``(ocamlyacc )`` is essentially a shorthand for: .. code:: scheme @@ -524,7 +524,7 @@ To use a different rule mode, use the long form: .. code:: scheme (ocamlyacc - (modules ()) + (modules ) (mode )) menhir From 7af0af94ed35b792b0f7c9ecf130f11e621fbee0 Mon Sep 17 00:00:00 2001 From: cedlemo Date: Sun, 29 Jul 2018 18:44:25 +0200 Subject: [PATCH 4/4] doc: remove %{first-dep} in quick-start.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cédric Le Moigne --- doc/quick-start.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/quick-start.rst b/doc/quick-start.rst index f9272534..2c62f441 100644 --- a/doc/quick-start.rst +++ b/doc/quick-start.rst @@ -136,7 +136,7 @@ Add this field to your ``library`` or ``executable`` stanzas: .. code:: scheme - (preprocess (action (run %{bin:cppo} -V OCAML:%{ocaml_version} %{first-dep}))) + (preprocess (action (run %{bin:cppo} -V OCAML:%{ocaml_version} %{input-file}))) Additionally, if you are include a ``config.h`` file, you need to declare the dependency to this file via: @@ -154,7 +154,7 @@ Write this in your ``dune`` file: (rule (targets foo.ml) - (deps foo.cppo.ml ) + (deps (:first-dep foo.cppo.ml) ) (action (run %{bin:cppo} %{first-dep} -o %{targets}))) Defining a library with C stubs @@ -192,8 +192,8 @@ compilation and link flags. Write this ``dune`` file: (rule (targets c_flags.sexp c_library_flags.sexp) - (deps config/discover.exe) - (action (run %{first-dep} -ocamlc %{OCAMLC}))) + (deps (:discover config/discover.exe)) + (action (run %{discover} -ocamlc %{OCAMLC}))) Then create a ``config`` subdirectory and write this ``dune`` file: @@ -240,8 +240,8 @@ To generate a file ``foo.ml`` using a program from another directory: (rule (targets foo.ml) - (deps ../generator/gen.exe) - (action (run %{first-dep} -o %{targets}))) + (deps (:gen ../generator/gen.exe)) + (action (run %{gen} -o %{targets}))) Defining tests ============== @@ -252,8 +252,8 @@ Write this in your ``dune`` file: (alias (name runtest) - (deps my-test-program.exe) - (action (run %{first-dep}))) + (deps (:my-prog my-test-program.exe)) + (action (run %{my-prog}))) And run the tests with: