Mercurial > hg > xemacs-beta
comparison src/regex.c @ 2:ac2d302a0011 r19-15b2
Import from CVS: tag r19-15b2
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:46:35 +0200 |
parents | 376386a54a3c |
children | 0293115a14e9 |
comparison
equal
deleted
inserted
replaced
1:c0c6a60d29db | 2:ac2d302a0011 |
---|---|
1040 /* Roughly the maximum number of failure points on the stack. Would be | 1040 /* Roughly the maximum number of failure points on the stack. Would be |
1041 exactly that if always used MAX_FAILURE_SPACE each time we failed. | 1041 exactly that if always used MAX_FAILURE_SPACE each time we failed. |
1042 This is a variable only so users of regex can assign to it; we never | 1042 This is a variable only so users of regex can assign to it; we never |
1043 change it ourselves. */ | 1043 change it ourselves. */ |
1044 #if defined (MATCH_MAY_ALLOCATE) | 1044 #if defined (MATCH_MAY_ALLOCATE) |
1045 int re_max_failures = 200000; | 1045 /* 4400 was enough to cause a crash on Alpha OSF/1, |
1046 whose default stack limit is 2mb. */ | |
1047 int re_max_failures = 4000; | |
1046 #else | 1048 #else |
1047 int re_max_failures = 2000; | 1049 int re_max_failures = 2000; |
1048 #endif | 1050 #endif |
1049 | 1051 |
1050 union fail_stack_elt | 1052 union fail_stack_elt |
2658 goto normal_backslash; | 2660 goto normal_backslash; |
2659 | 2661 |
2660 default: | 2662 default: |
2661 normal_backslash: | 2663 normal_backslash: |
2662 /* You might think it would be useful for \ to mean | 2664 /* You might think it would be useful for \ to mean |
2663 not to translate; but if we don't translate it | 2665 not to translate; but if we don't translate it, |
2664 it will never match anything. */ | 2666 it will never match anything. */ |
2665 c = TRANSLATE (c); | 2667 c = TRANSLATE (c); |
2666 goto normal_char; | 2668 goto normal_char; |
2667 } | 2669 } |
2668 break; | 2670 break; |
3602 } | 3604 } |
3603 #endif /* not emacs */ | 3605 #endif /* not emacs */ |
3604 | 3606 |
3605 | 3607 |
3606 /* re_match_2 matches the compiled pattern in BUFP against the | 3608 /* re_match_2 matches the compiled pattern in BUFP against the |
3607 the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1 | 3609 (virtual) concatenation of STRING1 and STRING2 (of length SIZE1 and |
3608 and SIZE2, respectively). We start matching at POS, and stop | 3610 SIZE2, respectively). We start matching at POS, and stop matching |
3609 matching at STOP. | 3611 at STOP. |
3610 | 3612 |
3611 If REGS is non-null and the `no_sub' field of BUFP is nonzero, we | 3613 If REGS is non-null and the `no_sub' field of BUFP is nonzero, we |
3612 store offsets for the substring each group matched in REGS. See the | 3614 store offsets for the substring each group matched in REGS. See the |
3613 documentation for exactly how many groups we fill. | 3615 documentation for exactly how many groups we fill. |
3614 | 3616 |
3666 the subexpressions we're currently inside, plus the number of such | 3668 the subexpressions we're currently inside, plus the number of such |
3667 registers, and, finally, two char *'s. The first char * is where | 3669 registers, and, finally, two char *'s. The first char * is where |
3668 to resume scanning the pattern; the second one is where to resume | 3670 to resume scanning the pattern; the second one is where to resume |
3669 scanning the strings. If the latter is zero, the failure point is | 3671 scanning the strings. If the latter is zero, the failure point is |
3670 a ``dummy''; if a failure happens and the failure point is a dummy, | 3672 a ``dummy''; if a failure happens and the failure point is a dummy, |
3671 it gets discarded and the next next one is tried. */ | 3673 it gets discarded and the next one is tried. */ |
3672 #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ | 3674 #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ |
3673 fail_stack_type fail_stack; | 3675 fail_stack_type fail_stack; |
3674 #endif | 3676 #endif |
3675 #ifdef DEBUG | 3677 #ifdef DEBUG |
3676 static unsigned failure_id; | 3678 static unsigned failure_id; |