def parse_rule(rule):
    pos = 0
    end = len(rule)
    while pos < end:
        m = rule_pattern.match(rule, pos)
        if m is None: # pure static url
            break
        d = m.groupdict()
        _type = d['type']
        _variable = d['variable']
        if d['static'] or len(d['static']) > 0:
            yield None, None, d['static']
        yield _type, _variable, None
        pos = m.end()
    if pos < end:
        r = rule[pos:]
        yield None, None, r
dataset/ETHPy150Open jasonlvhit/lunar/lunar/router.py/parse_rule/operator `and` -> `or`