happy icon indicating copy to clipboard operation
happy copied to clipboard

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

Open saw235 opened this issue 4 years ago • 2 comments

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'"

saw235 avatar Aug 23 '21 02:08 saw235

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

Ericson2314 avatar Oct 24 '21 21:10 Ericson2314

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.

sgraf812 avatar Jul 22 '24 14:07 sgraf812

I'll optimistically close this issue; #280 likely fixed it and was released with Happy 2.0.

sgraf812 avatar Sep 19 '24 15:09 sgraf812