
18 Mar
2002
18 Mar
'02
10:35 a.m.
On Mon, 18 Mar 2002, Kevin Glynn wrote:
Are there any programs to strip comments and blank lines from a Haskell source file, that work on normal and literate programs?
Doing a real job is 'hard' (e.g. nested block comments, -- may actually start a lexeme ...)
For a simple job that does well usually see
fptools/ghc/compiler/count_lines
in the ghc distribution.
Unfortunately that doesn't even handle multi-line "{- ... -}" comments... So I hacked up this wretched slice of Perl to do the job. I'm surprised there aren't programs out there that do this properly. -- Nick Nethercote njn25@cam.ac.uk