searchWithin method

AstNode searchWithin (
  1. AstNode node
)

Search within the given AST node and return the node that was found, or null if no node was found.

Implementation

AstNode searchWithin(AstNode node) {
  if (node == null) {
    return null;
  }
  try {
    node.accept(this);
  } catch (exception, stackTrace) {
    // TODO(39284): should this exception be silent?
    AnalysisEngine.instance.instrumentationService.logException(
        SilentException(
            "Unable to locate element at offset ($_startOffset - $_endOffset)",
            exception,
            stackTrace));
    return null;
  }
  return _foundNode;
}