haskell-suite / haskell-src-exts

Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printer
Other
193 stars 94 forks source link

Empty case without `{}` #469

Open nomeata opened 1 year ago

nomeata commented 1 year ago

GHC accepts this file, using EmptyCase with “implicit” braces for:

{-# LANGUAGE EmptyCase #-}

foo b = case b of

With haskell-src-exts, I get

ghci> Language.Haskell.Exts.parseFile "/tmp/Test.hs"
ParseFailed (SrcLoc "/tmp/Test.hs" 4 12) "Parse error: ;"

It works if I write

{-# LANGUAGE EmptyCase #-}

foo b = case b of {}