haskell / happy

The Happy parser generator for Haskell
Other
276 stars 85 forks source link

Debugging "grammar does not fit in 16-bit representation that is used with '--ghc'"? #199

Open saw235 opened 3 years ago

saw235 commented 3 years ago

Hi,

I am getting the following error but have no clue where to start debugging as my lbnf and subsequently the Par.y file is quite large. Is there a way to check where in the file is causing the error?

error "grammar does not fit in 16-bit representation that is used with '--ghc'"
Ericson2314 commented 2 years ago

I do not know how to debug this, but I suppose it means you have over 2^16 of something?

sgraf812 commented 1 month ago

The reason for the error is that your parser has become so large that its action table cannot be addressed using 16 bit offsets. That is problematic because happy used to use hardcode its offsets to 16 bit. I opened #266 to mourn this and the recently merged #280 provides the fix.

TLDR; try building the most recent master of happy to see whether it fixes your bug.