matches method

bool matches(
  1. XPathExpression other
)

Like ==, but a named step also matches a wildcard (*) step.

Reflexive and symmetric but not transitive. Port of XPathPathExpr.matches.

Implementation

bool matches(XPathExpression other) {
  if (other is! XPathPathExpr ||
      start != other.start ||
      steps.length != other.steps.length) {
    return false;
  }
  for (var i = 0; i < steps.length; i++) {
    if (!steps[i].matches(other.steps[i])) return false;
  }
  return start != PathStart.expression || filterExpr == other.filterExpr;
}