Commit Graph

350 Commits

Author SHA1 Message Date
Jérémie Dimino 0f68e56f64
Remove most useless parentheses from the syntax (#915) 2018-06-27 16:38:05 +01:00
Jérémie Dimino 90cdae96b2
Add a script to help making bulk updates of the tests (#914)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-27 12:21:41 +01:00
Jeremie Dimino f46a6aae53 Make (diff ...) work on Windows
- make (diff ...) trailing cr on Win32
- add a (cmp ...) action for comparing binary files
- add a test and run it in AppVeyor

Fix #844

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-25 08:14:27 +01:00
Jérémie Dimino 0eb302252e
Improve the syntax of ppx rewriters and flags (#910)
- old syntax: (pps (ppx1 -arg1 ppx2 (-foo x)))
- new syntax: (pps ppx1 -arg ppx2 -- -foo x)

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-25 07:56:35 +01:00
Jeremie Dimino 58997d9df7 Present menhir as an extension
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-20 16:06:38 +01:00
Rudi Grinberg d7ab3d962c Harmonize names in dune and jbuild lexers
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 19:50:50 +06:30
Rudi Grinberg 53d9c64468 Print atom using atom constructor
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 18:23:23 +06:30
Rudi Grinberg 7d2c7d9579 Parameterize sexp_tests on dune and jbuild syntax
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 18:23:23 +06:30
Rudi Grinberg 99fbac26ab Remove constructor side validation
And make the tests reflect back Invalid_argument

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 18:23:23 +06:30
Rudi Grinberg ad3a95655d Dune & Jbuild validation for atoms
Atoms can now be constructed and pretty printed with a syntax = Jbuild | Dune.
The syntax controls validation that will be used to make sure we are printing
something/reading valid

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 18:23:23 +06:30
Jérémie Dimino 94c921f9c4
Rename files_recursively_in to source_tree (#899)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-20 10:45:54 +01:00
Jeremie Dimino 41f4b89f85 Added tests for syntax versioning
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-19 16:26:27 +01:00
Jeremie Dimino 0c6edde131 Add a user context to Of_sexp.t
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-19 16:26:00 +01:00
Jeremie Dimino 30d20d6143 Use a single S-expression parser monad
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-19 11:29:27 +01:00
Rudi Grinberg 065e2bb26f Make Sexp.Of_sexp.t abstract
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-19 11:29:27 +01:00
Rudi Grinberg ec8860d0be Add more tests with regards to escaping
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-19 01:00:50 +07:00
Rudi Grinberg a9142840fd Add tests for % and $ chars in atoms
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-17 12:49:08 +07:00
Etienne Millon 96b01c569c Add link_deps field
In some cases, the linking step requires some dependencies. For example,
passing a version script to the linker. The new `(link_deps)` field
uses the dependency DSL already used in other places.

Closes #852

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-06-13 14:38:47 +02:00
Jeremie Dimino 5d6e919f04 Turn warning about modules being used multiple times into errors
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-13 11:51:41 +01:00
Jeremie Dimino de26077d28 Get rid of compatibility symlinks for Dune directories
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-13 11:51:41 +01:00
Jeremie Dimino ef77f83cec Add dune-project file to js_of_ocaml test
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-12 12:09:11 +01:00
Jeremie Dimino 250b940c32 Start of support for languages and extensions
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-12 12:09:11 +01:00
Jérémie Dimino 3cf2a0dab1
Add dune-project files to dune tests and remove old jbuild_version stanzas (#875)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-12 09:49:39 +01:00
Jérémie Dimino 8727eb6c3c
Strengthen the lexing of escape sequences (#872)
Things like \a are no longer allowed. Before they would be interpreted
as a literal \a. This will allow to introduce new escape sequences in
the future if needed.

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-11 16:21:31 +01:00
Jérémie Dimino 58a47e4ff8
Set dune language version to 1.0 (#873)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-11 16:17:22 +01:00
Rudi Grinberg d864e8ca6a Add test for behavior of templates and arguments with spaces
(echo "${read:foo bar}") vs. (echo ${read:foo bar}) handles the argument
differently

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-10 21:40:44 +07:00
Etienne Millon 673397a1b9 Display the installable modes
Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-06-07 15:40:45 +02:00
Etienne Millon 9c2e4f14e0 Display an error when no installable mode is found
If an executable is only available as a shared object for example,
Dune cannot install it. In that case, it displays an error message.
However, it is still possible to build a private one explicitly.

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-06-07 15:17:34 +02:00
Rudi Grinberg 724acc8c7c Allow libraries in a package to reference each other in odocs
This allows for circular dependencies for libraries in the same package

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg 51ec4a0dc6 Update tests
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg da43480dfc Fix html generation for private libs
private-doc should collect html rather than odoc aliases

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg abfa90b5a7 Update tests
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:44:14 +07:00
Rudi Grinberg bdeef73c29 Add test for proper concatenation
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:34 +07:00
Jeremie Dimino 124d942310 s/jbuild/dune/ in misc test
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg 9221b1ed6c Change echo to be variadic
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg eab7c46bdb Add flag to allow/disallow multivalue expansions
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg 69c0ab48ce Add test for concat_or_split
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:41:57 +07:00
Jérémie Dimino bb7827a7b2
Make the output of Dune deterministic in tests (#855)
When the root is not the cwd, print a relative path for the "Entering
..." line rather than an absolute one.

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-06 16:25:04 +01:00
Jeremie Dimino ec6ca4be67 Refactor handling of backend selection errors + add tests
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino 898a2ffa02 Update gen-opam-install-file test
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino b5dfb826ef Restore old ppx behavior for directories with jbuild files
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino ed583b7651 Add List.assoc
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino b35fbbd7b2 Abstract the ppx driver system
- remove hard-coded knowledge of ocaml-migrate-parsetree and ppx_driver
- get the exact driver parameters directly from the driver itself

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino 23a9c65ade make promote
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-04 16:26:13 +01:00
Jeremie Dimino 5b01ed8246 Add support for block strings
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-04 13:57:27 +01:00
Jeremie Dimino b7afc006ee Drop support block and sexp comments in Dune files
They are almost never used and they complicate the language. The
parsing of jbuild files in unchanged.

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-04 13:57:27 +01:00
Rudi Grinberg 077df76f6d Add a ppx rewriter example for the generated install file (#850)
Add an example using jbuild and dune files.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-04 12:08:20 +01:00
Rudi Grinberg be7e3d6dfc Implement --build-dir and change Path.t to use symbolic paths
The motivation for this change is implement the --build-dir feature. This
feature lets us control the build directory which previously always defaulted to
_build. To accomplish this, Path.t had to be modified to be:

External of External.t | In_source_tree of Local.t | In_build_dir of Local.t

To represent the 3 kinds of paths dune is dealing with. The In_build_dir
constructor in particular, is relative to Path.root or some external path.

A few other refactorings had to be done to support this transition:

* The workspace is now "settable". This means that we no longer have to pass it
  explicitly when converting local to absolute paths.

* Path.is_local no longer makes sense and is renamed to Path.is_managed.
  Roughly, is_managed identifies paths in the build and source directories.

* Path.absoulte has been renamed of_filename_relative_to_initial_cwd

* Path.Local.root is now "." (as opposed to "")

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-02 18:14:44 +07:00
Rudi Grinberg 5ea3b1f533
Merge branch 'master' into quoting-test-quoted-case 2018-06-01 17:12:14 +07:00
Rudi Grinberg d17292f6cd Add quoted case to quoting test
When ${@}, the current behavior should be preserved

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-01 16:49:12 +07:00