]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
- reverted to "\x is binary byte"
authorFredrik Lundh <fredrik@pythonware.com>
Fri, 30 Jun 2000 18:39:20 +0000 (18:39 +0000)
committerFredrik Lundh <fredrik@pythonware.com>
Fri, 30 Jun 2000 18:39:20 +0000 (18:39 +0000)
- removed evil tabs from sre_parse and sre_compile

Lib/sre_compile.py
Lib/sre_parse.py
Lib/test/output/test_sre

index e48a7eb9901dea43845b56e7b5037d263df1b1b1..6c7e5883bb7e868b803187a244f385e159cf8652 100644 (file)
@@ -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])
index fb954e994c6e28576ea878c522abde3f2c72ce9a..660bae684138509582b67741eccc3a991f79c756 100644 (file)
@@ -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))
index 10de93dd2051a82304491b0f90daec9cdd217445..3ba209d329e17b76efddd2564d0ed9f2c058801d 100644 (file)
@@ -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/'