Closed gitjoost closed 5 years ago
I'm not sure I follow this. The string in [ ... ] needs to exactly match the token text. If the token being matched is lowercase such as "if", then it needs to specified as ID['if'] = IF
as shown.
Yeah, sigh, in my infinite wishdom I had the text to parse going through upper() so “if” had to become “IF”. Blame it on too much wine... just close this one
Ha! No problem. It's always a good idea for me to double check such things though---so all reports related to documentation are good!
Small error/fix in the documentation under "Token Remapping" the following text/example:
is a bit misleading as this gives no (intuitive) way to trigger a yacc rule that includes 'if', 'else' or 'while'. Assuming that the assignment is made with IF, ELSE and WHILE with keywords/tokens specified earlier. If however, the example specifies uppercase for the dict keys:
a parser rule e.g.;
@_('IF NUMBER "=" NUMBER')
no longer fails.