Skip to content

Commit

Permalink
Keep location of menhir stanzas (#1881)
Browse files Browse the repository at this point in the history
Fixes #1876

Signed-off-by: Jeremie Dimino <[email protected]>
  • Loading branch information
jeremiedimino authored and rgrinberg committed Feb 27, 2019
1 parent d857dd8 commit 339701b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- Make errors about menhir stanzas be located (#1881, fix #1876,
@diml)

- Make errors about menhir stanzas be located (#1881, fix #1876,
@diml)

1.7.2 (21/02/2019)
------------------

Expand Down
9 changes: 6 additions & 3 deletions src/dune_file.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1689,6 +1689,7 @@ module Menhir = struct
and infer = field_o_b "infer" ~check:(Syntax.since syntax (2, 0))
and menhir_syntax = Syntax.get_exn syntax
and enabled_if = enabled_if
and loc = loc
in
let infer =
match infer with
Expand All @@ -1699,7 +1700,7 @@ module Menhir = struct
; flags
; modules
; mode
; loc = Loc.none
; loc
; infer
; enabled_if
})
Expand All @@ -1717,12 +1718,14 @@ module Menhir = struct
(let%map merge_into = field_o "merge_into" string
and flags = field_oslu "flags"
and modules = field "modules" (list string)
and mode = Rule.Mode.field in
and mode = Rule.Mode.field
and loc = loc
in
{ merge_into
; flags
; modules
; mode
; loc = Loc.none
; loc
; infer = false
; enabled_if = Blang.true_
})
Expand Down

0 comments on commit 339701b

Please sign in to comment.