Mercurial > emacs
comparison src/regex.c @ 23846:e2e16f655cff
(re_compile_fastmap): For anychar, set all fastmap
elements for all possible unibyte chars (except newline).
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 10 Dec 1998 03:09:12 +0000 |
parents | 40072cd9d21c |
children | 11c5dd0a7bd7 |
comparison
equal
deleted
inserted
replaced
23845:b3d94db9bc57 | 23846:e2e16f655cff |
---|---|
3379 | 3379 |
3380 case anychar: | 3380 case anychar: |
3381 { | 3381 { |
3382 int fastmap_newline = fastmap['\n']; | 3382 int fastmap_newline = fastmap['\n']; |
3383 | 3383 |
3384 /* `.' matches anything (but if bufp->multibyte is | 3384 /* `.' matches anything, except perhaps newline. |
3385 nonzero, matches `\000' .. `\127' and possible multibyte | 3385 Even in a multibyte buffer, it should match any |
3386 character) ... */ | 3386 conceivable byte value for the fastmap. */ |
3387 if (bufp->multibyte) | 3387 if (bufp->multibyte) |
3388 { | 3388 match_any_multibyte_characters = true; |
3389 simple_char_max = 0x80; | 3389 |
3390 | 3390 simple_char_max = (1 << BYTEWIDTH); |
3391 for (j = 0x80; j < 0xA0; j++) | |
3392 if (BASE_LEADING_CODE_P (j)) | |
3393 fastmap[j] = 1; | |
3394 match_any_multibyte_characters = true; | |
3395 } | |
3396 else | |
3397 simple_char_max = (1 << BYTEWIDTH); | |
3398 | |
3399 for (j = 0; j < simple_char_max; j++) | 3391 for (j = 0; j < simple_char_max; j++) |
3400 fastmap[j] = 1; | 3392 fastmap[j] = 1; |
3401 | 3393 |
3402 /* ... except perhaps newline. */ | 3394 /* ... except perhaps newline. */ |
3403 if (!(bufp->syntax & RE_DOT_NEWLINE)) | 3395 if (!(bufp->syntax & RE_DOT_NEWLINE)) |