function parse(selector, buf) {
    var parts = [selector.val]
      , str = new Parser(parts[0], parents, parts).parse().val
      , parents = [];

    if (buf.length) {
      for (var i = 0, len = buf.length; i < len; ++i) {
        parts.push(buf[i]);
        parents.push(str);
        var child = new Parser(buf[i], parents, parts).parse();

        if (child.nested) {
          str += ' ' + child.val;
        } else {
          str = child.val;
        }
      }
    }
    return str.trim();
  }
Compile selector strings in `arr` from the bottom-up
to produce the selector combinations. For example
the following Stylus:

   ul
     li
     p
       a
         color: red

Would return:

     [ 'ul li a', 'ul p a' ]

@param {Array} arr
@param {Boolean} leaveHidden
@return {Array}
@api private