From: Joe Marshall Date: Wed, 30 Dec 1987 21:43:43 +0000 (+0000) Subject: re_compile_fastmap X-Git-Tag: 20090517-FFI~12966 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=28be146f7c09da3e744ff65f689c361ade4a2150;p=mit-scheme.git re_compile_fastmap 1) regexpcode_exact_n grabbed wrong character (wrong index) 2) regexpcode_any_char fell into next case (no goto) RE_SEARCH_FORWARD_FAST Conditional backward RE_SEARCH_BACKWARD_FAST Conditional backward --- diff --git a/v7/src/microcode/regex.c b/v7/src/microcode/regex.c index 0a4405584..2ac010af8 100644 --- a/v7/src/microcode/regex.c +++ b/v7/src/microcode/regex.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/regex.c,v 1.5 1987/11/23 05:17:44 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/regex.c,v 1.6 1987/12/30 21:43:43 jrm Rel $ Copyright (c) 1987 Massachusetts Institute of Technology @@ -275,7 +275,7 @@ re_compile_fastmap (pattern_start, pattern_end, translation, syntax_table, READ_PATTERN_LENGTH (length); if (length == 0) goto loop; - (fastmap [(TRANSLATE_CHAR (pattern_pc [1]))]) = FASTMAP_TRUE; + (fastmap [(TRANSLATE_CHAR (pattern_pc [0]))]) = FASTMAP_TRUE; goto next; } @@ -287,6 +287,7 @@ re_compile_fastmap (pattern_start, pattern_end, translation, syntax_table, (fastmap [(TRANSLATE_CHAR (ascii))]) = FASTMAP_TRUE; if (return_value != 0) goto return_point; + goto next; } case regexpcode_char_set: @@ -1034,7 +1035,7 @@ int name (pattern_start, pattern_end, buffer, registers, \ if (match_pc >= (limit)) \ break; \ \ - if ((fastmap [(TRANSLATE_CHAR (*match_pc++))]) != FASTMAP_FALSE) \ + if ((fastmap [(TRANSLATE_CHAR (*match_pc++))]) == FASTMAP_FALSE) \ continue; \ \ match_result = (RE_SEARCH_TEST (match_pc - 1)); \ @@ -1084,7 +1085,7 @@ DEFINE_RE_SEARCH (re_search_forward) if (match_pc <= (limit)) \ break; \ \ - if ((fastmap [(TRANSLATE_CHAR (*--match_pc))]) != FASTMAP_FALSE) \ + if ((fastmap [(TRANSLATE_CHAR (*--match_pc))]) == FASTMAP_FALSE) \ continue; \ \ match_result = (RE_SEARCH_TEST (match_pc)); \