You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a few years I revisited my old project which uses TatSu. I upgraded the library to version 5.11.3 (I'm using Python 3.12). I had to fix a few things - but no matter what I did, I couldn't make my booleans working properly. Diving with debugger into TatSu code showed that there might be some issue with keyword handling.
If the keyword declarations contains "True" or "False" spelled exactly like this - with first letter being capital:
@@keyword :: True False
Then the ModelContext.keywords set will contain these two words - not as strings, but as regular Python booleans instead. Consequently, _check_name will not match with a string "False" nor "True".
Changing these keywords to lowercase is a quick workaround.
The text was updated successfully, but these errors were encountered:
KrzysztofT
changed the title
@@keywords + @name directives fail if keyword is "True" or "False"
@@keyword + @name directives fail if keyword is "True" or "False"
Mar 16, 2024
After a few years I revisited my old project which uses TatSu. I upgraded the library to version 5.11.3 (I'm using Python 3.12). I had to fix a few things - but no matter what I did, I couldn't make my booleans working properly. Diving with debugger into TatSu code showed that there might be some issue with keyword handling.
If the keyword declarations contains "True" or "False" spelled exactly like this - with first letter being capital:
@@keyword :: True False
Then the
ModelContext.keywords
set will contain these two words - not as strings, but as regular Python booleans instead. Consequently,_check_name
will not match with a string "False" nor "True".Changing these keywords to lowercase is a quick workaround.
The text was updated successfully, but these errors were encountered: