'Walk backwards skipping (name, comma) pairs.
If lim is given and is positive stop once we reach 0, to avoid spending
too much time here'

def _get_token_before_namelist(self, pos, accessor, styleClassifier, lim=(-1)):

    while True:
        (prev_start_pos, prev_end_pos) = self._get_prev_token_skip_ws(pos, accessor, styleClassifier)
        if ((prev_start_pos == 0) or (not styleClassifier.is_ruby_style_at_pos(prev_start_pos))):
            return (0, 0)
        prev_style = accessor.style_at_pos(prev_start_pos)
        if (not styleClassifier.is_identifier_or_word_style(prev_style)):
            return (0, 0)
        (prev_start_pos, prev_end_pos) = self._get_prev_token_skip_ws(prev_start_pos, accessor, styleClassifier)
        if ((prev_start_pos == 0) or (not styleClassifier.is_ruby_style_at_pos(prev_start_pos))):
            return (0, 0)
        elif (not styleClassifier.is_operator_style(prev_style)):
            return (0, 0)
        op = accessor.text_range(prev_start_pos, prev_end_pos)
        if (op != ','):
            return (prev_start_pos, prev_end_pos)
        lim -= 1
        if (lim == 0):
            return (0, 0)
