haskell-suite / haskell-src-exts

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

MultiWayIf: Expects different indentation than GHC #468

Open nomeata opened 1 year ago

nomeata commented 1 year ago

Consider this file:

{-# LANGUAGE MultiWayIf #-}

foo b = if | b
           , b
           -> 1
           | otherwise
           -> 2

It loads in ghc, but haskell-src-exts say

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

It works if I indent the lines starting with , and -> by at least one space.