Fix ambiguous pattern parsing in case of subpattern equivalence