Merge pull request #275 from noahhaasis/nicer-error-for-empty-match-list

Add a nicer error message for empty match lists
This commit is contained in:
Rúnar 2018-12-16 09:19:43 -05:00 committed by GitHub
commit ad5f550183
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,8 +80,7 @@ match = do
start <- reserved "case"
scrutinee <- term
_ <- openBlockWith "of"
-- TODO: Produce a nice error message for empty match list
cases <- sepBy1 semi matchCase
cases <- sepBy1 semi matchCase P.<?> "at least one case in case/of"
_ <- closeBlock
pure $ Term.match (ann start <> ann (last cases)) scrutinee cases