Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
6 changes: 3 additions & 3 deletions dhall/src/Dhall/Parser/Expression.hs
Original file line number Diff line number Diff line change
Expand Up @@ -418,15 +418,15 @@ parsers embedded = Parsers{..}
nonemptyWhitespace
case (shallowDenote a, a0Info) of
(ListLit Nothing [], _) -> do
b <- applicationExpression
b <- expression

return (ListLit (Just b) [])
(Merge c d Nothing, NakedMergeOrSomeOrToMap) -> do
b <- applicationExpression
b <- expression

return (Merge c d (Just b))
(ToMap c Nothing, NakedMergeOrSomeOrToMap) -> do
b <- applicationExpression
b <- expression

return (ToMap c (Just b))
_ -> do
Expand Down
10 changes: 5 additions & 5 deletions dhall/src/Dhall/Pretty/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -861,15 +861,15 @@ prettyPrinters characterSet =
<> Pretty.indent 2 (prettyImportExpression_ b)
<> Pretty.hardline
<> colon <> space
<> prettyApplicationExpression c
<> prettyExpression c
)

short = keyword "merge" <> space
<> prettyImportExpression_ a
<> " "
<> prettyImportExpression_ b
<> space <> colon <> space
<> prettyApplicationExpression c
<> prettyExpression c
prettyAnnotatedExpression (ToMap a (Just b)) =
Pretty.group (Pretty.flatAlt long short)
where
Expand All @@ -880,13 +880,13 @@ prettyPrinters characterSet =
<> Pretty.indent 2 (prettyImportExpression_ a)
<> Pretty.hardline
<> colon <> space
<> prettyApplicationExpression b
<> prettyExpression b
)

short = keyword "toMap" <> space
<> prettyImportExpression_ a
<> space <> colon <> space
<> prettyApplicationExpression b
<> prettyExpression b
prettyAnnotatedExpression a0@(Annot _ _) =
enclose'
""
Expand All @@ -906,7 +906,7 @@ prettyPrinters characterSet =
prettyAnnotatedExpression (ListLit (Just a) b) =
list (map prettyExpression (Data.Foldable.toList b))
<> " : "
<> prettyApplicationExpression a
<> prettyExpression a
prettyAnnotatedExpression a
| Just doc <- preserveSource a =
doc
Expand Down