ruby / lrama

Pure Ruby LALR parser generator
190 stars 26 forks source link

Lrama always turned on %locations unlike Bison #429

Closed matz closed 3 months ago

matz commented 3 months ago

When bison file specifies %define api.pure, Bison calls yylex as yylex (&yylval) but lrama calls yylex (&yylval, &yylloc), which is Bison's behavior for %define api.pure full. I will update the bison input, but it is a compatibility issue anyway.

matz commented 3 months ago

Upon further investigation, it appears that the problem is that lrama has %locations directive set by default (default off in Bison).

matz commented 3 months ago

As a workaround, we have added @1 in the rules. But we still prefer no YYLTYPE passed to yyerror and yylex.

matz commented 3 months ago

Thank you!