A Comment-Preserving Cabal Parser | The Haskell Programming Language’s blog

20 Likes

Thanks a lot for the work!

2 Likes

Nice! My Gild tool handles comments the same way, by storing them in the annotations.

3 Likes

This looks great. Maybe I’ll borrow this parser for mcabal. I just need to rewrite the lexer, since I don’t want a dependency on Alex.

1 Like

Where can I find the code?

2 Likes

Found this:
Comment parser by leana8959 · Pull Request #11252 · haskell/cabal · GitHub

2 Likes

To drop the dependency on alex, you can always just plug in the generated lexer and ignore where it came from :slight_smile:

More generally, I would like cabal-syntax to be Haskell2010, and think that it should not be an absurd task, even though I think trying to extend that to the libraries and executables on top of that would be relatively sisyphean.

4 Likes