haskell / happy

The Happy parser generator for Haskell
Other
291 stars 84 forks source link

Refactor happyDoActions #280

Closed Kariiem closed 4 months ago

Kariiem commented 5 months ago

This PR refactors happyDoActions into several smaller functions, changes how the parsing tables are constructed, using 32-bit integers instead of 16-bit integers.

sgraf812 commented 5 months ago

I rebased and added a commit fixing the tests. Feel free to squash the changes in the commits where they belong.

Bodigrim commented 4 months ago

I had a closer look at how WORDS_BIGENDIAN is to be used. alex simply pulls it from the GHC-provided header ghcconfig.h.

There are several possible headers; I don't remember why but I think at some point we concluded that MachDeps.h is the best option.

There is also GHC.ByteOrder, but beware that it was broken before GHC 8.10. A compatibility package ghc-byteorder is available.

sgraf812 commented 4 months ago

Alright, I included MachDeps.h to import the WORDS_BIGENDIAN define and did a final review. I'm inclined to merge this.