class LineNumberCheck {
public void visit(NodeTraversal t, Node n, Node parent) {
if (n.getType() == Token.SCRIPT) {
requiresLineNumbers = false;
} else if (requiresLineNumbers) {
if (n.getLineno() == -1) {
// The tree version of the node is really the best diagnostic
// info we have to offer here.
compiler.report(
t.makeError(n, MISSING_LINE_INFO,
n.toStringTree()));
}
}
}
}