private boolean isWhiteSpace() { return isWhiteSpace((char)current); }
private boolean isWhiteSpace() { return isWhiteSpace((char)current); }
static boolean startsWithKeyword(String text) { int p; if (text.startsWith("true") || text.startsWith("null")) p=4; else if (text.startsWith("false")) p=5; else return false; while (p<text.length() && HjsonParser.isWhiteSpace(text.charAt(p))) p++; if (p==text.length()) return true; char ch=text.charAt(p); return ch==',' || ch=='}' || ch==']' || ch=='#' || ch=='/' && (text.length()>p+1 && (text.charAt(p+1)=='/' || text.charAt(p+1)=='*')); }
static boolean startsWithKeyword(String text) { int p; if (text.startsWith("true") || text.startsWith("null")) p=4; else if (text.startsWith("false")) p=5; else return false; while (p<text.length() && HjsonParser.isWhiteSpace(text.charAt(p))) p++; if (p==text.length()) return true; char ch=text.charAt(p); return ch==',' || ch=='}' || ch==']' || ch=='#' || ch=='/' && (text.length()>p+1 && (text.charAt(p+1)=='/' || text.charAt(p+1)=='*')); }
static String escapeName(String name) { boolean needsEscape=name.length()==0; for(char ch : name.toCharArray()) { if (HjsonParser.isWhiteSpace(ch) || ch=='{' || ch=='}' || ch=='[' || ch==']' || ch==',' || ch==':') { needsEscape=true; break; } } if (needsEscape) return "\""+JsonWriter.escapeString(name)+"\""; else return name; }
private void skipIndent(int indent) throws IOException { while (indent-->0) { if (isWhiteSpace(current) && current!='\n') read(); else break; } }
private void skipIndent(int indent) throws IOException { while (indent-->0) { if (isWhiteSpace(current) && current!='\n') read(); else break; } }
static String escapeName(String name) { boolean needsEscape=name.length()==0; for(char ch : name.toCharArray()) { if (HjsonParser.isWhiteSpace(ch) || ch=='{' || ch=='}' || ch=='[' || ch==']' || ch==',' || ch==':') { needsEscape=true; break; } } if (needsEscape) return "\""+JsonWriter.escapeString(name)+"\""; else return name; }
HjsonParser.isWhiteSpace(left) || HjsonParser.isWhiteSpace(right) || left=='"' || left=='\'' || for(char ch : valuec) { if (needsEscapeML(ch)) { noEscapeML=false; break; } else if (!HjsonParser.isWhiteSpace(ch)) allWhite=false;
while (idx<len && isWhiteSpace(value.charAt(idx))) idx++;
HjsonParser.isWhiteSpace(left) || HjsonParser.isWhiteSpace(right) || left=='"' || left=='\'' || for(char ch : valuec) { if (needsEscapeML(ch)) { noEscapeML=false; break; } else if (!HjsonParser.isWhiteSpace(ch)) allWhite=false;
while (idx<len && isWhiteSpace(value.charAt(idx))) idx++;
private String readName() throws IOException { if (current=='"' || current=='\'') return readStringInternal(false); StringBuilder name=new StringBuilder(); int space=-1, start=index; while (true) { if (current==':') { if (name.length()==0) throw error("Found ':' but no key name (for an empty key name use quotes)"); else if (space>=0 && space!=name.length()) { index=start+space; throw error("Found whitespace in your key name (use quotes to include)"); } return name.toString(); } else if (isWhiteSpace(current)) { if (space<0) space=name.length(); } else if (current<' ') { throw error("Name is not closed"); } else if (JsonValue.isPunctuatorChar(current)) { throw error("Found '" + (char)current + "' where a key name was expected (check your syntax or use quotes if the key name includes {}[],: or whitespace)"); } else name.append((char)current); read(); } }
private String readName() throws IOException { if (current=='"' || current=='\'') return readStringInternal(false); StringBuilder name=new StringBuilder(); int space=-1, start=index; while (true) { if (current==':') { if (name.length()==0) throw error("Found ':' but no key name (for an empty key name use quotes)"); else if (space>=0 && space!=name.length()) { index=start+space; throw error("Found whitespace in your key name (use quotes to include)"); } return name.toString(); } else if (isWhiteSpace(current)) { if (space<0) space=name.length(); } else if (current<' ') { throw error("Name is not closed"); } else if (JsonValue.isPunctuatorChar(current)) { throw error("Found '" + (char)current + "' where a key name was expected (check your syntax or use quotes if the key name includes {}[],: or whitespace)"); } else name.append((char)current); read(); } }
if (isWhiteSpace(current) && current!='\n') read(); else break;
if (isWhiteSpace(current) && current!='\n') read(); else break;
private void skipWhiteSpace() throws IOException { while (!isEndOfText()) { while (isWhiteSpace()) read(); if (current=='#' || current=='/' && peek()=='/') { do { read(); } while (current>=0 && current!='\n'); } else if (current=='/' && peek()=='*') { read(); do { read(); } while (current>=0 && !(current=='*' && peek()=='/')); read(); read(); } else break; } }
private void skipWhiteSpace() throws IOException { while (!isEndOfText()) { while (isWhiteSpace()) read(); if (current=='#' || current=='/' && peek()=='/') { do { read(); } while (current>=0 && current!='\n'); } else if (current=='/' && peek()=='*') { read(); do { read(); } while (current>=0 && !(current=='*' && peek()=='/')); read(); read(); } else break; } }