[Haskell-cafe] parsec: how to get end location
stephen.tetley at gmail.com
Mon Jun 14 05:52:42 EDT 2010
You would need different behaviour for the /lexeme/ parser in
Parsec.Token at least - this is the combinator that promotes a parser
to also consume trailing whitespace.
I suspect you would have to recode most of Parsec.Token module - the
TokenParser is a parameterized module (in the sense of Sheard and
Pasalic ), unfortunately /lexeme/ is not one of the parameters and
other combintators are defined using it within the makeTokenParser
function which instantiates the parameterized module.
Alternative you could remake a set of token parsers - this is covered
in the Parsec manual  - section 2.11 "Advanced: Separate scanners".
More information about the Haskell-Cafe