|
|
@ -100,8 +100,7 @@ public class JSONTokener {
|
|
|
|
case '[':
|
|
|
|
case '[':
|
|
|
|
return readArray();
|
|
|
|
return readArray();
|
|
|
|
|
|
|
|
|
|
|
|
case '\'':
|
|
|
|
case '\'', '"':
|
|
|
|
case '"':
|
|
|
|
|
|
|
|
return nextString((char) c);
|
|
|
|
return nextString((char) c);
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@ -114,10 +113,7 @@ public class JSONTokener {
|
|
|
|
while (this.pos < this.in.length()) {
|
|
|
|
while (this.pos < this.in.length()) {
|
|
|
|
int c = this.in.charAt(this.pos++);
|
|
|
|
int c = this.in.charAt(this.pos++);
|
|
|
|
switch (c) {
|
|
|
|
switch (c) {
|
|
|
|
case '\t':
|
|
|
|
case '\t', ' ', '\n', '\r':
|
|
|
|
case ' ':
|
|
|
|
|
|
|
|
case '\n':
|
|
|
|
|
|
|
|
case '\r':
|
|
|
|
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
case '/':
|
|
|
|
case '/':
|
|
|
@ -262,9 +258,7 @@ public class JSONTokener {
|
|
|
|
case 'f':
|
|
|
|
case 'f':
|
|
|
|
return '\f';
|
|
|
|
return '\f';
|
|
|
|
|
|
|
|
|
|
|
|
case '\'':
|
|
|
|
case '\'', '"', '\\':
|
|
|
|
case '"':
|
|
|
|
|
|
|
|
case '\\':
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return escaped;
|
|
|
|
return escaped;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -398,8 +392,7 @@ public class JSONTokener {
|
|
|
|
switch (nextCleanInternal()) {
|
|
|
|
switch (nextCleanInternal()) {
|
|
|
|
case '}':
|
|
|
|
case '}':
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
case ';':
|
|
|
|
case ';', ',':
|
|
|
|
case ',':
|
|
|
|
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
throw syntaxError("Unterminated object");
|
|
|
|
throw syntaxError("Unterminated object");
|
|
|
@ -429,8 +422,7 @@ public class JSONTokener {
|
|
|
|
result.put(null);
|
|
|
|
result.put(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
case ',':
|
|
|
|
case ',', ';':
|
|
|
|
case ';':
|
|
|
|
|
|
|
|
/* A separator without a value first means "null". */
|
|
|
|
/* A separator without a value first means "null". */
|
|
|
|
result.put(null);
|
|
|
|
result.put(null);
|
|
|
|
hasTrailingSeparator = true;
|
|
|
|
hasTrailingSeparator = true;
|
|
|
@ -444,8 +436,7 @@ public class JSONTokener {
|
|
|
|
switch (nextCleanInternal()) {
|
|
|
|
switch (nextCleanInternal()) {
|
|
|
|
case ']':
|
|
|
|
case ']':
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
case ',':
|
|
|
|
case ',', ';':
|
|
|
|
case ';':
|
|
|
|
|
|
|
|
hasTrailingSeparator = true;
|
|
|
|
hasTrailingSeparator = true;
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|