The lexical error message comes from this function in the generated .hs file:
#ifdef ALEX_MONAD_BYTESTRING
alexMonadScan = do
inp__@(_,_,_,n) <- alexGetInput
sc <- alexGetStartCode
case alexScan inp__ sc of
AlexEOF -> alexEOF
AlexError ((AlexPn _ line column),_,_,_) -> alexError $ "lexical error at line " ++ (show line) ++ ", column " ++ (show column)
AlexSkip inp__' _len -> do
alexSetInput inp__'
alexMonadScan
AlexToken inp__'@(_,_,_,n') _ action -> let len = n'-n in do
alexSetInput inp__'
action (ignorePendingBytes inp__) len
#endif
I can alter the line alexError $ "lexical error at line " ++ (show line) ++ ", column " ++ (show column) to get what I want but, this is going to require manual changes every time I regenerate the lexer. Is there some simple workaround or can this be added as a feature?