You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/03/28 15:44:38 UTC

svn commit: r1306324 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java

Author: sebb
Date: Wed Mar 28 13:44:38 2012
New Revision: 1306324

URL: http://svn.apache.org/viewvc?rev=1306324&view=rev
Log:
Revert r1306321 - committed wrong file

Modified:
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java

Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java?rev=1306324&r1=1306323&r2=1306324&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java (original)
+++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java Wed Mar 28 13:44:38 2012
@@ -49,13 +49,6 @@ class CSVLexer extends Lexer {
         *       is to call 'readAgain' on the stream...
         */
         int c = in.read();
-
-        if ((lastChar == '\n' || lastChar == '\r' || lastChar == ExtendedBufferedReader.UNDEFINED) && isCommentStart(c)) {
-            in.readLine();
-            tkn.type = COMMENT;
-            return tkn;
-        }
-
         boolean eol = isEndOfLine(c);
         c = in.readAgain();
 
@@ -93,8 +86,12 @@ class CSVLexer extends Lexer {
                 }
             }
             
-            // ok, start of token reached: encapsulated, or token
-            if (isDelimiter(c)) {
+            // ok, start of token reached: comment, encapsulated, or token
+            if (isCommentStart(c)) { // TODO should only match at start of line
+                // ignore everything till end of line and continue (incr linecount)
+                in.readLine();
+                tkn.type = COMMENT;
+            } else if (isDelimiter(c)) {
                 // empty token return TOKEN("")
                 tkn.type = TOKEN;
             } else if (eol) {