unify method

SelectorList? unify(
  1. SelectorList other
)

Returns a SelectorList that matches only elements that are matched by both this and other.

If no such list can be produced, returns null.

Implementation

SelectorList? unify(SelectorList other) {
  var contents = [
    for (var complex1 in components)
      for (var complex2 in other.components)
        ...?unifyComplex([complex1, complex2], complex1.span)
  ];

  return contents.isEmpty ? null : SelectorList(contents, span);
}