Extract check for metaChar

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1479706 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2013-05-06 22:38:23 +00:00
parent 883511fa42
commit 4f61bd1aee
1 changed files with 9 additions and 1 deletions

View File

@ -108,7 +108,7 @@ abstract class Lexer {
throw new IOException("EOF whilst processing escape sequence");
default:
// Now check for meta-characters
if (isDelimiter(c) || isEscape(c) || isQuoteChar(c) || isCommentStart(c)) {
if (isMetaChar(c)) {
return c;
}
// indicate unexpected char - available from in.getLastChar()
@ -181,4 +181,12 @@ abstract class Lexer {
boolean isCommentStart(final int c) {
return c == commmentStart;
}
private boolean isMetaChar(final int c) {
return c == delimiter
|| c == escape
|| c == quoteChar
|| c == commmentStart
;
}
}