summaryrefslogtreecommitdiffstats
path: root/Lib/dos-8x3/sre_pars.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-10-09 22:14:43 (GMT)
committerGuido van Rossum <guido@python.org>2000-10-09 22:14:43 (GMT)
commite8d2f5589bdbe8988c97b2f8bb265f1aca2b4193 (patch)
tree8b8ae34d003bfe1c40c79f7676a698c1d7823005 /Lib/dos-8x3/sre_pars.py
parenteebb1c6cd1a1fe895305ca0f88ec949df9708773 (diff)
downloadcpython-e8d2f5589bdbe8988c97b2f8bb265f1aca2b4193.zip
cpython-e8d2f5589bdbe8988c97b2f8bb265f1aca2b4193.tar.gz
cpython-e8d2f5589bdbe8988c97b2f8bb265f1aca2b4193.tar.bz2
The usual.
Diffstat (limited to 'Lib/dos-8x3/sre_pars.py')
-rw-r--r--Lib/dos-8x3/sre_pars.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/dos-8x3/sre_pars.py b/Lib/dos-8x3/sre_pars.py
index f4741c9..7c36d4f 100644
--- a/Lib/dos-8x3/sre_pars.py
+++ b/Lib/dos-8x3/sre_pars.py
@@ -12,8 +12,6 @@ import string, sys
from sre_constants import *
-MAXREPEAT = 65535
-
SPECIAL_CHARS = ".\\[{()*+?^$|"
REPEAT_CHARS = "*+?{"
@@ -393,6 +391,8 @@ def _parse(source, state):
# potential range
this = source.get()
if this == "]":
+ if code1[0] is IN:
+ code1 = code1[1][0]
set.append(code1)
set.append((LITERAL, ord("-")))
break
@@ -593,6 +593,11 @@ def parse(str, flags=0, pattern=None):
# p.dump()
+ if not (flags & SRE_FLAG_VERBOSE) and p.pattern.flags & SRE_FLAG_VERBOSE:
+ # the VERBOSE flag was switched on inside the pattern. to be
+ # on the safe side, we'll parse the whole thing again...
+ return parse(str, p.pattern.flags)
+
return p
def parse_template(source, pattern):