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
This is not exactly a bug in Parsley, it just works different compared to PyMeta2. The meaning of the two string quotes (', ") should be described better in the documentation. Se below for a possible parser improvement as well.
In the test code, I try to match using " - ". The double quoted string is matched as a Token, and Parsley helpfully removes any whitespace that may come before it, effectively matching the pattern (' '* ' - '). This will of course never match. The correct pattern to use in this case is ' - ', which is matched against the exact string.
It works in PyMeta2 because " - " is not matched as a Token, but as a string. The PyMeta2 parser will parse ' - ' successfully, but it will never match, as it is handled by the exactly matcher, which only compares the first character on the input stream against the string. A pattern that works both in Parsley and PyMeta2 would have to be written as (' ' '-' ' '). (PyMeta2 has a token matcher as well, but I am unsure if it can be invoked.)
Maybe the Parsley grammar should fail to parse Tokens that start with whitespace. PyMeta2 on the other hand should fail on anything longer than a single character within single quotes.
Have you abandoned Launchpad? I think I managed to install parsley-master over Parsley 1.1 and ran the test with the same result as before:
https://bugs.launchpad.net/parsley/+bug/1183224
The text was updated successfully, but these errors were encountered: