Skip to content

Commit 05b5c8e

Browse files
committed
Revert r1306321 - committed wrong file
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1306324 13f79535-47bb-0310-9956-ffa450edef68
1 parent 0fee01a commit 05b5c8e

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

src/main/java/org/apache/commons/csv/CSVLexer.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ Token nextToken(Token tkn) throws IOException {
4949
* is to call 'readAgain' on the stream...
5050
*/
5151
int c = in.read();
52-
53-
if ((lastChar == '\n' || lastChar == '\r' || lastChar == ExtendedBufferedReader.UNDEFINED) && isCommentStart(c)) {
54-
in.readLine();
55-
tkn.type = COMMENT;
56-
return tkn;
57-
}
58-
5952
boolean eol = isEndOfLine(c);
6053
c = in.readAgain();
6154

@@ -93,8 +86,12 @@ Token nextToken(Token tkn) throws IOException {
9386
}
9487
}
9588

96-
// ok, start of token reached: encapsulated, or token
97-
if (isDelimiter(c)) {
89+
// ok, start of token reached: comment, encapsulated, or token
90+
if (isCommentStart(c)) { // TODO should only match at start of line
91+
// ignore everything till end of line and continue (incr linecount)
92+
in.readLine();
93+
tkn.type = COMMENT;
94+
} else if (isDelimiter(c)) {
9895
// empty token return TOKEN("")
9996
tkn.type = TOKEN;
10097
} else if (eol) {

0 commit comments

Comments
 (0)