cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1201915 - in /cassandra/branches/cassandra-1.0/pylib/cqlshlib: cqlhandling.py pylexotron.py
Date Mon, 14 Nov 2011 21:31:30 GMT
Author: jbellis
Date: Mon Nov 14 21:31:30 2011
New Revision: 1201915

URL: http://svn.apache.org/viewvc?rev=1201915&view=rev
Log:
update cqlsh lexer to handle counter increments
patch by Paul Cannon; reviewed by jbellis for CASSANDRA-3493

Modified:
    cassandra/branches/cassandra-1.0/pylib/cqlshlib/cqlhandling.py
    cassandra/branches/cassandra-1.0/pylib/cqlshlib/pylexotron.py

Modified: cassandra/branches/cassandra-1.0/pylib/cqlshlib/cqlhandling.py
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/pylib/cqlshlib/cqlhandling.py?rev=1201915&r1=1201914&r2=1201915&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/pylib/cqlshlib/cqlhandling.py (original)
+++ cassandra/branches/cassandra-1.0/pylib/cqlshlib/cqlhandling.py Mon Nov 14 21:31:30 2011
@@ -189,7 +189,7 @@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n\
 <star> ::=          "*" ;
 <range> ::=         ".." ;
 <endtoken> ::=      ";" ;
-<op> ::=            /[=,().]/ ;
+<op> ::=            /[-+=,().]/ ;
 <cmp> ::=           /[<>]=?/ ;
 
 <unclosedString>  ::= /'([^']|'')*/ ;
@@ -267,7 +267,7 @@ syntax_rules += r'''
 <selectWhereClause> ::= <relation> ("AND" <relation>)*
                       | keyname=<colname> "IN" "(" <term> ("," <term>)*
")"
                       ;
-<relation> ::= [rel_lhs]=<colname> ("=" | "<" | ">" | "<=" | ">=")
<term>
+<relation> ::= [rel_lhs]=<colname> ("=" | "<" | ">" | "<=" | ">=")
<colname>
              ;
 <whatToSelect> ::= colname=<colname> ("," colname=<colname>)*
                  | ("FIRST" <integer>)? "REVERSED"? (rangestart=<colname> ".."
rangeend=<colname>
@@ -358,8 +358,8 @@ syntax_rules += r'''
                         "SET" <assignment> ( "," <assignment> )*
                         "WHERE" <updateWhereClause>
                     ;
-<assignment> ::= updatecol=<colname> "=" update_rhs=<term>
-                                         ( counterop=( "+" | "-" ) <term> )?
+<assignment> ::= updatecol=<colname> "=" update_rhs=<colname>
+                                         ( counterop=( "+" | "-"? ) <integer> )?
                ;
 <updateWhereClause> ::= updatefiltercol=<colname> "=" <term>
                       | updatefilterkey=<colname> filter_in="IN" "(" <term> (
"," <term> )* ")"

Modified: cassandra/branches/cassandra-1.0/pylib/cqlshlib/pylexotron.py
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/pylib/cqlshlib/pylexotron.py?rev=1201915&r1=1201914&r2=1201915&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/pylib/cqlshlib/pylexotron.py (original)
+++ cassandra/branches/cassandra-1.0/pylib/cqlshlib/pylexotron.py Mon Nov 14 21:31:30 2011
@@ -88,6 +88,10 @@ class ParseContext:
         return self.__class__(self.ruleset, self.bindings, self.matched,
                               self.remainder, newname)
 
+    def __repr__(self):
+        return '<%s matched=%r remainder=%r prodname=%r>' % (self.__class__.__name__,
self.matched, self.remainder,
+                                                             self.productionname)
+
 class matcher:
     def __init__(self, arg):
         self.arg = arg



Mime
View raw message