Haskell Folks,

I have an existing Parsec CharParser parser that I would like to extend to
include line continuation support.
When there's a backslash-newline combination anywhere in the token stream,
I'd like to remove it so it's not read by the rest of the parser, even if
its in the middle of a keyword.

Currently I'm doing this with a separate "preprocess" function that weeds
out all the '\\\n' strings from the input before passing it to the parser.
The problem with this is it messes up the line position when there's an
error below the '\\\n' point, since the newline is never seen by the parser.

So I've been trying to figure out how to handle this better with Parsec.  I
think I need something that acts just like CharParser, except it skips over
the backslash-newline tokens, It looks like section 2.11 in the Parsec
manual (Advanced: separate scanners") covers this, but I'm not having much
luck turning it into working code.

Could someone who's written their own scanner spell out how it's done in a
little more detail ?

Thanks !

- jude
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to