def toklist_print(toklist):
    """
    Helper function to print token lists with proper whitespace.
    """
    out = []
    for tok in toklist:
        if not tok:
            continue
        if tok.prev_white:
            out.append(" ")
        out.append(str(tok))
    return ''.join(out)