"Except" did not match properly

Making the testGrammer test case strict showed that "except" was not
matched properly. Fixed by using onOf i.s.o. | operator
This commit is contained in:
adam-urbanczyk
2016-07-10 19:14:06 +02:00
parent a42cad1c3e
commit d06f3e6153
2 changed files with 3 additions and 3 deletions

View File

@ -569,7 +569,7 @@ def _makeExpressionGrammar(atom):
#define operators
and_op = Literal('and')
or_op = Literal('or')
delta_op = Literal('exc') | Literal('except')
delta_op = oneOf(['exc','except'])
not_op = Literal('not')
def atom_callback(res):

View File

@ -453,6 +453,6 @@ class TestCQSelectors(BaseTest):
'bottom',
'not |(1,1,0) and >(0,0,1) or XY except >(1,1,1)[-1]',
'(not |(1,1,0) and >(0,0,1)) exc XY and (Z or X)']
for e in expressions: gram.parseString(e)
#import pdb; pdb.set_trace()
for e in expressions: gram.parseString(e,parseAll=True)