String (char quote) { // Like nextNonWhitespace, this uses locals 'p' and 'l' to save inner-loop field access. CharSequence in = this.sourceSequence; int p = position; int l = limit; // the index of the first character not yet appended to the builder int start = p; StringBuilder builder = null; while (p < l) { char c = in.charAt(p++); if (c == quote) { position = p; if (builder == null) { return in.subSequence(start, p - 1).toString(); } else { return builder.append(in, start, p - 1).toString(); } } else if (c == '\\') { position = p; if (builder == null) { if (this.builder == null) { this.builder = new StringBuilder((p - start) + 16); } else { this.builder.setLength(0); } builder = this.builder; } builder.append(in, start, p - 1); builder.append(readEscapeCharacter()); p = position; l = limit; start = p; } //else if (c == '\n') { // //lineNumber++; // //lineStart = p; //} } position = p; throw createParseError("Unterminated string"); }