Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep location of menhir stanzas #1881

Merged
2 commits merged into from Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ unreleased

- Format `dune printenv` output (#1867, fix #1862, @emillon)

- 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