All of the parsers in Text.Parsec.Token
politely use lexeme
to eat whitespace after a token. Unfortunately for me, whitespace includes new lines, whic
Although the other answers about it not being possible are correct, I would like to point out that the char parsers are not using a lexeme parser.
I use parsec to analyse some html mustache templates. Whitespaces are important in that analysis. What I did was to simply parse the ">" and "}}" strings with Text.Parsec.Char.string
.
Since I am interested in whitespaces between tags and not inside them I can still use the reserved operators to parse "<" and "{{" etc., because the lexeme parser only consumes trailing whitespace.