haskell / parsec

A monadic parser combinator library
https://hackage.haskell.org/package/parsec
Other
846 stars 94 forks source link

How to handle include? #158

Open liangjs opened 2 years ago

liangjs commented 2 years ago

The document says

The getInput and setInput functions can for example be used to deal with #include files.

But I can't find a good way to achieve it. Should I use setPosition to jump to the new file, and set it back when the new file is done?

Can you give an example of the expected way to use them?