haskell / alex

A lexical analyser generator for Haskell
https://hackage.haskell.org/package/alex
BSD 3-Clause "New" or "Revised" License
297 stars 82 forks source link

Fix non-exhaustive pattern in templates/wrapper.hs #72

Closed kku1993 closed 7 years ago

kku1993 commented 8 years ago

Non-exhaustive pattern in the wrapper is undesirable since third parties using the wrapper will see a warning that's not related to their code.

erikd commented 7 years ago

This issue fixed by this PR has already been fixed using a slightly different solution. The code is now

alexGetByte (p,_,[],(c:s))  = let p' = alexMove p c
                                  (b:bs) = utf8Encode c
                              in p' `seq`  Just (b, (p', c, bs, s))

where utf8Encode always returns a list containing at least one element.

This PR should be closed.