# 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 = "*+?{"
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))
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/'