You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by db...@apache.org on 2012/05/26 18:03:12 UTC

[2/2] git commit: Better error messages from improper input in cli, better decimal parsing patch by dbrosius reviewed by pyaskevich for CASSANDRA-3865

Better error messages from improper input in cli, better decimal parsing
patch by dbrosius reviewed by pyaskevich for CASSANDRA-3865


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2d72056c
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2d72056c
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2d72056c

Branch: refs/heads/trunk
Commit: 2d72056c14f9b97e67dd94e48691f3ec1a88d9d6
Parents: 2dc27a1
Author: Dave Brosius <db...@apache.org>
Authored: Sat May 26 11:56:52 2012 -0400
Committer: Dave Brosius <db...@apache.org>
Committed: Sat May 26 11:56:52 2012 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/cli/Cli.g |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2d72056c/src/java/org/apache/cassandra/cli/Cli.g
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cli/Cli.g b/src/java/org/apache/cassandra/cli/Cli.g
index a8a369c..8197aaa 100644
--- a/src/java/org/apache/cassandra/cli/Cli.g
+++ b/src/java/org/apache/cassandra/cli/Cli.g
@@ -119,16 +119,7 @@ package org.apache.cassandra.cli;
 {
     public void reportError(RecognitionException e) 
     {
-        String errorMessage;
-
-        if (e instanceof NoViableAltException)
-        {
-            errorMessage = "Command not found: `" + this.input + "`. Type 'help;' or '?' for help.";
-        }
-        else
-        {
-            errorMessage = "Syntax error at position " + e.charPositionInLine + ": " + this.getErrorMessage(e, this.getTokenNames());
-        }
+        String errorMessage = "Syntax error at position " + e.charPositionInLine + ": " + this.getErrorMessage(e, this.getTokenNames());
 
         throw new RuntimeException(errorMessage);
     }
@@ -630,7 +621,9 @@ IntegerNegativeLiteral
    ;
    
 DoubleLiteral
-   : Digit+ '.' Digit+;
+   : Digit+ ('.' Digit+)?
+   | '.' Digit+ 
+   ;
 
 Identifier
     : (Letter | Alnum) (Alnum | '_' | '-' )*