Exemplo n.º 1
0
  public boolean match(MatcherContext context) {
    int lastIndex = context.getCurrentIndex();
    Object valueStackSnapshot = context.getValueStack().takeSnapshot();

    if (!subMatcher.getSubContext(context).runMatcher()) return false;

    // reset location, Test matchers never advance
    context.setCurrentIndex(lastIndex);

    // erase all value stack changes the the submatcher could have made
    context.getValueStack().restoreSnapshot(valueStackSnapshot);
    return true;
  }