From c5568995bf52126569ce84cf9ae2e4fd6fc8def1 Mon Sep 17 00:00:00 2001 From: Corentin Leruth Date: Fri, 27 Jan 2023 18:39:50 +0100 Subject: [PATCH] fix: parsing of <= operator Signed-off-by: Corentin Leruth --- CHANGES.md | 3 +++ src/dune_rules/blang.ml | 2 +- .../enabled_if/eif-ocaml_version_lte.t/run.t | 11 ----------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3985b9269ea..f0f298f7c00 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,9 @@ Unreleased ---------- +- Fix parsing of the `<=` operator in *blang* expressions of `dune` files. + Previously, the operator would be interpreted as `,`. (#6928, @tatchi) + - Fix `--trace-file` output. Dune now emits a single *complete* event for every executed process. Unterminated *async* events are no longer written. (#6892, @rgrinberg) diff --git a/src/dune_rules/blang.ml b/src/dune_rules/blang.ml index d4fd08273e6..0c160c2e381 100644 --- a/src/dune_rules/blang.ml +++ b/src/dune_rules/blang.ml @@ -68,7 +68,7 @@ let rec to_dyn = [ Op.to_dyn o; String_with_vars.to_dyn s1; String_with_vars.to_dyn s2 ] let ops = - [ ("=", Op.Eq); (">=", Gte); ("<=", Lt); (">", Gt); ("<", Lt); ("<>", Neq) ] + [ ("=", Op.Eq); (">=", Gte); ("<=", Lte); (">", Gt); ("<", Lt); ("<>", Neq) ] let decode_gen decode_string = let open Dune_lang.Decoder in diff --git a/test/blackbox-tests/test-cases/enabled_if/eif-ocaml_version_lte.t/run.t b/test/blackbox-tests/test-cases/enabled_if/eif-ocaml_version_lte.t/run.t index 41abbcb2cb9..4d24f7e3614 100644 --- a/test/blackbox-tests/test-cases/enabled_if/eif-ocaml_version_lte.t/run.t +++ b/test/blackbox-tests/test-cases/enabled_if/eif-ocaml_version_lte.t/run.t @@ -1,12 +1 @@ $ dune build - File "dune", line 20, characters 12-22: - 20 | (libraries lte414caml)) - ^^^^^^^^^^ - Error: Library "lte414caml" in _build/default is hidden (unsatisfied - 'enabled_if'). - -> required by _build/default/.main.eobjs/byte/dune__exe__Main.cmi - -> required by _build/default/.main.eobjs/native/dune__exe__Main.cmx - -> required by _build/default/main.exe - -> required by alias all - -> required by alias default - [1]