selectors method

List<Selector> selectors ()

Implementation

List<Selector> selectors() {
  Selector s;
  List<Selector> selectors;

  while (true) {
    s = selector();
    if (s == null) break;

    // --polymer-mixin: {}
    // No standard js implementation
    if (parserInput.peekChar(':') && s.elements.length == 1) {
      if (s.elements[0].value is String &&
          s.elements[0].value.startsWith('--')) {
        s.elements[0].value = '${s.elements[0].value}:';
        parserInput.$char(':'); //move pointer
      }
    }
    // End no standard

    (selectors ??= <Selector>[]).add(s);

    parserInput.commentStore.length = 0;
    if (s.condition != null && selectors.length > 1) {
      parserInput
          .error('Guards are only currently allowed on a single selector.');
    }
    if (parserInput.$char(',') == null) break;
    if (s.condition != null) {
      parserInput
          .error('Guards are only currently allowed on a single selector.');
    }
    parserInput.commentStore.length = 0;
  }
  return selectors;

// 3.5.0.beta 20180625
//  selectors: function () {
//      var s, selectors;
//      while (true) {
//          s = this.selector();
//          if (!s) {
//              break;
//          }
//          if (selectors) {
//              selectors.push(s);
//          } else {
//              selectors = [ s ];
//          }
//          parserInput.commentStore.length = 0;
//          if (s.condition && selectors.length > 1) {
//              error("Guards are only currently allowed on a single selector.");
//          }
//          if (!parserInput.$char(',')) { break; }
//          if (s.condition) {
//              error("Guards are only currently allowed on a single selector.");
//          }
//          parserInput.commentStore.length = 0;
//      }
//      return selectors;
//  },
}