haskell / alex

A lexical analyser generator for Haskell
https://hackage.haskell.org/package/alex
BSD 3-Clause "New" or "Revised" License
298 stars 82 forks source link

Get rid of template preprocessing #175

Closed Ericson2314 closed 3 years ago

Ericson2314 commented 3 years ago

Instead of preprocessing an outer layer of CPP when building Alex, just always produce code that uses CPP. Combined with from-source bootstrapping, this means Alex an have a perfectly bog standard build system, with Makefiles and extra steps strictly optional.

I gather Hugs, and possibly other Haskell implementations, out of the box doesn't support CPP, but I don't want this to stop us. Those can just manually run CPP on the generated code first.

Same idea as https://github.com/simonmar/happy/pull/179.

simonmar commented 3 years ago

LGTM

Ericson2314 commented 3 years ago

Thanks @simonmar!