add support for != operator stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 01 Feb 2011 10:10:13 +0100
branchstable
changeset 614 f7dadebfd42e
parent 613 213f8fff2aee
child 615 7d368dd97930
add support for != operator
ChangeLog
nodes.py
parser.g
parser.py
--- a/ChangeLog	Fri Jan 28 14:33:44 2011 +0100
+++ b/ChangeLog	Tue Feb 01 10:10:13 2011 +0100
@@ -1,6 +1,9 @@
 ChangeLog for RQL
 =================
 
+--
+* suport != operator for non equality
+
 2011-01-12  --  0.28.0
     * enhance rewrite_shared_optional so one can specify where the new identity
       relation should be added (used by cw multi-sources planner)
--- a/nodes.py	Fri Jan 28 14:33:44 2011 +0100
+++ b/nodes.py	Tue Feb 01 10:10:13 2011 +0100
@@ -484,7 +484,7 @@
         self.optional= value
 
 
-OPERATORS = frozenset(('=', '<', '<=', '>=', '>', 'ILIKE', 'LIKE'))
+OPERATORS = frozenset(('=', '!=', '<', '<=', '>=', '>', 'ILIKE', 'LIKE'))
 
 class Comparison(HSMixin, Node):
     """handle comparisons:
--- a/parser.g	Fri Jan 28 14:33:44 2011 +0100
+++ b/parser.g	Tue Feb 01 10:10:13 2011 +0100
@@ -88,7 +88,7 @@
     token FALSE:       r'(?i)FALSE'
     token NULL:        r'(?i)NULL'
     token EXISTS:      r'(?i)EXISTS'
-    token CMP_OP:      r'(?i)<=|<|>=|>|~=|=|LIKE|ILIKE'
+    token CMP_OP:      r'(?i)<=|<|>=|>|!=|=|~=|LIKE|ILIKE'
     token ADD_OP:      r'\+|-'
     token MUL_OP:      r'\*|/'
     token FUNCTION:    r'[A-Za-z_]+\s*(?=\()'
--- a/parser.py	Fri Jan 28 14:33:44 2011 +0100
+++ b/parser.py	Tue Feb 01 10:10:13 2011 +0100
@@ -109,7 +109,7 @@
         ('FALSE', re.compile('(?i)FALSE')),
         ('NULL', re.compile('(?i)NULL')),
         ('EXISTS', re.compile('(?i)EXISTS')),
-        ('CMP_OP', re.compile('(?i)<=|<|>=|>|~=|=|LIKE|ILIKE')),
+        ('CMP_OP', re.compile('(?i)<=|<|>=|>|!=|=|~=|LIKE|ILIKE')),
         ('ADD_OP', re.compile('\\+|-')),
         ('MUL_OP', re.compile('\\*|/')),
         ('FUNCTION', re.compile('[A-Za-z_]+\\s*(?=\\()')),