def __default__(self, data, children, meta):
    if (not getattr(meta, 'match_tree', False)):
        return Tree(data, children)
    iter_args = iter(children)
    to_write = []
    for sym in meta.orig_expansion:
        if is_discarded_terminal(sym):
            t = self.tokens[sym.name]
            if (not isinstance(t.pattern, PatternStr)):
                raise NotImplementedError(('Reconstructing regexps not supported yet: %s' % t))
            to_write.append(t.pattern.value)
        else:
            x = next(iter_args)
            if isinstance(x, list):
                to_write += x
            else:
                if isinstance(x, Token):
                    assert (Terminal(x.type) == sym), x
                else:
                    assert (NonTerminal(x.data) == sym), (sym, x)
                to_write.append(x)
    assert is_iter_empty(iter_args)
    return to_write
def __default__(self, data, children, meta):
    if (not getattr(meta, 'match_tree', False)):
        return Tree(data, children)
    iter_args = iter(children)
    to_write = []
    for sym in meta.orig_expansion:
        if is_discarded_terminal(sym):
            t = self.tokens[sym.name]
            if (not isinstance(t.pattern, PatternStr)):
                raise NotImplementedError(('Reconstructing regexps not supported yet: %s' % t))
            to_write.append(t.pattern.value)
        else:
            x = next(iter_args)
            if isinstance(x, list):
                to_write += x
            else:
                if isinstance(x, Token):
                    assert (Terminal(x.type) == sym), x
                else:
                    assert (NonTerminal(x.data) == sym), (sym, x)
                to_write.append(x)
    assert is_iter_empty(iter_args)
    return to_write