

def phys_tokens(toks):
    "Return all physical tokens, even line continuations.\n\n    tokenize.generate_tokens() doesn't return a token for the backslash that\n    continues lines.  This wrapper provides those tokens so that we can\n    re-create a faithful representation of the original source.\n\n    Returns the same values as generate_tokens()\n\n    "
    last_line = None
    last_lineno = (- 1)
    last_ttype = None
    for (ttype, ttext, (slineno, scol), (elineno, ecol), ltext) in toks:
        if (last_lineno != elineno):
            if (last_line and last_line.endswith('\\\n')):
                inject_backslash = True
                if (last_ttype == tokenize.COMMENT):
                    inject_backslash = False
                elif (ttype == token.STRING):
                    if (('\n' in ttext) and (ttext.split('\n', 1)[0][(- 1)] == '\\')):
                        inject_backslash = False
                if inject_backslash:
                    ccol = (len(last_line.split('\n')[(- 2)]) - 1)
                    (yield (99999, '\\\n', (slineno, ccol), (slineno, (ccol + 2)), last_line))
            last_line = ltext
            last_ttype = ttype
        (yield (ttype, ttext, (slineno, scol), (elineno, ecol), ltext))
        last_lineno = elineno

dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/coverage/phystokens.py phys_tokens/original