'selector : simple_selector [ combinator selector
| S [ combinator? selector ]?
simple_selector : element_name [HASH | class | attrib | pseudo ]*
| [HASH | class | attrib | pseudo ]+;
Instead, here we\'ll loop through selectors, allowing
combinators if we find them.
Note that error-recovery takes place here, not at the top-level.'

def _parse_selector(self, resolve_selector_property_ambiguity=False):

    require_simple_selector = True
    while True:
        res = self._parse_simple_selector(require_simple_selector, resolve_selector_property_ambiguity)
        if (not res):
            break
        if (resolve_selector_property_ambiguity and (not require_simple_selector)):
            self._saw_selector = True
        require_simple_selector = False
        tok = self._tokenizer.get_next_token()
        if (tok['style'] == EOF_STYLE):
            break
        self._check_tag_tok(tok, 2)
        if (not self._classifier.is_operator_choose(tok, ('+', '>', '~'))):
            self._tokenizer.put_back(tok)
        else:
            require_simple_selector = True
