This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix perl #115078, ternary folding logic failure
[perl5.git] / regcharclass.h
CommitLineData
8770da0e 1/* -*- buffer-read-only: t -*-
58fbde93
RGS
2 *
3 * regcharclass.h
4 *
2eee27d7 5 * Copyright (C) 2007, 2011 by Larry Wall and others
58fbde93
RGS
6 *
7 * You may distribute under the terms of either the GNU General Public
8 * License or the Artistic License, as specified in the README file.
9 *
10 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
98e310af 11 * This file is built by regen/regcharclass.pl.
58fbde93
RGS
12 * Any changes made here will be lost!
13 */
12b72891 14
d10c72f2
KW
15
16#ifndef H_REGCHARCLASS /* Guard against nested #includes */
17#define H_REGCHARCLASS 1
18
12b72891
RGS
19/*
20 LNBREAK: Line Break: \R
21
58fbde93 22 "\x0D\x0A" # CRLF - Network (Windows) line ending
05b688d9 23 \p{VertSpace}
12b72891
RGS
24*/
25/*** GENERATED CODE ***/
26#define is_LNBREAK(s,is_utf8) \
e64b1bd1
YO
27( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0C ) ? 1 \
28: ( 0x0D == ((U8*)s)[0] ) ? \
29 ( ( 0x0A == ((U8*)s)[1] ) ? 2 : 1 ) \
30: ( is_utf8 ) ? \
31 ( ( 0xC2 == ((U8*)s)[0] ) ? \
32 ( ( 0x85 == ((U8*)s)[1] ) ? 2 : 0 ) \
33 : ( 0xE2 == ((U8*)s)[0] ) ? \
2efb8143 34 ( ( ( 0x80 == ((U8*)s)[1] ) && ( ( ((U8*)s)[2] & 0xFE ) == 0xA8 ) ) ? 3 : 0 )\
e64b1bd1
YO
35 : 0 ) \
36: ( 0x85 == ((U8*)s)[0] ) )
e1d1eefb 37
12b72891
RGS
38/*** GENERATED CODE ***/
39#define is_LNBREAK_safe(s,e,is_utf8) \
e64b1bd1
YO
40( ((e)-(s) > 2) ? \
41 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0C ) ? 1 \
42 : ( 0x0D == ((U8*)s)[0] ) ? \
43 ( ( 0x0A == ((U8*)s)[1] ) ? 2 : 1 ) \
44 : ( is_utf8 ) ? \
45 ( ( 0xC2 == ((U8*)s)[0] ) ? \
46 ( ( 0x85 == ((U8*)s)[1] ) ? 2 : 0 ) \
47 : ( 0xE2 == ((U8*)s)[0] ) ? \
2efb8143 48 ( ( ( 0x80 == ((U8*)s)[1] ) && ( ( ((U8*)s)[2] & 0xFE ) == 0xA8 ) ) ? 3 : 0 )\
e64b1bd1
YO
49 : 0 ) \
50 : ( 0x85 == ((U8*)s)[0] ) ) \
51: ((e)-(s) > 1) ? \
52 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0C ) ? 1 \
53 : ( 0x0D == ((U8*)s)[0] ) ? \
54 ( ( 0x0A == ((U8*)s)[1] ) ? 2 : 1 ) \
55 : ( is_utf8 ) ? \
56 ( ( ( 0xC2 == ((U8*)s)[0] ) && ( 0x85 == ((U8*)s)[1] ) ) ? 2 : 0 ) \
57 : ( 0x85 == ((U8*)s)[0] ) ) \
58: ((e)-(s) > 0) ? \
59 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) ? 1 \
60 : ( !( is_utf8 ) ) ? \
61 ( 0x85 == ((U8*)s)[0] ) \
62 : 0 ) \
63: 0 )
e1d1eefb 64
12b72891
RGS
65/*** GENERATED CODE ***/
66#define is_LNBREAK_utf8(s) \
e64b1bd1
YO
67( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0C ) ? 1 \
68: ( 0x0D == ((U8*)s)[0] ) ? \
69 ( ( 0x0A == ((U8*)s)[1] ) ? 2 : 1 ) \
70: ( 0xC2 == ((U8*)s)[0] ) ? \
71 ( ( 0x85 == ((U8*)s)[1] ) ? 2 : 0 ) \
72: ( 0xE2 == ((U8*)s)[0] ) ? \
2efb8143 73 ( ( ( 0x80 == ((U8*)s)[1] ) && ( ( ((U8*)s)[2] & 0xFE ) == 0xA8 ) ) ? 3 : 0 )\
e64b1bd1 74: 0 )
e1d1eefb 75
12b72891
RGS
76/*** GENERATED CODE ***/
77#define is_LNBREAK_utf8_safe(s,e) \
e64b1bd1
YO
78( ((e)-(s) > 2) ? \
79 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0C ) ? 1 \
80 : ( 0x0D == ((U8*)s)[0] ) ? \
81 ( ( 0x0A == ((U8*)s)[1] ) ? 2 : 1 ) \
82 : ( 0xC2 == ((U8*)s)[0] ) ? \
83 ( ( 0x85 == ((U8*)s)[1] ) ? 2 : 0 ) \
84 : ( 0xE2 == ((U8*)s)[0] ) ? \
2efb8143 85 ( ( ( 0x80 == ((U8*)s)[1] ) && ( ( ((U8*)s)[2] & 0xFE ) == 0xA8 ) ) ? 3 : 0 )\
e64b1bd1
YO
86 : 0 ) \
87: ((e)-(s) > 1) ? \
88 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0C ) ? 1 \
89 : ( 0x0D == ((U8*)s)[0] ) ? \
90 ( ( 0x0A == ((U8*)s)[1] ) ? 2 : 1 ) \
91 : ( 0xC2 == ((U8*)s)[0] ) ? \
92 ( ( 0x85 == ((U8*)s)[1] ) ? 2 : 0 ) \
93 : 0 ) \
94: ((e)-(s) > 0) ? \
95 ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) \
96: 0 )
e1d1eefb 97
12b72891
RGS
98/*** GENERATED CODE ***/
99#define is_LNBREAK_latin1(s) \
e64b1bd1
YO
100( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0C ) ? 1 \
101: ( 0x0D == ((U8*)s)[0] ) ? \
102 ( ( 0x0A == ((U8*)s)[1] ) ? 2 : 1 ) \
103: ( 0x85 == ((U8*)s)[0] ) )
e1d1eefb 104
12b72891
RGS
105/*** GENERATED CODE ***/
106#define is_LNBREAK_latin1_safe(s,e) \
e64b1bd1
YO
107( ((e)-(s) > 1) ? \
108 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0C ) ? 1 \
109 : ( 0x0D == ((U8*)s)[0] ) ? \
110 ( ( 0x0A == ((U8*)s)[1] ) ? 2 : 1 ) \
111 : ( 0x85 == ((U8*)s)[0] ) ) \
112: ((e)-(s) > 0) ? \
113 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) || 0x85 == ((U8*)s)[0] )\
114: 0 )
12b72891
RGS
115
116/*
117 HORIZWS: Horizontal Whitespace: \h \H
118
05b688d9 119 \p{HorizSpace}
12b72891
RGS
120*/
121/*** GENERATED CODE ***/
122#define is_HORIZWS(s,is_utf8) \
e64b1bd1
YO
123( ( 0x09 == ((U8*)s)[0] || 0x20 == ((U8*)s)[0] ) ? 1 \
124: ( is_utf8 ) ? \
125 ( ( 0xC2 == ((U8*)s)[0] ) ? \
126 ( ( 0xA0 == ((U8*)s)[1] ) ? 2 : 0 ) \
127 : ( 0xE1 == ((U8*)s)[0] ) ? \
128 ( ( 0x9A == ((U8*)s)[1] ) ? \
129 ( ( 0x80 == ((U8*)s)[2] ) ? 3 : 0 ) \
130 : ( 0xA0 == ((U8*)s)[1] ) ? \
131 ( ( 0x8E == ((U8*)s)[2] ) ? 3 : 0 ) \
132 : 0 ) \
133 : ( 0xE2 == ((U8*)s)[0] ) ? \
134 ( ( 0x80 == ((U8*)s)[1] ) ? \
135 ( ( ( 0x80 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0x8A ) || 0xAF == ((U8*)s)[2] ) ? 3 : 0 )\
136 : ( 0x81 == ((U8*)s)[1] ) ? \
137 ( ( 0x9F == ((U8*)s)[2] ) ? 3 : 0 ) \
138 : 0 ) \
139 : ( 0xE3 == ((U8*)s)[0] ) ? \
140 ( ( ( 0x80 == ((U8*)s)[1] ) && ( 0x80 == ((U8*)s)[2] ) ) ? 3 : 0 ) \
141 : 0 ) \
142: ( 0xA0 == ((U8*)s)[0] ) )
e1d1eefb 143
12b72891
RGS
144/*** GENERATED CODE ***/
145#define is_HORIZWS_safe(s,e,is_utf8) \
e64b1bd1
YO
146( ((e)-(s) > 2) ? \
147 ( ( 0x09 == ((U8*)s)[0] || 0x20 == ((U8*)s)[0] ) ? 1 \
148 : ( is_utf8 ) ? \
149 ( ( 0xC2 == ((U8*)s)[0] ) ? \
150 ( ( 0xA0 == ((U8*)s)[1] ) ? 2 : 0 ) \
151 : ( 0xE1 == ((U8*)s)[0] ) ? \
152 ( ( 0x9A == ((U8*)s)[1] ) ? \
153 ( ( 0x80 == ((U8*)s)[2] ) ? 3 : 0 ) \
154 : ( 0xA0 == ((U8*)s)[1] ) ? \
155 ( ( 0x8E == ((U8*)s)[2] ) ? 3 : 0 ) \
156 : 0 ) \
157 : ( 0xE2 == ((U8*)s)[0] ) ? \
158 ( ( 0x80 == ((U8*)s)[1] ) ? \
159 ( ( ( 0x80 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0x8A ) || 0xAF == ((U8*)s)[2] ) ? 3 : 0 )\
160 : ( 0x81 == ((U8*)s)[1] ) ? \
161 ( ( 0x9F == ((U8*)s)[2] ) ? 3 : 0 ) \
162 : 0 ) \
163 : ( 0xE3 == ((U8*)s)[0] ) ? \
164 ( ( ( 0x80 == ((U8*)s)[1] ) && ( 0x80 == ((U8*)s)[2] ) ) ? 3 : 0 )\
165 : 0 ) \
166 : ( 0xA0 == ((U8*)s)[0] ) ) \
167: ((e)-(s) > 1) ? \
168 ( ( 0x09 == ((U8*)s)[0] || 0x20 == ((U8*)s)[0] ) ? 1 \
169 : ( is_utf8 ) ? \
170 ( ( ( 0xC2 == ((U8*)s)[0] ) && ( 0xA0 == ((U8*)s)[1] ) ) ? 2 : 0 ) \
171 : ( 0xA0 == ((U8*)s)[0] ) ) \
172: ((e)-(s) > 0) ? \
173 ( ( 0x09 == ((U8*)s)[0] || 0x20 == ((U8*)s)[0] ) ? 1 \
174 : ( !( is_utf8 ) ) ? \
175 ( 0xA0 == ((U8*)s)[0] ) \
176 : 0 ) \
177: 0 )
e1d1eefb 178
12b72891
RGS
179/*** GENERATED CODE ***/
180#define is_HORIZWS_utf8(s) \
e64b1bd1
YO
181( ( 0x09 == ((U8*)s)[0] || 0x20 == ((U8*)s)[0] ) ? 1 \
182: ( 0xC2 == ((U8*)s)[0] ) ? \
183 ( ( 0xA0 == ((U8*)s)[1] ) ? 2 : 0 ) \
184: ( 0xE1 == ((U8*)s)[0] ) ? \
185 ( ( 0x9A == ((U8*)s)[1] ) ? \
186 ( ( 0x80 == ((U8*)s)[2] ) ? 3 : 0 ) \
187 : ( 0xA0 == ((U8*)s)[1] ) ? \
188 ( ( 0x8E == ((U8*)s)[2] ) ? 3 : 0 ) \
189 : 0 ) \
190: ( 0xE2 == ((U8*)s)[0] ) ? \
191 ( ( 0x80 == ((U8*)s)[1] ) ? \
6e130234 192 ( ( ( ((U8*)s)[2] <= 0x8A ) || 0xAF == ((U8*)s)[2] ) ? 3 : 0 ) \
e64b1bd1
YO
193 : ( 0x81 == ((U8*)s)[1] ) ? \
194 ( ( 0x9F == ((U8*)s)[2] ) ? 3 : 0 ) \
195 : 0 ) \
196: ( 0xE3 == ((U8*)s)[0] ) ? \
197 ( ( ( 0x80 == ((U8*)s)[1] ) && ( 0x80 == ((U8*)s)[2] ) ) ? 3 : 0 ) \
198: 0 )
e1d1eefb 199
12b72891
RGS
200/*** GENERATED CODE ***/
201#define is_HORIZWS_utf8_safe(s,e) \
e64b1bd1
YO
202( ((e)-(s) > 2) ? \
203 ( ( 0x09 == ((U8*)s)[0] || 0x20 == ((U8*)s)[0] ) ? 1 \
204 : ( 0xC2 == ((U8*)s)[0] ) ? \
205 ( ( 0xA0 == ((U8*)s)[1] ) ? 2 : 0 ) \
206 : ( 0xE1 == ((U8*)s)[0] ) ? \
207 ( ( 0x9A == ((U8*)s)[1] ) ? \
208 ( ( 0x80 == ((U8*)s)[2] ) ? 3 : 0 ) \
209 : ( 0xA0 == ((U8*)s)[1] ) ? \
210 ( ( 0x8E == ((U8*)s)[2] ) ? 3 : 0 ) \
211 : 0 ) \
212 : ( 0xE2 == ((U8*)s)[0] ) ? \
213 ( ( 0x80 == ((U8*)s)[1] ) ? \
214 ( ( ( 0x80 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0x8A ) || 0xAF == ((U8*)s)[2] ) ? 3 : 0 )\
215 : ( 0x81 == ((U8*)s)[1] ) ? \
216 ( ( 0x9F == ((U8*)s)[2] ) ? 3 : 0 ) \
217 : 0 ) \
218 : ( 0xE3 == ((U8*)s)[0] ) ? \
219 ( ( ( 0x80 == ((U8*)s)[1] ) && ( 0x80 == ((U8*)s)[2] ) ) ? 3 : 0 ) \
220 : 0 ) \
221: ((e)-(s) > 1) ? \
222 ( ( 0x09 == ((U8*)s)[0] || 0x20 == ((U8*)s)[0] ) ? 1 \
223 : ( 0xC2 == ((U8*)s)[0] ) ? \
224 ( ( 0xA0 == ((U8*)s)[1] ) ? 2 : 0 ) \
225 : 0 ) \
226: ((e)-(s) > 0) ? \
227 ( 0x09 == ((U8*)s)[0] || 0x20 == ((U8*)s)[0] ) \
228: 0 )
e1d1eefb 229
12b72891
RGS
230/*** GENERATED CODE ***/
231#define is_HORIZWS_latin1(s) \
e64b1bd1 232( 0x09 == ((U8*)s)[0] || 0x20 == ((U8*)s)[0] || 0xA0 == ((U8*)s)[0] )
e1d1eefb 233
12b72891
RGS
234/*** GENERATED CODE ***/
235#define is_HORIZWS_latin1_safe(s,e) \
e64b1bd1
YO
236( ((e)-(s) > 0) ? \
237 ( 0x09 == ((U8*)s)[0] || 0x20 == ((U8*)s)[0] || 0xA0 == ((U8*)s)[0] ) \
238: 0 )
e1d1eefb 239
12b72891
RGS
240/*** GENERATED CODE ***/
241#define is_HORIZWS_cp(cp) \
e64b1bd1
YO
242( 0x09 == cp || ( 0x09 < cp && \
243( 0x20 == cp || ( 0x20 < cp && \
244( 0xA0 == cp || ( 0xA0 < cp && \
245( 0x1680 == cp || ( 0x1680 < cp && \
246( 0x180E == cp || ( 0x180E < cp && \
247( ( 0x2000 <= cp && cp <= 0x200A ) || ( 0x200A < cp && \
248( 0x202F == cp || ( 0x202F < cp && \
249( 0x205F == cp || ( 0x205F < cp && \
2500x3000 == cp ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )
e1d1eefb 251
12b72891
RGS
252/*
253 VERTWS: Vertical Whitespace: \v \V
e1d1eefb 254
05b688d9 255 \p{VertSpace}
12b72891
RGS
256*/
257/*** GENERATED CODE ***/
258#define is_VERTWS(s,is_utf8) \
e64b1bd1
YO
259( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) ? 1 \
260: ( is_utf8 ) ? \
261 ( ( 0xC2 == ((U8*)s)[0] ) ? \
262 ( ( 0x85 == ((U8*)s)[1] ) ? 2 : 0 ) \
263 : ( 0xE2 == ((U8*)s)[0] ) ? \
2efb8143 264 ( ( ( 0x80 == ((U8*)s)[1] ) && ( ( ((U8*)s)[2] & 0xFE ) == 0xA8 ) ) ? 3 : 0 )\
e64b1bd1
YO
265 : 0 ) \
266: ( 0x85 == ((U8*)s)[0] ) )
e1d1eefb 267
12b72891
RGS
268/*** GENERATED CODE ***/
269#define is_VERTWS_safe(s,e,is_utf8) \
e64b1bd1
YO
270( ((e)-(s) > 2) ? \
271 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) ? 1 \
272 : ( is_utf8 ) ? \
273 ( ( 0xC2 == ((U8*)s)[0] ) ? \
274 ( ( 0x85 == ((U8*)s)[1] ) ? 2 : 0 ) \
275 : ( 0xE2 == ((U8*)s)[0] ) ? \
2efb8143 276 ( ( ( 0x80 == ((U8*)s)[1] ) && ( ( ((U8*)s)[2] & 0xFE ) == 0xA8 ) ) ? 3 : 0 )\
e64b1bd1
YO
277 : 0 ) \
278 : ( 0x85 == ((U8*)s)[0] ) ) \
279: ((e)-(s) > 1) ? \
280 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) ? 1 \
281 : ( is_utf8 ) ? \
282 ( ( ( 0xC2 == ((U8*)s)[0] ) && ( 0x85 == ((U8*)s)[1] ) ) ? 2 : 0 ) \
283 : ( 0x85 == ((U8*)s)[0] ) ) \
284: ((e)-(s) > 0) ? \
285 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) ? 1 \
286 : ( !( is_utf8 ) ) ? \
287 ( 0x85 == ((U8*)s)[0] ) \
288 : 0 ) \
289: 0 )
e1d1eefb 290
12b72891
RGS
291/*** GENERATED CODE ***/
292#define is_VERTWS_utf8(s) \
e64b1bd1
YO
293( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) ? 1 \
294: ( 0xC2 == ((U8*)s)[0] ) ? \
295 ( ( 0x85 == ((U8*)s)[1] ) ? 2 : 0 ) \
296: ( 0xE2 == ((U8*)s)[0] ) ? \
2efb8143 297 ( ( ( 0x80 == ((U8*)s)[1] ) && ( ( ((U8*)s)[2] & 0xFE ) == 0xA8 ) ) ? 3 : 0 )\
e64b1bd1 298: 0 )
e1d1eefb 299
12b72891
RGS
300/*** GENERATED CODE ***/
301#define is_VERTWS_utf8_safe(s,e) \
e64b1bd1
YO
302( ((e)-(s) > 2) ? \
303 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) ? 1 \
304 : ( 0xC2 == ((U8*)s)[0] ) ? \
305 ( ( 0x85 == ((U8*)s)[1] ) ? 2 : 0 ) \
306 : ( 0xE2 == ((U8*)s)[0] ) ? \
2efb8143 307 ( ( ( 0x80 == ((U8*)s)[1] ) && ( ( ((U8*)s)[2] & 0xFE ) == 0xA8 ) ) ? 3 : 0 )\
e64b1bd1
YO
308 : 0 ) \
309: ((e)-(s) > 1) ? \
310 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) ? 1 \
311 : ( 0xC2 == ((U8*)s)[0] ) ? \
312 ( ( 0x85 == ((U8*)s)[1] ) ? 2 : 0 ) \
313 : 0 ) \
314: ((e)-(s) > 0) ? \
315 ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) \
316: 0 )
e1d1eefb 317
12b72891
RGS
318/*** GENERATED CODE ***/
319#define is_VERTWS_latin1(s) \
e64b1bd1 320( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) || 0x85 == ((U8*)s)[0] )
e1d1eefb 321
12b72891
RGS
322/*** GENERATED CODE ***/
323#define is_VERTWS_latin1_safe(s,e) \
e64b1bd1
YO
324( ((e)-(s) > 0) ? \
325 ( ( 0x0A <= ((U8*)s)[0] && ((U8*)s)[0] <= 0x0D ) || 0x85 == ((U8*)s)[0] )\
326: 0 )
e1d1eefb 327
12b72891
RGS
328/*** GENERATED CODE ***/
329#define is_VERTWS_cp(cp) \
e64b1bd1
YO
330( ( 0x0A <= cp && cp <= 0x0D ) || ( 0x0D < cp && \
331( 0x85 == cp || ( 0x85 < cp && \
332( 0x2028 == cp || ( 0x2028 < cp && \
3330x2029 == cp ) ) ) ) ) )
e1d1eefb 334
612ead59 335/*
b96a92fb
KW
336 REPLACEMENT: Unicode REPLACEMENT CHARACTER
337
338 0xFFFD
339*/
340/*** GENERATED CODE ***/
341#define is_REPLACEMENT_utf8_safe(s,e) \
342( ( ( ( ((e)-(s) > 2) && ( 0xEF == ((U8*)s)[0] ) ) && ( 0xBF == ((U8*)s)[1] ) ) && ( 0xBD == ((U8*)s)[2] ) ) ? 3 : 0 )
343
344/*
345 NONCHAR: Non character code points
346
347 \p{Nchar}
348*/
349/*** GENERATED CODE ***/
350#define is_NONCHAR_utf8(s) \
351( ( 0xEF == ((U8*)s)[0] ) ? \
352 ( ( 0xB7 == ((U8*)s)[1] ) ? \
353 ( ( 0x90 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xAF ) ? 3 : 0 ) \
354 : ( 0xBF == ((U8*)s)[1] ) ? \
355 ( ( ((U8*)s)[2] >= 0xBE ) ? 3 : 0 ) \
356 : 0 ) \
357: ( 0xF0 == ((U8*)s)[0] ) ? \
358 ( ( ( ( 0x9F == ((U8*)s)[1] || 0xAF == ((U8*)s)[1] || 0xBF == ((U8*)s)[1] ) && ( 0xBF == ((U8*)s)[2] ) ) && ( ((U8*)s)[3] >= 0xBE ) ) ? 4 : 0 )\
359: ( 0xF1 <= ((U8*)s)[0] && ((U8*)s)[0] <= 0xF3 ) ? \
360 ( ( ( ( ( ((U8*)s)[1] & 0xCF ) == 0x8F ) && ( 0xBF == ((U8*)s)[2] ) ) && ( ((U8*)s)[3] >= 0xBE ) ) ? 4 : 0 )\
361: ( 0xF4 == ((U8*)s)[0] ) ? \
362 ( ( ( ( 0x8F == ((U8*)s)[1] ) && ( 0xBF == ((U8*)s)[2] ) ) && ( ((U8*)s)[3] >= 0xBE ) ) ? 4 : 0 )\
363: 0 )
364
365/*
366 SURROGATE: Surrogate characters
367
368 \p{Gc=Cs}
369*/
370/*** GENERATED CODE ***/
371#define is_SURROGATE_utf8(s) \
372( ( ( 0xED == ((U8*)s)[0] ) && ( ((U8*)s)[1] >= 0xA0 ) ) ? 3 : 0 )
373
374/*
612ead59
KW
375 GCB_L: Grapheme_Cluster_Break=L
376
377 \p{_X_GCB_L}
378*/
379/*** GENERATED CODE ***/
380#define is_GCB_L_utf8(s) \
381( ( 0xE1 == ((U8*)s)[0] ) ? \
382 ( ( 0x84 == ((U8*)s)[1] ) ? \
6e130234 383 3 \
612ead59 384 : ( 0x85 == ((U8*)s)[1] ) ? \
6e130234 385 ( ( ((U8*)s)[2] <= 0x9F ) ? 3 : 0 ) \
612ead59
KW
386 : 0 ) \
387: ( 0xEA == ((U8*)s)[0] ) ? \
388 ( ( ( 0xA5 == ((U8*)s)[1] ) && ( 0xA0 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xBC ) ) ? 3 : 0 )\
389: 0 )
390
391/*
392 GCB_LV_LVT_V: Grapheme_Cluster_Break=(LV or LVT or V)
393
394 \p{_X_LV_LVT_V}
395*/
396/*** GENERATED CODE ***/
397#define is_GCB_LV_LVT_V_utf8(s) \
398( ( 0xE1 == ((U8*)s)[0] ) ? \
399 ( ( 0x85 == ((U8*)s)[1] ) ? \
6e130234 400 ( ( ((U8*)s)[2] >= 0xA0 ) ? 3 : 0 ) \
612ead59 401 : ( 0x86 == ((U8*)s)[1] ) ? \
6e130234 402 ( ( ((U8*)s)[2] <= 0xA7 ) ? 3 : 0 ) \
612ead59
KW
403 : 0 ) \
404: ( 0xEA == ((U8*)s)[0] ) ? \
6e130234
KW
405 ( ( ((U8*)s)[1] >= 0xB0 ) ? \
406 3 \
407 : 0 ) \
612ead59 408: ( 0xEB == ((U8*)s)[0] || 0xEC == ((U8*)s)[0] ) ? \
6e130234 409 3 \
612ead59 410: ( 0xED == ((U8*)s)[0] ) ? \
6e130234
KW
411 ( ( ((U8*)s)[1] <= 0x9D ) ? \
412 3 \
612ead59 413 : ( 0x9E == ((U8*)s)[1] ) ? \
6e130234 414 ( ( ( ((U8*)s)[2] <= 0xA3 ) || ( ((U8*)s)[2] >= 0xB0 ) ) ? 3 : 0 ) \
612ead59 415 : ( 0x9F == ((U8*)s)[1] ) ? \
6e130234 416 ( ( ((U8*)s)[2] <= 0x86 ) ? 3 : 0 ) \
612ead59
KW
417 : 0 ) \
418: 0 )
419
420/*
421 GCB_Prepend: Grapheme_Cluster_Break=Prepend
422
423 \p{_X_GCB_Prepend}
424*/
425/*** GENERATED CODE ***/
426#define is_GCB_Prepend_utf8(s) \
427( 0 )
428
429/*
430 GCB_RI: Grapheme_Cluster_Break=RI
431
432 \p{_X_RI}
433*/
434/*** GENERATED CODE ***/
435#define is_GCB_RI_utf8(s) \
6e130234 436( ( ( ( ( 0xF0 == ((U8*)s)[0] ) && ( 0x9F == ((U8*)s)[1] ) ) && ( 0x87 == ((U8*)s)[2] ) ) && ( ((U8*)s)[3] >= 0xA6 ) ) ? 4 : 0 )
612ead59
KW
437
438/*
439 GCB_SPECIAL_BEGIN: Grapheme_Cluster_Break=special_begins
440
441 \p{_X_Special_Begin}
442*/
443/*** GENERATED CODE ***/
444#define is_GCB_SPECIAL_BEGIN_utf8(s) \
6e130234
KW
445( ( 0xE1 == ((U8*)s)[0] ) ? \
446 ( ( ( ((U8*)s)[1] & 0xFC ) == 0x84 ) ? \
447 3 \
448 : 0 ) \
612ead59
KW
449: ( 0xEA == ((U8*)s)[0] ) ? \
450 ( ( 0xA5 == ((U8*)s)[1] ) ? \
451 ( ( 0xA0 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xBC ) ? 3 : 0 ) \
6e130234
KW
452 : ( ((U8*)s)[1] >= 0xB0 ) ? \
453 3 \
612ead59
KW
454 : 0 ) \
455: ( 0xEB == ((U8*)s)[0] || 0xEC == ((U8*)s)[0] ) ? \
6e130234 456 3 \
612ead59 457: ( 0xED == ((U8*)s)[0] ) ? \
6e130234
KW
458 ( ( ((U8*)s)[1] <= 0x9D ) ? \
459 3 \
612ead59 460 : ( 0x9E == ((U8*)s)[1] ) ? \
6e130234 461 ( ( ( ((U8*)s)[2] <= 0xA3 ) || ( ((U8*)s)[2] >= 0xB0 ) ) ? 3 : 0 ) \
612ead59 462 : ( 0x9F == ((U8*)s)[1] ) ? \
6e130234 463 ( ( ( ((U8*)s)[2] <= 0x86 ) || ( 0x8B <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xBB ) ) ? 3 : 0 )\
612ead59
KW
464 : 0 ) \
465: ( 0xF0 == ((U8*)s)[0] ) ? \
6e130234 466 ( ( ( ( 0x9F == ((U8*)s)[1] ) && ( 0x87 == ((U8*)s)[2] ) ) && ( ((U8*)s)[3] >= 0xA6 ) ) ? 4 : 0 )\
612ead59
KW
467: 0 )
468
469/*
470 GCB_T: Grapheme_Cluster_Break=T
471
472 \p{_X_GCB_T}
473*/
474/*** GENERATED CODE ***/
475#define is_GCB_T_utf8(s) \
476( ( 0xE1 == ((U8*)s)[0] ) ? \
477 ( ( 0x86 == ((U8*)s)[1] ) ? \
6e130234 478 ( ( ((U8*)s)[2] >= 0xA8 ) ? 3 : 0 ) \
612ead59 479 : ( 0x87 == ((U8*)s)[1] ) ? \
6e130234 480 3 \
612ead59
KW
481 : 0 ) \
482: ( 0xED == ((U8*)s)[0] ) ? \
483 ( ( ( 0x9F == ((U8*)s)[1] ) && ( 0x8B <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xBB ) ) ? 3 : 0 )\
484: 0 )
485
486/*
487 GCB_V: Grapheme_Cluster_Break=V
488
489 \p{_X_GCB_V}
490*/
491/*** GENERATED CODE ***/
492#define is_GCB_V_utf8(s) \
493( ( 0xE1 == ((U8*)s)[0] ) ? \
494 ( ( 0x85 == ((U8*)s)[1] ) ? \
6e130234 495 ( ( ((U8*)s)[2] >= 0xA0 ) ? 3 : 0 ) \
612ead59 496 : ( 0x86 == ((U8*)s)[1] ) ? \
6e130234 497 ( ( ((U8*)s)[2] <= 0xA7 ) ? 3 : 0 ) \
612ead59
KW
498 : 0 ) \
499: ( 0xED == ((U8*)s)[0] ) ? \
500 ( ( 0x9E == ((U8*)s)[1] ) ? \
6e130234 501 ( ( ((U8*)s)[2] >= 0xB0 ) ? 3 : 0 ) \
612ead59 502 : ( 0x9F == ((U8*)s)[1] ) ? \
6e130234 503 ( ( ((U8*)s)[2] <= 0x86 ) ? 3 : 0 ) \
612ead59
KW
504 : 0 ) \
505: 0 )
506
685289b5
KW
507/*
508 QUOTEMETA: Meta-characters that \Q should quote
509
510 \p{_Perl_Quotemeta}
511*/
512/*** GENERATED CODE ***/
513#define is_QUOTEMETA_high(s) \
514( ( 0xCD == ((U8*)s)[0] ) ? \
515 ( ( 0x8F == ((U8*)s)[1] ) ? 2 : 0 ) \
516: ( 0xE1 == ((U8*)s)[0] ) ? \
517 ( ( 0x85 == ((U8*)s)[1] ) ? \
518 ( ( 0x9F == ((U8*)s)[2] || 0xA0 == ((U8*)s)[2] ) ? 3 : 0 ) \
519 : ( 0x9A == ((U8*)s)[1] ) ? \
520 ( ( 0x80 == ((U8*)s)[2] ) ? 3 : 0 ) \
521 : ( 0x9E == ((U8*)s)[1] ) ? \
2efb8143 522 ( ( ( ((U8*)s)[2] & 0xFE ) == 0xB4 ) ? 3 : 0 ) \
685289b5
KW
523 : ( 0xA0 == ((U8*)s)[1] ) ? \
524 ( ( 0x8B <= ((U8*)s)[2] && ((U8*)s)[2] <= 0x8E ) ? 3 : 0 ) \
525 : 0 ) \
526: ( 0xE2 == ((U8*)s)[0] ) ? \
527 ( ( 0x80 == ((U8*)s)[1] ) ? \
6e130234 528 ( ( ((U8*)s)[2] <= 0xBE ) ? 3 : 0 ) \
685289b5
KW
529 : ( 0x81 == ((U8*)s)[1] ) ? \
530 ( ( ( 0x81 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0x93 ) || ( 0x95 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xAF ) ) ? 3 : 0 )\
531 : ( 0x86 == ((U8*)s)[1] ) ? \
6e130234 532 ( ( ((U8*)s)[2] >= 0x90 ) ? 3 : 0 ) \
685289b5 533 : ( 0x87 <= ((U8*)s)[1] && ((U8*)s)[1] <= 0x90 ) ? \
6e130234 534 3 \
685289b5 535 : ( 0x91 == ((U8*)s)[1] ) ? \
6e130234 536 ( ( ((U8*)s)[2] <= 0x9F ) ? 3 : 0 ) \
685289b5 537 : ( 0x94 <= ((U8*)s)[1] && ((U8*)s)[1] <= 0x9C ) ? \
6e130234 538 3 \
685289b5 539 : ( 0x9D == ((U8*)s)[1] ) ? \
6e130234 540 ( ( ((U8*)s)[2] <= 0xB5 ) ? 3 : 0 ) \
685289b5 541 : ( 0x9E == ((U8*)s)[1] ) ? \
6e130234 542 ( ( ((U8*)s)[2] >= 0x94 ) ? 3 : 0 ) \
f5772832 543 : ( ( 0x9F <= ((U8*)s)[1] && ((U8*)s)[1] <= 0xAF ) || ( ((U8*)s)[1] & 0xFE ) == 0xB8 ) ?\
6e130234 544 3 \
685289b5
KW
545 : 0 ) \
546: ( 0xE3 == ((U8*)s)[0] ) ? \
547 ( ( 0x80 == ((U8*)s)[1] ) ? \
6e130234 548 ( ( ( ((U8*)s)[2] <= 0x83 ) || ( 0x88 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xA0 ) || 0xB0 == ((U8*)s)[2] ) ? 3 : 0 )\
685289b5
KW
549 : ( 0x85 == ((U8*)s)[1] ) ? \
550 ( ( 0xA4 == ((U8*)s)[2] ) ? 3 : 0 ) \
551 : 0 ) \
552: ( 0xEF == ((U8*)s)[0] ) ? \
553 ( ( 0xB4 == ((U8*)s)[1] ) ? \
6e130234 554 ( ( ((U8*)s)[2] >= 0xBE ) ? 3 : 0 ) \
685289b5 555 : ( 0xB8 == ((U8*)s)[1] ) ? \
6e130234 556 ( ( ((U8*)s)[2] <= 0x8F ) ? 3 : 0 ) \
685289b5
KW
557 : ( 0xB9 == ((U8*)s)[1] ) ? \
558 ( ( 0x85 == ((U8*)s)[2] || 0x86 == ((U8*)s)[2] ) ? 3 : 0 ) \
559 : ( 0xBB == ((U8*)s)[1] ) ? \
560 ( ( 0xBF == ((U8*)s)[2] ) ? 3 : 0 ) \
561 : ( 0xBE == ((U8*)s)[1] ) ? \
562 ( ( 0xA0 == ((U8*)s)[2] ) ? 3 : 0 ) \
563 : ( 0xBF == ((U8*)s)[1] ) ? \
564 ( ( 0xB0 <= ((U8*)s)[2] && ((U8*)s)[2] <= 0xB8 ) ? 3 : 0 ) \
565 : 0 ) \
566: ( 0xF0 == ((U8*)s)[0] ) ? \
567 ( ( ( ( 0x9D == ((U8*)s)[1] ) && ( 0x85 == ((U8*)s)[2] ) ) && ( 0xB3 <= ((U8*)s)[3] && ((U8*)s)[3] <= 0xBA ) ) ? 4 : 0 )\
568: ( 0xF3 == ((U8*)s)[0] ) ? \
6e130234
KW
569 ( ( 0xA0 == ((U8*)s)[1] ) ? \
570 4 \
571 : 0 ) \
685289b5
KW
572: 0 )
573
f22151ed 574/*
8fdb8a9d 575 FOR_TESTING_DEMO: This is used to test if we generate incorrect code (currently it is ok)
f22151ed
YO
576
577 "\x{3B7}\x{342}"
578 "\x{3B9}\x{308}\x{301}"
579*/
580/*** GENERATED CODE ***/
581#define is_FOR_TESTING_DEMO_utf8_safe(s,e) \
8fdb8a9d
YO
582( ((e)-(s) > 5) ? \
583 ( ( 0xCE == ((U8*)s)[0] ) ? \
584 ( ( 0xB7 == ((U8*)s)[1] ) ? \
585 ( ( ( 0xCD == ((U8*)s)[2] ) && ( 0x82 == ((U8*)s)[3] ) ) ? 4 : 0 )\
f22151ed
YO
586 : ( 0xB9 == ((U8*)s)[1] ) ? \
587 ( ( ( ( ( 0xCC == ((U8*)s)[2] ) && ( 0x88 == ((U8*)s)[3] ) ) && ( 0xCC == ((U8*)s)[4] ) ) && ( 0x81 == ((U8*)s)[5] ) ) ? 6 : 0 )\
588 : 0 ) \
589 : 0 ) \
590: ((e)-(s) > 3) ? \
591 ( ( ( ( ( 0xCE == ((U8*)s)[0] ) && ( 0xB7 == ((U8*)s)[1] ) ) && ( 0xCD == ((U8*)s)[2] ) ) && ( 0x82 == ((U8*)s)[3] ) ) ? 4 : 0 )\
592: 0 )
593
8770da0e 594
d10c72f2
KW
595#endif /* H_REGCHARCLASS */
596
58fbde93 597/* ex: set ro: */