Search in sources :

Example 1 with DCTree

use of com.sun.tools.javac.tree.DCTree in project j2objc by google.

the class JavadocConverter method visitErroneous.

@Override
public Void visitErroneous(ErroneousTree node, TagElement tag) {
    if (reportWarnings) {
        // Update node's position to be relative to the whole source file, instead of just
        // the doc-comment's start. That way, the diagnostic printer will fetch the correct
        // text for the line the error is on.
        ((DCTree.DCErroneous) node).pos = ((DCTree) node).pos(docComment).getStartPosition();
        ErrorUtil.warning(node.getDiagnostic().toString());
    } else {
        // Include erroneous text in doc-comment as is.
        TreeNode newNode = setPos(node, new TextElement().setText(node.getBody()));
        tag.addFragment(newNode);
    }
    return null;
}
Also used : TextElement(com.google.devtools.j2objc.ast.TextElement) TreeNode(com.google.devtools.j2objc.ast.TreeNode) DCTree(com.sun.tools.javac.tree.DCTree)

Aggregations

TextElement (com.google.devtools.j2objc.ast.TextElement)1 TreeNode (com.google.devtools.j2objc.ast.TreeNode)1 DCTree (com.sun.tools.javac.tree.DCTree)1