C preprocessor + WinHugs

Neil Mitchell ndmitchell at gmail.com
Sun Oct 30 09:18:09 EST 2005


Hi,

I'm looking into implementing C preprocessing in WinHugs. I've looked
around and bundling a copy of cpphs seems like the best solution,
since few windows users will have a cpp hanging around somewhere that
can be found. I've hacked together a basic implementation, the only
thing is that its a lot slower, mainly because its being run on every
single file which is completely unneeded.

Is there some way to detect if a hs file requires preprocessing? If
not, its almost going to be better to stick with no preprocessing, and
have a faster development environment. The ways I thought of were:

* Add some magic to the parser, so that if it encounters a # at the
start of a line, it bails out and restarts again after preprocessing.

* Only preprocess .cpp.hs or .hscpp or some other special suffix as
having cpp directives.

* Look into the file for some sort of command line arguments pragma on
the first line denoting preprocessing.

Thoughts?

Thanks

Neil


More information about the Cvs-hugs mailing list