aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2000-03-23 04:36:34 +0000
committerStefan Monnier2000-03-23 04:36:34 +0000
commit990b2375ebeb985d6846eb538a72c3478f460bd4 (patch)
treec0b21b079d99f227f4f9c1c886430cce66cd7f22 /src
parent68049bfad7e77372e824e91832864cabc1111df0 (diff)
downloademacs-990b2375ebeb985d6846eb538a72c3478f460bd4.tar.gz
emacs-990b2375ebeb985d6846eb538a72c3478f460bd4.zip
(enum syntaxcode): Provide default for non-Emacs.
(re_compile_fastmap, re_match_2_internal): Undo Dave's previous fix.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/regex.c12
2 files changed, 9 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 33b82214e51..10fbfe0056a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12000-03-22 Stefan Monnier <monnier@cs.yale.edu>
2
3 * regex.c (enum syntaxcode): Provide default for non-Emacs.
4 (re_compile_fastmap, re_match_2_internal): Undo Dave's previous fix.
5
12000-03-22 Jason Rumney <jasonr@gnu.org> 62000-03-22 Jason Rumney <jasonr@gnu.org>
2 7
3 * w32menu.c (single_submenu): Set help string to NULL if none. 8 * w32menu.c (single_submenu): Set help string to NULL if none.
diff --git a/src/regex.c b/src/regex.c
index d1d18c36bd3..227a52b46e8 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -22,7 +22,6 @@
22/* TODO: 22/* TODO:
23 - detect nasty infinite loops like "\\(\\)+?ab" when matching "ac". 23 - detect nasty infinite loops like "\\(\\)+?ab" when matching "ac".
24 - use analyze_first to optimize non-empty loops 24 - use analyze_first to optimize non-empty loops
25 - reduce code duplication
26 - optimize succeed_n and jump_n away when possible 25 - optimize succeed_n and jump_n away when possible
27 - clean up multibyte issues 26 - clean up multibyte issues
28 - structure the opcode space into opcode+flag. 27 - structure the opcode space into opcode+flag.
@@ -133,11 +132,8 @@ char *realloc ();
133 132
134/* Define the syntax stuff for \<, \>, etc. */ 133/* Define the syntax stuff for \<, \>, etc. */
135 134
136/* This must be nonzero for the wordchar pattern 135/* Sword must be nonzero for the wordchar pattern commands in re_match_2. */
137 commands in re_match_2. */ 136enum syntaxcode { Swhitespace = 0, Sword = 1 };
138#ifndef Sword
139#define Sword 1
140#endif
141 137
142#ifdef SWITCH_ENUM_BUG 138#ifdef SWITCH_ENUM_BUG
143#define SWITCH_ENUM_CAST(x) ((int)(x)) 139#define SWITCH_ENUM_CAST(x) ((int)(x))
@@ -3462,7 +3458,7 @@ re_compile_fastmap (bufp)
3462 not = (re_opcode_t)p[-1] == notsyntaxspec; 3458 not = (re_opcode_t)p[-1] == notsyntaxspec;
3463 k = *p++; 3459 k = *p++;
3464 for (j = 0; j < (1 << BYTEWIDTH); j++) 3460 for (j = 0; j < (1 << BYTEWIDTH); j++)
3465 if ((SYNTAX (j) == (re_opcode_t) k) ^ not) 3461 if ((SYNTAX (j) == (enum syntaxcode) k) ^ not)
3466 fastmap[j] = 1; 3462 fastmap[j] = 1;
3467 break; 3463 break;
3468#else /* emacs */ 3464#else /* emacs */
@@ -5363,7 +5359,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
5363 looks like multibyte form. */ 5359 looks like multibyte form. */
5364 c = *d, len = 1; 5360 c = *d, len = 1;
5365 5361
5366 if ((SYNTAX (c) != (re_opcode_t) mcnt) ^ not) 5362 if ((SYNTAX (c) != (enum syntaxcode) mcnt) ^ not)
5367 goto fail; 5363 goto fail;
5368 d += len; 5364 d += len;
5369 } 5365 }