diff --git a/CHANGES.md b/CHANGES.md index 5abb9290..e5f83774 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,8 @@ next - Change the location of preprocessed files inside the build directory (#1004, @diml) +- Fix parsing of `%{lib:name:file}` forms (#1022, fixes #1019, @diml) + 1.0.0 (10/07/2018) ------------------ diff --git a/src/usexp/dune_lexer.mll b/src/usexp/dune_lexer.mll index 20720132..38186bef 100644 --- a/src/usexp/dune_lexer.mll +++ b/src/usexp/dune_lexer.mll @@ -282,7 +282,7 @@ and quoted_string_after_escaped_newline = parse { quoted_string lexbuf } and template_variable = parse - | (varname_char+ as name) (':' (varname_char* as payload))? '}' + | (varname_char+ as name) (':' ((':' | varname_char)* as payload))? '}' { let payload = match payload with | Some "" -> error lexbuf "payload after : in variable cannot be empty" diff --git a/test/blackbox-tests/test-cases/github1019/dune b/test/blackbox-tests/test-cases/github1019/dune index b1e70d55..6ac5a87b 100644 --- a/test/blackbox-tests/test-cases/github1019/dune +++ b/test/blackbox-tests/test-cases/github1019/dune @@ -1,5 +1,5 @@ -(library (name foo)) +(library (name foo) (public_name foo)) (alias (name default) - (echo %{lib:foo:foo.ml})) + (action (echo %{lib:foo:foo.ml}))) diff --git a/test/blackbox-tests/test-cases/github1019/foo.opam b/test/blackbox-tests/test-cases/github1019/foo.opam new file mode 100644 index 00000000..e69de29b diff --git a/test/blackbox-tests/test-cases/github1019/run.t b/test/blackbox-tests/test-cases/github1019/run.t index c31fc32a..9bc93b70 100644 --- a/test/blackbox-tests/test-cases/github1019/run.t +++ b/test/blackbox-tests/test-cases/github1019/run.t @@ -1,6 +1,4 @@ Regression test for #1019 $ dune build - File "dune", line 5, characters 9-10: - Error: This character is not allowed inside %{...} forms - [1] + ../install/default/lib/foo/foo.ml