summaryrefslogtreecommitdiff
path: root/src/examples/lucene_grammar.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/lucene_grammar.py')
-rw-r--r--src/examples/lucene_grammar.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/examples/lucene_grammar.py b/src/examples/lucene_grammar.py
index 85e294b..179f25e 100644
--- a/src/examples/lucene_grammar.py
+++ b/src/examples/lucene_grammar.py
@@ -8,7 +8,7 @@
#
from pyparsing import (Literal, CaselessKeyword, Forward, Regex, QuotedString, Suppress,
- Optional, Group, FollowedBy, operatorPrecedence, opAssoc, ParseException, ParserElement)
+ Optional, Group, FollowedBy, infixNotation, opAssoc, ParseException, ParserElement)
ParserElement.enablePackrat()
COLON,LBRACK,RBRACK,LBRACE,RBRACE,TILDE,CARAT = map(Literal,":[]{}~^")
@@ -49,7 +49,7 @@ term << (Optional(field_name("field") + COLON) +
Optional(boost))
term.setParseAction(lambda t:[t] if 'field' in t or 'boost' in t else None)
-expression << operatorPrecedence(term,
+expression << infixNotation(term,
[
(required_modifier | prohibit_modifier, 1, opAssoc.RIGHT),
((not_ | '!').setParseAction(lambda:"NOT"), 1, opAssoc.RIGHT),