Tokens whose first characters are used by another token, are not usable anymore

Bug #397807 reported by Gustavo Narea on 2009-07-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Booleano
High
Gustavo Narea

Bug Description

For example, if the equality token is "is" and the not equality token is "is not", then the later won't be usable because it'd be matched as <equality> <Variable "not">, which will cause a parse error when the actual right-hand operand is found.

I think there are three possible solutions:

1.- Attempt to resolve this at the Pyparsing grammar-level (very unlikely, I think).
2.- Reject these tokens as they as set (which would affect performance).
3.- Check this in the parser's test utilities module, so users can be aware of this problem and fix it without affecting the performance of their applications on deployment.

Unfortunately, rearranging the operators is not a valid solution because there are several precedence levels. This is, defining the tokens from longer to shorter will only work for operations that have the same precedence.

Related branches

Gustavo Narea (gnarea) on 2009-07-10
description: updated
Gustavo Narea (gnarea) on 2009-07-15
Changed in booleano:
milestone: 1.0a2 → 1.0a1
Gustavo Narea (gnarea) wrote :

Fixed in r165, at least among membership and relational operations. For the rest of the operations, the following blueprint will fix it:
https://blueprints.launchpad.net/booleano/+spec/fully-customizable-operations

Changed in booleano:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers