* @return TextNode
* @throws java.io.IOException .
*/
private TextNode textNode() throws IOException {
StringBuilder builder = new StringBuilder();
TextNode node = new TextNode();
node.setBeginLine(currentToken.getLineNo());
node.setBeginColumn(currentToken.getColumn());
while (true) {
builder.append(currentToken.getValue());
TokenType type = peek(1).getType();
if (type == TokenType.CDATA
|| type == TokenType.DOC_TYPE || type == TokenType.EOL
|| type == TokenType.STRING || type == TokenType.WS) {
nextToken();
} else {
node.setEndLine(peek(1).getLineNo());
node.setEndColumn(peek(1).getColumn());
break;
}
}
node.setContents(builder.toString());
return node;
}