Commit 73b1de83 authored by Guido van Rossum's avatar Guido van Rossum

Small bugfixes for broken old style use of the syntax table. AMK, of

course.
parent c7315511
...@@ -611,7 +611,7 @@ static void re_compile_fastmap_aux(code, ...@@ -611,7 +611,7 @@ static void re_compile_fastmap_aux(code,
{ {
syntaxcode = code[pos++]; syntaxcode = code[pos++];
for (a = 0; a < 256; a++) for (a = 0; a < 256; a++)
if (SYNTAX(a) == syntaxcode) if (SYNTAX(a) & syntaxcode)
fastmap[a] = 1; fastmap[a] = 1;
return; return;
} }
...@@ -619,7 +619,7 @@ static void re_compile_fastmap_aux(code, ...@@ -619,7 +619,7 @@ static void re_compile_fastmap_aux(code,
{ {
syntaxcode = code[pos++]; syntaxcode = code[pos++];
for (a = 0; a < 256; a++) for (a = 0; a < 256; a++)
if (SYNTAX(a) != syntaxcode) if (!(SYNTAX(a) & syntaxcode) )
fastmap[a] = 1; fastmap[a] = 1;
return; return;
} }
...@@ -1866,12 +1866,12 @@ int re_match(bufp, ...@@ -1866,12 +1866,12 @@ int re_match(bufp,
if (translate) if (translate)
{ {
while (text < textend && while (text < textend &&
translate[SYNTAX(*text)] == a) (SYNTAX(translate[*text]) & a) )
text++; text++;
} }
else else
{ {
while (text < textend && SYNTAX(*text) == a) while (text < textend && (SYNTAX(*text) & a) )
text++; text++;
} }
break; break;
...@@ -1882,12 +1882,12 @@ int re_match(bufp, ...@@ -1882,12 +1882,12 @@ int re_match(bufp,
if (translate) if (translate)
{ {
while (text < textend && while (text < textend &&
translate[SYNTAX(*text)] != a) !(SYNTAX(translate[*text]) & a) )
text++; text++;
} }
else else
{ {
while (text < textend && SYNTAX(*text) != a) while (text < textend && !(SYNTAX(*text) & a) )
text++; text++;
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment