use of org.parboiled.errors.ParserRuntimeException in project markdown-doclet by Abnaxos.
the class MarkdownDoclet method defaultProcess.
/**
* Default processing of any documentation node.
*
* @param doc The documentation.
* @param fixLeadingSpaces `true` if leading spaces should be fixed.
*
* @see Options#toHtml(String, boolean)
*/
protected void defaultProcess(Doc doc, boolean fixLeadingSpaces) {
try {
StringBuilder buf = new StringBuilder();
buf.append(getOptions().toHtml(doc.commentText(), fixLeadingSpaces));
buf.append('\n');
for (Tag tag : doc.tags()) {
processTag(tag, buf);
buf.append('\n');
}
doc.setRawCommentText(buf.toString());
} catch (final ParserRuntimeException e) {
if (doc instanceof RootDoc) {
printError(new SourcePosition() {
@Override
public File file() {
return options.getOverviewFile();
}
@Override
public int line() {
return 0;
}
@Override
public int column() {
return 0;
}
}, e.getMessage());
} else {
printError(doc.position(), e.getMessage());
}
}
}
Aggregations