]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Possible fix for Skip's bug 116136 (sre recursion limit hit in tokenize.py).
authorTim Peters <tim.peters@gmail.com>
Sat, 7 Oct 2000 05:09:39 +0000 (05:09 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 7 Oct 2000 05:09:39 +0000 (05:09 +0000)
commitde49583a0d59f806b88b0f6a869f470047b3cbce
treeeb9b53a60d7e3425a7266ced49a421ff2bcebd68
parent70d87d73291ca6263955c57842c07e98be768352
Possible fix for Skip's bug 116136 (sre recursion limit hit in tokenize.py).
tokenize.py has always used naive regexps for matching string literals,
and that appears to trigger the sre recursion limit on Skip's platform (he
has very long single-line string literals).  Replaced all of tokenize.py's
string regexps with the "unrolled" forms used in IDLE, where they're known to
handle even absurd (multi-megabyte!) string literals without trouble.  See
Friedl's book for explanation (at heart, the naive regexps create a backtracking
choice point for each character in the literal, while the unrolled forms create
none).
Lib/tokenize.py