x/tools/cmd/goyacc: add API to convert between state numbers and strings #12094
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
I'd like to have an API to convert between state numbers (as defined by the external "lexer" constant) and their string representation.
There is an internal function that sort of do it - yyTokname but there is a magical offset between what the yacc internal code call state number, and the defined constant. And the magical constant differ between 1.4 and 1.5. For the other direction one have to go the yyToknames table itself, again with (a slightly different) magic offset that differ between version.
So the request is for simple API to do this conversion (an alternative is to give some type to the constant and then we can use the stringer tool).
The text was updated successfully, but these errors were encountered: