diff --git a/CHANGES.md b/CHANGES.md index 65eca8d6da0..b1b50c0d1d8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) ------------------ diff --git a/src/dune_file.ml b/src/dune_file.ml index ffeb95536fb..e3820d3ed4f 100644 --- a/src/dune_file.ml +++ b/src/dune_file.ml @@ -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 @@ -1699,7 +1700,7 @@ module Menhir = struct ; flags ; modules ; mode - ; loc = Loc.none + ; loc ; infer ; enabled_if }) @@ -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_ })