[Parsec] Extracting line and column numbers

Stefan Holdermans sholderm at students.cs.uu.nl
Tue Jan 13 12:44:10 EST 2004


Hi,

I'm using the Parsec library to parse strings for a small experimental
language. I'd like to decorate each node in the abstract syntax tree with
a pair (Int, Int) that represents the line and column number in the
strings. Unfortunately, the SourcePos class in the Parsec library is
abstract and I cannot extract the line and column numbers from a SourcePos
value. What are my options?

With kind regards,

Stefan Holdermans



More information about the Haskell mailing list