]> git.phdru.name Git - phdru.name/cgi-bin/blog-ru/search-tags.git/blobdiff - parser/grammar
Allow ' OR ' and ' or '
[phdru.name/cgi-bin/blog-ru/search-tags.git] / parser / grammar
index 33326116c917ec5300f0df9b6ebbf95e44dfa65a..694437875fcc62548065bef2d439eeb3a9f41f46 100644 (file)
@@ -9,7 +9,7 @@
 #  TAG & (TAG | TAG)
 #  !(TAG | TAG)
 # Allowed operators: conjunction - & && AND and
-#                    disjunction - | ||
+#                    disjunction - | || OR or
 #                    negation    - !
 # This  is a simple version of the grammar and it allows
 # rather stupid expressions, like !!TAG or ((TAG)); in the future
@@ -32,6 +32,7 @@ expression : NAME
            | NOT_OP SP0 expression
            | expression SP0 OR_OP OR_OP SP0 expression
            | expression SP0 OR_OP SP0 expression
+           | l_expression or_word r_expression
            | expression_parens
 
 l_expression : expression_parens
@@ -49,6 +50,9 @@ expression_sp : expression SP1
 and_word : 'A' 'N' 'D'
          | 'a' 'n' 'd'
 
+or_word : 'O' 'R'
+        | 'o' 'r'
+
 SP0 : SP1 | empty
 
 empty :