haskell-suite / haskell-src-exts

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

Better support MultiWayIf #391

Open ndmitchell opened 6 years ago

ndmitchell commented 6 years ago

Originally from https://github.com/ndmitchell/hlint/issues/414 by @jasonstolaruk, the following code works fine in GHC but gives a parse error in HSE. I think the problem is that the | and -> start at the same character position.

{-# LANGUAGE MultiWayIf #-}

main = print foo

foo = if | True
         -> 1