diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2000-06-30 18:39:20 (GMT) |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2000-06-30 18:39:20 (GMT) |
commit | 4ccea94152599d7a80c01d5ebddb70f5abf3ce21 (patch) | |
tree | a60ad484768f718d6dddc89d311486a882f39205 /Lib | |
parent | 1739be50cb39627c8e6deca7c395854559ba655e (diff) | |
download | cpython-4ccea94152599d7a80c01d5ebddb70f5abf3ce21.zip cpython-4ccea94152599d7a80c01d5ebddb70f5abf3ce21.tar.gz cpython-4ccea94152599d7a80c01d5ebddb70f5abf3ce21.tar.bz2 |
- reverted to "\x is binary byte"
- removed evil tabs from sre_parse and sre_compile
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/sre_compile.py | 2 | ||||
-rw-r--r-- | Lib/sre_parse.py | 9 | ||||
-rw-r--r-- | Lib/test/output/test_sre | 1 |
3 files changed, 6 insertions, 6 deletions
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py index e48a7eb..6c7e588 100644 --- a/Lib/sre_compile.py +++ b/Lib/sre_compile.py @@ -39,7 +39,7 @@ def _compile(code, pattern, flags): return _sre.getlower(literal, flags) else: emit(OPCODES[op]) - fixup = lambda x: x + fixup = lambda x: x skip = len(code); emit(0) for op, av in av: emit(OPCODES[op]) diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index fb954e9..660bae6 100644 --- a/Lib/sre_parse.py +++ b/Lib/sre_parse.py @@ -19,8 +19,9 @@ from sre_constants import * # FIXME: should be 65535, but the arraymodule is still broken MAXREPEAT = 32767 -# FIXME: same here -CHARMASK = 0x7fff +# FIXME: might change in 2.0 final. but for now, this seems +# to be the best way to be compatible with 1.5.2 +CHARMASK = 0xff SPECIAL_CHARS = ".\\[{()*+?^$|" REPEAT_CHARS = "*+?{" @@ -616,9 +617,9 @@ def expand_template(template, match): a = p.append sep = match.string[:0] if type(sep) is type(""): - char = chr + char = chr else: - char = unichr + char = unichr for c, s in template: if c is LITERAL: a(char(s)) diff --git a/Lib/test/output/test_sre b/Lib/test/output/test_sre index 10de93d..3ba209d 100644 --- a/Lib/test/output/test_sre +++ b/Lib/test/output/test_sre @@ -1,5 +1,4 @@ test_sre -=== Failed incorrectly ('\\x00ffffffffffffff', '\377', 0, 'found', '\377') === Failed incorrectly ('^(.+)?B', 'AB', 0, 'g1', 'A') === Failed incorrectly ('(a+)+\\1', 'aa', 0, 'found+"-"+g1', 'aa-a') === grouping error ('([^/]*/)*sub1/', 'd:msgs/tdir/sub1/trial/away.cpp', 0, 'found+"-"+g1', 'd:msgs/tdir/sub1/-tdir/') 'd:msgs/tdir/sub1/-trial/' should be 'd:msgs/tdir/sub1/-tdir/' |