This commit is contained in:
ggregory 2016-02-24 22:11:59 -08:00
parent bcc7c0c858
commit f3a7cf629c
1 changed files with 6 additions and 7 deletions

View File

@ -232,13 +232,12 @@ private StrategyAndWidth literal() {
boolean activeQuote = false;
StringBuilder sb = new StringBuilder();
while( currentIdx<pattern.length() ) {
char c= pattern.charAt(currentIdx);
if( !activeQuote && isFormatLetter( c ) ) {
while (currentIdx < pattern.length()) {
char c = pattern.charAt(currentIdx);
if (!activeQuote && isFormatLetter(c)) {
break;
}
else if( c=='\'' ) {
if(++currentIdx==pattern.length() || pattern.charAt(currentIdx)!='\'') {
} else if (c == '\'') {
if (++currentIdx == pattern.length() || pattern.charAt(currentIdx) != '\'') {
activeQuote = !activeQuote;
continue;
}
@ -247,7 +246,7 @@ else if( c=='\'' ) {
sb.append(c);
}
if(activeQuote) {
if (activeQuote) {
throw new IllegalArgumentException("Unterminated quote");
}