@staticmethod
def expand_hintmask(program):
    """Expands collapsed hintmask tokens into two tokens"""
    piter = iter(enumerate(program))
    for i, tok in piter:
        if isinstance(tok, tuple):
            assert tok[0] in ('hintmask', 'cntrmask')
            program[i:i + 1] = tok
