Matches an AST node which is enclosed by a block node that matches the given matcher.
971292
public static <T extends Tree> Enclosing.Block<T> enclosingBlock(Matcher<BlockTree> matcher) {
    return new Enclosing.Block<>(matcher);
  }
1339156
function Matcher (patternFn, successFn, next) {
    this.patternFn = patternFn;
    this.successFn = successFn;
    this.next = next;
  }
682957
private static Matcher<UnaryTree> expressionFromUnaryTree(
      final Matcher<ExpressionTree> exprMatcher) {
    return new Matcher<UnaryTree>() {
      @Override
      public boolean matches(UnaryTree tree, VisitorState state) {
        return exprMatcher.matches(tree.getExpression(), state);
      }
    };
  }
46416
def match(self, node):
        
        """
        if node.type == self.syms.term:
            div_idx = find_division(node)
            if div_idx is not False:
                # if expr1 or expr2 are obviously floats, we don't need to wrap in
                # old_div, as the behavior of division between any number and a float
                # should be the same in 2 or 3
                if not is_floaty(node, div_idx):
                    return clone_div_operands(node, div_idx)
        return False
984519
public IEdge connect(INode source, INode target, VFBondMatcher matcher) {
        NodeBuilder sourceImpl = (NodeBuilder) source;
        NodeBuilder targetImpl = (NodeBuilder) target;
        EdgeBuilder edge = new EdgeBuilder(sourceImpl, targetImpl, matcher);

        sourceImpl.addNeighbor(targetImpl);
        targetImpl.addNeighbor(sourceImpl);

        sourceImpl.addEdge(edge);
        targetImpl.addEdge(edge);

        edgesList.add(edge);
        return edge;
    }
834094
function DoubleMatcherIterator(node, match) {
  this.n = node;
  this.m = match;
  this.p = match.length;
  this.c = node._map['**'];
}
691565
def around *matchers, &proc
      proc || raise(ArgumentError, 'block is missing')
      matchers.flatten!
      matchers = [:*] if matchers.empty?
      return if around?.find {|x| x[0] == matchers && x[1].source_location == proc.source_location}
      around?.push([matchers, proc])
    end
862693
private boolean matchLemmaList(AnalyzedTokenReadings aToken,
      List<String> list) {
    boolean matches = false;
    for (AnalyzedToken analyzedToken : aToken) {
      if (list.contains(analyzedToken.getLemma())) {
          matches = true;
          break;
      }
    }
    return matches;
  }
187511
function matchesTag(node, exp) {
	return (
		node.nodeType === 1 &&
		(exp.tag === '*' || node.nodeName.toLowerCase() === exp.tag)
	);
}
1229594
public static <T extends Tree> Matcher<T> not(final Matcher<T> matcher) {
    return new Matcher<T>() {
      @Override
      public boolean matches(T t, VisitorState state) {
        return !matcher.matches(t, state);
      }
    };
  }
357018
function match(node, type) {
            let innerStatementNode = node;

            while (innerStatementNode.type === "LabeledStatement") {
                innerStatementNode = innerStatementNode.body;
            }
            if (Array.isArray(type)) {
                return type.some(match.bind(null, innerStatementNode));
            }
            return StatementTypes[type].test(innerStatementNode, sourceCode);
        }
590670
@Override
    public MatchType match(int level, Node node) {
        if(! (node instanceof Element)) {
            return MatchType.NOT_A_MATCH;
        }
        Element element = (Element) node;
        if(this.level != level) {
            return MatchType.NOT_A_MATCH;
        } else if(element.getName().equals(elementName) && element.hasAttribute(attributeName)
                && element.attributeValue(attributeName).equals(attributeValue)) {
            return MatchType.NODE_MATCH;
        }
        return MatchType.NOT_A_MATCH;
    }
627177
public static Matcher assignmentWithRhs(final Matcher rhsMatcher) {
    return new Matcher() {
      @Override public boolean matches(Node node, NodeMetadata metadata) {
        return node.isAssign() && rhsMatcher.matches(node.getLastChild(), metadata);
      }
    };
  }
45620
public static <S> Matcher<S> is(Matcher<S> matcher) {
        return Matchers.is(matcher);
    }
789697
def _findMatchingBracket(self, bracket, qpart, block, columnIndex):
        
        if bracket in self._START_BRACKETS:
            charsGenerator = self._iterateDocumentCharsForward(block, columnIndex + 1)
        else:
            charsGenerator = self._iterateDocumentCharsBackward(block, columnIndex)

        depth = 1
        oposite = self._OPOSITE_BRACKET[bracket]
        for block, columnIndex, char in charsGenerator:
            if qpart.isCode(block, columnIndex):
                if char == oposite:
                    depth -= 1
                    if depth == 0:
                        return block, columnIndex
                elif char == bracket:
                    depth += 1
        else:
            return None, None
400405
function matchClosing(input, tagname, html) {
  var closeTag = '</' + tagname + '>',
      openTag  = new RegExp('< *' + tagname + '( *|>)', 'g'),
      closeCount = 0,
      openCount = -1,
      from, to, chunk
      ;

  from = html.search(input);
  to = from;

  while(to > -1 && closeCount !== openCount) {
    to = html.indexOf(closeTag, to);
    if (to > -1) {
      to += tagname.length + 3;
      closeCount ++;
      chunk = html.slice(from, to);
      openCount = chunk.match(openTag).length;
    }
  }
  if (to === -1) {
    throw new Error('Unmatched tag ' + tagname + ' in ' + html)
  }

  return chunk;
}
291627
public static Matcher<Tree> parentNode(Matcher<? extends Tree> treeMatcher) {
    @SuppressWarnings("unchecked") // Safe contravariant cast
    Matcher<Tree> matcher = (Matcher<Tree>) treeMatcher;
    return new ParentNode(matcher);
  }