Commit e9babb1a authored by Vincent Pelletier's avatar Vincent Pelletier

Fix imleicit 'and' operator precedence: make it behave just like an explicit 'and' operator.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26799 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7c5d6d3a
......@@ -150,20 +150,20 @@ class AdvancedSearchTextParser(lexer):
def p_seach_text(self, p):
'''search_text : and_expression
| and_expression OR search_text
| and_expression search_text'''
| and_expression OR search_text'''
if len(p) == 2:
p[0] = p[1]
elif len(p) == 3:
p[0] = p[1].push('and', p[2])
else:
p[0] = p[1].push('or', p[3])
def p_and_expression(self, p):
'''and_expression : boolean_expression
| boolean_expression and_expression
| boolean_expression AND and_expression'''
if len(p) == 2:
p[0] = p[1]
elif len(p) == 3:
p[0] = p[1].push('and', p[2])
else:
p[0] = p[1].push('and', p[3])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment