function parseMediaList(string) {
  var result = [];
  var interimIndex = 0;
  var levelLocal = 0;

  // Check for a `url(...)` part (if it is contents of an @import rule)
  var doesHaveUrl = /^(\s*)url\s*\(/.exec(string);
  if (doesHaveUrl !== null) {
    var i = doesHaveUrl[0].length;
    var parenthesesLv = 1;
    while (parenthesesLv > 0) {
      var character = string[i];
      if (character === '(') {
        parenthesesLv++;
      }
      if (character === ')') {
        parenthesesLv--;
      }
      i++;
    }
    result.unshift(new _Node2.default({
      type: 'url',
      value: string.substring(0, i).trim(),
      sourceIndex: doesHaveUrl[1].length,
      before: doesHaveUrl[1],
      after: /^(\s*)/.exec(string.substring(i))[1]
    }));
    interimIndex = i;
  }

  // Start processing the media query list
  for (var _i2 = interimIndex; _i2 < string.length; _i2++) {
    var _character = string[_i2];

    // Dividing the media query list into comma-separated media queries
    // Only count commas that are outside of any parens
    // (i.e., not part of function call params list, etc.)
    if (_character === '(') {
      levelLocal++;
    }
    if (_character === ')') {
      levelLocal--;
    }
    if (levelLocal === 0 && _character === ',') {
      var _mediaQueryString = string.substring(interimIndex, _i2);
      var _spaceBefore = /^(\s*)/.exec(_mediaQueryString)[1];
      result.push(new _Container2.default({
        type: 'media-query',
        value: _mediaQueryString.trim(),
        sourceIndex: interimIndex + _spaceBefore.length,
        nodes: parseMediaQuery(_mediaQueryString, interimIndex),
        before: _spaceBefore,
        after: /(\s*)$/.exec(_mediaQueryString)[1]
      }));
      interimIndex = _i2 + 1;
    }
  }

  var mediaQueryString = string.substring(interimIndex);
  var spaceBefore = /^(\s*)/.exec(mediaQueryString)[1];
  result.push(new _Container2.default({
    type: 'media-query',
    value: mediaQueryString.trim(),
    sourceIndex: interimIndex + spaceBefore.length,
    nodes: parseMediaQuery(mediaQueryString, interimIndex),
    before: spaceBefore,
    after: /(\s*)$/.exec(mediaQueryString)[1]
  }));

  return result;
}
Parses a media query list. Takes a possible `url()` at the start into
account, and divides the list into media queries that are parsed separately

@param {string} string - the source media query list string

@return {Array} an array of Nodes/Containers