[Haskell-cafe] Return user state in Parsec

Maciej Podgurski maciej.podgurski at googlemail.com
Wed May 21 12:43:59 EDT 2008


I'm currently writing a parser using the Parsec library. What I want is 
to store the order of each subparser called in a user state. So every 
single parser will be marked with a label that is stored in a special 
treelike structure when the parser is run.

My problem is to return the last state of this structure when a parse 
error occurred. This information shall be used to display a kind of 
stack trace showing the order of the parser calls for debug purposes. 
Any ideas how to achieve this?


More information about the Haskell-Cafe mailing list