Fix parser for expressions with nested annotations (#1527)

Fixes https://github.com/dhall-lang/dhall-haskell/issues/1467

We now no longer replace an annotation if one was already present
This commit is contained in:
Gabriel Gonzalez 2019-11-11 12:43:29 -08:00 committed by mergify[bot]
parent a0c3be9ca1
commit 008a9c3e37
3 changed files with 5 additions and 3 deletions

View File

@ -273,11 +273,11 @@ parsers embedded = Parsers {..}
nonemptyWhitespace
b <- expression
case shallowDenote a of
ListLit _ [] ->
ListLit Nothing [] ->
return (ListLit (Just b) [])
Merge c d _ ->
Merge c d Nothing ->
return (Merge c d (Just b))
ToMap c _ ->
ToMap c Nothing ->
return (ToMap c (Just b))
_ -> return (Annot a b)

View File

@ -0,0 +1 @@
([] : a) : b

View File

@ -0,0 +1 @@
([] : a) : b