haskell-suite / haskell-src-exts

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

Unexpected end of input while lexing quasi-quoter [r|a/*|] #385

Open philderbeast opened 6 years ago

philderbeast commented 6 years ago

I ran hlint and got what I think is an error from its use of haskell-src-exts. I've narrowed down the problem raw string contents to a/*. This fails.

{-# LANGUAGE QuasiQuotes #-}

description :: String
description = [r|a/*|]

Error: Parse error: Unexpected end of input while lexing quasi-quoter

The same as a string doesn't have the parse error.

description = "a/*"

Neither do any of these.

description = [r|a|]
description = [r|/|]
description = [r|*|]

description = [r|aa|]
description = [r|//|]
description = [r|**|]

description = [r|aaa|]
description = [r|///|]
description = [r|***|]

description = [r|a/|]
description = [r|/*|]

-- the other 5 of the 6 permutations of ['a', '/', '*']
description = [r|/*a|]
description = [r|*a/|]
description = [r|*/a|]
description = [r|a*/|]
description = [r|/a*|]

description = [r|a/a|]
description = [r|*/*|]

Here's the raw string as it was when I hit this problem

https://github.com/BlockScope/flare-timing/blob/97e785d95cf18d4f9bdac369acf268fd64fbbc69/flare-timing/prod-apps/align-time/Cmd/Args.hs#L35-L44