mirror of https://github.com/python/cpython
Fix unbound local error in RE tokenizer example. Thanks to Herman L. Jackson.
This commit is contained in:
parent
cc5ea6860f
commit
325477e20e
|
@ -1322,9 +1322,10 @@ successive matches::
|
|||
line_start = pos
|
||||
line += 1
|
||||
elif typ != 'SKIP':
|
||||
val = mo.group(typ)
|
||||
if typ == 'ID' and val in keywords:
|
||||
typ = val
|
||||
yield Token(typ, mo.group(typ), line, mo.start()-line_start)
|
||||
yield Token(typ, val, line, mo.start()-line_start)
|
||||
pos = mo.end()
|
||||
mo = gettok(s, pos)
|
||||
if pos != len(s):
|
||||
|
|
Loading…
Reference in New Issue