anchor.diff:    /// extensions.
     final _extensions = <SimpleSelector, Set<ExtendSource>>{};
   
  -  /// An expando from [SimpleSelector]s to [ComplexSelector]s.
  -  ///
  -  /// This tracks the [ComplexSelector]s that originally contained each
  -  /// [SimpleSelector]. This allows us to ensure that we don't trim any
  -  /// selectors that need to exist to satisfy the [second law of extend][].
  +  /// An expando from [SimpleSelector]s to integers.
  +  ///
  +  /// This tracks the maximum specificity of the [ComplexSelector] that
  +  /// originally contained each [SimpleSelector]. This allows us to ensure that
  +  /// we don't trim any selectors that need to exist to satisfy the [second law
  +  /// of extend][].
     ///
     /// [second law of extend]: https://github.com/sass/sass/issues/324#issuecomment-4607184
  -  final _sources = new Expando<ComplexSelector>();
  +  final _sourceSpecificity = new Expando<int>();
   
     /// Extends [selector] with [source] extender and [target] the extendee.
     ///
  
positive.code:       for (var component in complex.components) {
          if (component is CompoundSelector) {
            for (var simple in component.components) {
              _sources[simple] = complex;
            }
          }
        }
  
negative.code:         for (var component in complex1.components) {
            if (component is CompoundSelector) {
              for (var simple in component.components) {
                maxSpecificity =
                    math.max(maxSpecificity, _sourceSpecificity[simple] ?? 0);
              }
            }
          }
  