In ASTMatcher, when we have has(...) and hasParent(...) called with the same internal matcher on the same node, the memoization process will mix-up the two calls because the direction of the traversal is not part of the memoization key.
This patch adds this information.
Nice find! Why don't we need more states though?