Skip to content

Commit

Permalink
Add support for leading separators (dhall-lang#1355)
Browse files Browse the repository at this point in the history
* Add support for leading separators

... as standardized in dhall-lang/dhall-lang#755

Note that this does not yet change the formatter to use them

* Update `dhall-lang` submodule

* Fix `dhall.cabal` to mention new Prelude files

* Remove duplicate lines
  • Loading branch information
Gabriella439 authored and mergify[bot] committed Oct 10, 2019
1 parent 9b9d1f5 commit a24ddfc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions dhall/src/Dhall/Parser/Expression.hs
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,13 @@ parsers embedded = Parsers {..}

alternative04 = (do
_openBrace

_ <- optional _comma

a <- recordTypeOrLiteral

_closeBrace

return a ) <?> "record type or literal"

alternative05 = unionType
Expand Down Expand Up @@ -673,6 +678,8 @@ parsers embedded = Parsers {..}
unionType = (do
_openAngle

_ <- optional _bar

let unionTypeEntry = do
a <- anyLabel
b <- optional (do _colon; expression)
Expand All @@ -688,7 +695,11 @@ parsers embedded = Parsers {..}

listLiteral = (do
_openBracket

_ <- optional _comma

a <- Text.Megaparsec.sepBy expression _comma

_closeBracket
return (ListLit Nothing (Data.Sequence.fromList a)) ) <?> "list literal"

Expand Down

0 comments on commit a24ddfc

Please sign in to comment.