On 14 Mar 2013, at 14:53, Duncan Coutts wrote:
> Why did I choose parsec? Practicality dictates that I can only use
> things in the core libraries, and the nearest thing we have to that is
> the parser lib that is in the HP.
I fully agree that a real parser is needed for Cabal files. I implemented one myself, many years ago, using the polyparse library, and using a hand-written lexer. Feel free to reuse it (attached, together with a sample program) if you like, although I expect it has bit-rotted a little over time.
Regards,
Malcolm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cabal-parse2.hs
Type: application/octet-stream
Size: 1348 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130315/3c1dc0a9/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CabalParse2.hs
Type: application/octet-stream
Size: 16073 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130315/3c1dc0a9/attachment-0003.obj>