if (!node.hasError()) {
return getRawNodeText(node, inputBuffer);
}
// if the node has a parse error we cannot simpy cut a string out of the underlying input buffer, since we
// would also include illegal characters, so we need to build it bottom up
if (node.getMatcher().accept(new IsSingleCharMatcherVisitor())) {
return String.valueOf(inputBuffer.charAt(node.getStartIndex()));
} else {
StringBuilder sb = new StringBuilder();
int index = node.getStartIndex();
for (Node<?> child : node.getChildren()) {