Fix parsing of ocamllex in jbuild files
The long form would be rejected Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
parent
bb2bf59ff1
commit
da3def9dc7
|
@ -1485,18 +1485,19 @@ module Rule = struct
|
|||
}
|
||||
|
||||
let ocamllex_jbuild =
|
||||
enter
|
||||
(if_list
|
||||
~then_:(
|
||||
record
|
||||
(let%map modules = field "modules" (list string)
|
||||
and mode = Mode.field in
|
||||
{ modules; mode }))
|
||||
~else_:(
|
||||
repeat string >>| fun modules ->
|
||||
{ modules
|
||||
; mode = Standard
|
||||
}))
|
||||
peek_exn >>= function
|
||||
| List (_, Atom (_, _) :: _) ->
|
||||
enter (
|
||||
repeat string >>| fun modules ->
|
||||
{ modules
|
||||
; mode = Standard
|
||||
}
|
||||
)
|
||||
| _ ->
|
||||
record
|
||||
(let%map modules = field "modules" (list string)
|
||||
and mode = Mode.field in
|
||||
{ modules; mode })
|
||||
|
||||
let ocamllex_dune =
|
||||
if_eos
|
||||
|
|
|
@ -1,6 +1,2 @@
|
|||
$ dune exec ./foo.exe
|
||||
File "jbuild", line 2, characters 3-10:
|
||||
((modules (foo))))
|
||||
^^^^^^^
|
||||
Error: S-expression of the form (<name> <values>...) expected
|
||||
[1]
|
||||
foo
|
||||
|
|
Loading…
Reference in New Issue