"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:
@ -569,7 +569,7 @@ def _makeExpressionGrammar(atom):
|
|||||||
#define operators
|
#define operators
|
||||||
and_op = Literal('and')
|
and_op = Literal('and')
|
||||||
or_op = Literal('or')
|
or_op = Literal('or')
|
||||||
delta_op = Literal('exc') | Literal('except')
|
delta_op = oneOf(['exc','except'])
|
||||||
not_op = Literal('not')
|
not_op = Literal('not')
|
||||||
|
|
||||||
def atom_callback(res):
|
def atom_callback(res):
|
||||||
|
|||||||
@ -453,6 +453,6 @@ class TestCQSelectors(BaseTest):
|
|||||||
'bottom',
|
'bottom',
|
||||||
'not |(1,1,0) and >(0,0,1) or XY except >(1,1,1)[-1]',
|
'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)']
|
'(not |(1,1,0) and >(0,0,1)) exc XY and (Z or X)']
|
||||||
|
#import pdb; pdb.set_trace()
|
||||||
for e in expressions: gram.parseString(e)
|
for e in expressions: gram.parseString(e,parseAll=True)
|
||||||
|
|
||||||
Reference in New Issue
Block a user