]> git.phdru.name Git - phdru.name/cgi-bin/blog-ru/search-tags.git/commitdiff
Fix negative lookahead in grammar syntax
authorOleg Broytman <phd@phdru.name>
Mon, 11 Jul 2016 18:16:57 +0000 (21:16 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 11 Jul 2016 18:16:57 +0000 (21:16 +0300)
parser/grammar.ebnf
parser/parser.py

index 4a702edf2bbcfa7f0bfcecb1c47171580cefacb9..ce21b642621acec201493329aa4b1126d6dbfd01 100644 (file)
@@ -19,7 +19,7 @@
 
 start = expression $ ;
 
-expression = expression1 !&or_op | or_expression ;
+expression = expression1 !or_op | or_expression ;
 
 or_expression = expression1 or_op expression ;
 
@@ -29,9 +29,9 @@ not_expression = not_op expression3 ;
 
 parens_expression = '(' expression ')' ;
 
-expression1 = expression2 !&and_op | and_expression ;
+expression1 = expression2 !and_op | and_expression ;
 
-expression2 = !&not_op expression3 | not_expression ;
+expression2 = !not_op expression3 | not_expression ;
 
 expression3 = parens_expression | name ;
 
index 4984f1862f4a4ef165dfc7ba05a3c263e2936056..a1dd03489c2db90ef315017fa2f7b47e3f27a630 100755 (executable)
@@ -17,7 +17,7 @@ from grako.parsing import graken, Parser
 from grako.util import re, RE_FLAGS, generic_main  # noqa
 
 
-__version__ = (2016, 7, 10, 22, 31, 57, 6)
+__version__ = (2016, 7, 11, 18, 15, 20, 0)
 
 __all__ = [
     'TagsParser',
@@ -62,8 +62,7 @@ class TagsParser(Parser):
             with self._option():
                 self._expression1_()
                 with self._ifnot():
-                    with self._if():
-                        self._or_op_()
+                    self._or_op_()
             with self._option():
                 self._or_expression_()
             self._error('no available options')
@@ -97,8 +96,7 @@ class TagsParser(Parser):
             with self._option():
                 self._expression2_()
                 with self._ifnot():
-                    with self._if():
-                        self._and_op_()
+                    self._and_op_()
             with self._option():
                 self._and_expression_()
             self._error('no available options')
@@ -108,8 +106,7 @@ class TagsParser(Parser):
         with self._choice():
             with self._option():
                 with self._ifnot():
-                    with self._if():
-                        self._not_op_()
+                    self._not_op_()
                 self._expression3_()
             with self._option():
                 self._not_expression_()