Commit ade0bc6e authored by Georg Brandl's avatar Georg Brandl

Fix unbound local error in RE tokenizer example. Thanks to Herman L. Jackson.

parent 2cebf80f
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment