[Haskell-cafe] Re: [Haskell] Re: ANN: Haddock version 2.1.0
David Waern
david.waern at gmail.com
Thu May 8 13:46:28 EDT 2008
2008/5/8 Simon Marlow <marlowsd at gmail.com>:
> So basically you want to run a lexer over the source again to collect all
> the comments?
Yes.
> You really want to use GHC's lexer, because otherwise you
> have to write another lexer.
I don't mind writing a lexer that just collects the comments. It
should be simpler than a full Haskell lexer, right? It wouldn't need
to handle layout, for instance. Using GHC is also a good option.
> So a flag to GHC's lexer that says whether it
> should return comments or not seems like a reasonable way to go. But if
> you're doing that, you might as well have the parser collect all the
> comments off to the side during parsing, to avoid having to lex the file
> twice, right?
Yes.
David
More information about the Haskell-Cafe
mailing list