Open pjbgf opened 1 year ago
Goyacc is derived from the original Unix 7th Edition yacc, with a few tweaks along the way. The %code token was not part of that implementation and I am unfamiliar with it.
What does it do, where have you seen it supported, and why do you need it?
I found this about %code
:
The
%code
directive inserts code verbatim into the output parser source at any of a predefined set of locations. It thus serves as a flexible and user-friendly alternative to the traditional Yacc prologue,%{code%}
.
I am trying to use the official yacc parser definition for AppArmor, which currently uses it. In terms of implementation, the GNU yacc CLI supports it.
The workaround is trivial, although it does require editing the grammar.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Successful processing of
parser_yacc.y
.What did you see instead?
invalid escape, or illegal reserved word: code: parser_yacc.y:182