private char peekChar() { return peekChar(0); }
private boolean peekHexDigit() { return Character.digit(peekChar(), 0x10) >= 0; }
private boolean peekWhitespace() { return isWhitespace(peekChar()); }
private boolean peekWhitespace() { return isWhitespace(peekChar()); }
private void skipBinaryDigits() { while (isBinaryDigit(peekChar())) { nextChar(); } }
private void skipOctalDigits() { while (isOctalDigit(peekChar())) { nextChar(); } }
private void skipDecimalDigits() { while (isDecimalDigit(peekChar())) { nextChar(); } }
private void skipBinaryDigits() { while (isBinaryDigit(peekChar())) { nextChar(); } }
private void skipDecimalDigits() { while (isDecimalDigit(peekChar())) { nextChar(); } }
private boolean skipRegularExpressionChar() { switch (peekChar()) { case '\\': return skipRegularExpressionBackslashSequence(); case '[': return skipRegularExpressionClass(); default: nextChar(); return true; } }
private boolean skipRegularExpressionChar() { switch (peekChar()) { case '\\': return skipRegularExpressionBackslashSequence(); case '[': return skipRegularExpressionClass(); default: nextChar(); return true; } }
private boolean skipRegularExpressionBody() { if (!isRegularExpressionFirstChar(peekChar())) { reportError("Expected regular expression first char"); return false; } if (!skipRegularExpressionChar()) { return false; } while (!isAtEnd() && isRegularExpressionChar(peekChar())) { if (!skipRegularExpressionChar()) { return false; } } return true; }
private boolean skipRegularExpressionBackslashSequence() { nextChar(); if (isLineTerminator(peekChar())) { reportError("New line not allowed in regular expression literal"); return false; } nextChar(); return true; }
private void skipSingleLineComment(Comment.Type type) { int startOffset = index; while (!isAtEnd() && !isLineTerminator(peekChar())) { nextChar(); } SourceRange range = getLineNumberTable().getSourceRange(startOffset, index); String value = this.contents.substring(startOffset, index); recordComment(type, range, value); }
private boolean skipRegularExpressionBackslashSequence() { // TODO(tbreisacher): Warn if this is an unnecessary escape, like we do for string literals. nextChar(); if (isLineTerminator(peekChar())) { reportError("New line not allowed in regular expression literal"); return false; } nextChar(); return true; }
private void skipSingleLineComment(Comment.Type type) { int startOffset = index; while (!isAtEnd() && !isLineTerminator(peekChar())) { nextChar(); } SourceRange range = getLineNumberTable().getSourceRange(startOffset, index); String value = this.source.contents.substring(startOffset, index); recordComment(type, range, value); }
private boolean skipRegularExpressionClass() { nextChar(); while (!isAtEnd() && peekRegularExpressionClassChar()) { if (!skipRegularExpressionClassChar()) { return false; } } if (peekChar() != ']') { reportError("']' expected"); return false; } nextChar(); return true; }