6 |
and semantics are as close as possible to those of the Perl 5 language. |
and semantics are as close as possible to those of the Perl 5 language. |
7 |
|
|
8 |
Written by Philip Hazel |
Written by Philip Hazel |
9 |
Copyright (c) 1997-2007 University of Cambridge |
Copyright (c) 1997-2008 University of Cambridge |
10 |
|
|
11 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
12 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
45 |
|
|
46 |
|
|
47 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
48 |
#include <config.h> |
#include "config.h" |
49 |
#endif |
#endif |
50 |
|
|
51 |
#define NLBLOCK md /* Block containing newline information */ |
#define NLBLOCK md /* Block containing newline information */ |
84 |
small value. ***NOTE*** If the start of this table is modified, the two tables |
small value. ***NOTE*** If the start of this table is modified, the two tables |
85 |
that follow must also be modified. */ |
that follow must also be modified. */ |
86 |
|
|
87 |
static uschar coptable[] = { |
static const uschar coptable[] = { |
88 |
0, /* End */ |
0, /* End */ |
89 |
0, 0, 0, 0, 0, /* \A, \G, \K, \B, \b */ |
0, 0, 0, 0, 0, /* \A, \G, \K, \B, \b */ |
90 |
0, 0, 0, 0, 0, 0, /* \D, \d, \S, \s, \W, \w */ |
0, 0, 0, 0, 0, 0, /* \D, \d, \S, \s, \W, \w */ |
138 |
/* These 2 tables allow for compact code for testing for \D, \d, \S, \s, \W, |
/* These 2 tables allow for compact code for testing for \D, \d, \S, \s, \W, |
139 |
and \w */ |
and \w */ |
140 |
|
|
141 |
static uschar toptable1[] = { |
static const uschar toptable1[] = { |
142 |
0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, |
143 |
ctype_digit, ctype_digit, |
ctype_digit, ctype_digit, |
144 |
ctype_space, ctype_space, |
ctype_space, ctype_space, |
146 |
0 /* OP_ANY */ |
0 /* OP_ANY */ |
147 |
}; |
}; |
148 |
|
|
149 |
static uschar toptable2[] = { |
static const uschar toptable2[] = { |
150 |
0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, |
151 |
ctype_digit, 0, |
ctype_digit, 0, |
152 |
ctype_space, 0, |
ctype_space, 0, |
694 |
break; |
break; |
695 |
|
|
696 |
/*-----------------------------------------------------------------*/ |
/*-----------------------------------------------------------------*/ |
697 |
|
case OP_SKIPZERO: |
698 |
|
code += 1 + GET(code, 2); |
699 |
|
while (*code == OP_ALT) code += GET(code, 1); |
700 |
|
ADD_ACTIVE(code - start_code + 1 + LINK_SIZE, 0); |
701 |
|
break; |
702 |
|
|
703 |
|
/*-----------------------------------------------------------------*/ |
704 |
case OP_CIRC: |
case OP_CIRC: |
705 |
if ((ptr == start_subject && (md->moptions & PCRE_NOTBOL) == 0) || |
if ((ptr == start_subject && (md->moptions & PCRE_NOTBOL) == 0) || |
706 |
((ims & PCRE_MULTILINE) != 0 && |
((ims & PCRE_MULTILINE) != 0 && |
2611 |
md->moptions |= re->options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE); |
md->moptions |= re->options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE); |
2612 |
#ifdef BSR_ANYCRLF |
#ifdef BSR_ANYCRLF |
2613 |
else md->moptions |= PCRE_BSR_ANYCRLF; |
else md->moptions |= PCRE_BSR_ANYCRLF; |
2614 |
#endif |
#endif |
2615 |
} |
} |
2616 |
|
|
2617 |
/* Handle different types of newline. The three bits give eight cases. If |
/* Handle different types of newline. The three bits give eight cases. If |
2618 |
nothing is set at run time, whatever was used at compile time applies. */ |
nothing is set at run time, whatever was used at compile time applies. */ |