This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Term::ANSIColor 1.12.
[perl5.git] / regcharclass.h
CommitLineData
58fbde93
RGS
1/* -*- buffer-read-only: t -*-
2 *
3 * regcharclass.h
4 *
5 * Copyright (C) 2007, by Larry Wall and others
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 !!!!!!!
11 * This file is built by Porting/regcharclass.pl.
12 * (Generated at: Mon Apr 23 12:29:30 2007 GMT)
13 * Any changes made here will be lost!
14 */
12b72891
RGS
15
16/*
17 LNBREAK: Line Break: \R
18
58fbde93 19 "\x0D\x0A" # CRLF - Network (Windows) line ending
12b72891
RGS
20 0x0A # LF | LINE FEED
21 0x0B # VT | VERTICAL TAB
22 0x0C # FF | FORM FEED
23 0x0D # CR | CARRIAGE RETURN
24 0x85 # NEL | NEXT LINE
25 0x2028 # LINE SEPARATOR
26 0x2029 # PARAGRAPH SEPARATOR
27*/
28/*** GENERATED CODE ***/
29#define is_LNBREAK(s,is_utf8) \
e1d1eefb
YO
30( ( ((U8*)s)[0]==13 ) ? \
31 ( ( ((U8*)s)[1]==10 ) ? 2 : 1 ) : \
32 ( (10<=((U8*)s)[0] && ((U8*)s)[0]<=12) ? 1 : \
33( (is_utf8) ? \
34 ( ( ((U8*)s)[0]==194 ) ? \
35 ( ( ((U8*)s)[1]==133 ) ? 2 : 0 ) : \
36 (((( ((U8*)s)[0]==226 ) && ( ((U8*)s)[1]==128 )) && ( ((U8*)s)[2]==168 || ((U8*)s)[2]==169 )) ? 3 : 0) ) :\
37 ( ((U8*)s)[0]==133 ) ) ) )
38
12b72891
RGS
39/*** GENERATED CODE ***/
40#define is_LNBREAK_safe(s,e,is_utf8) \
e1d1eefb
YO
41( ( (e) - (s) > 2 ) ? \
42 ( ( ((U8*)s)[0]==13 ) ? \
43 ( ( ((U8*)s)[1]==10 ) ? 2 : 1 ) : \
44 ( (10<=((U8*)s)[0] && ((U8*)s)[0]<=12) ? 1 : \
45( (is_utf8) ? \
46 ( ( ((U8*)s)[0]==194 ) ? \
47 ( ( ((U8*)s)[1]==133 ) ? 2 : 0 ) : \
48 (((( ((U8*)s)[0]==226 ) && ( ((U8*)s)[1]==128 )) && ( ((U8*)s)[2]==168 || ((U8*)s)[2]==169 )) ? 3 : 0) ) :\
49 ( ((U8*)s)[0]==133 ) ) ) ) : \
50( ( (e) - (s) > 1 ) ? \
51 ( ( ((U8*)s)[0]==13 ) ? \
52 ( ( ((U8*)s)[1]==10 ) ? 2 : 1 ) : \
53 ( (10<=((U8*)s)[0] && ((U8*)s)[0]<=12) ? 1 : \
54( (is_utf8) ? \
55 ((( ((U8*)s)[0]==194 ) && ( ((U8*)s)[1]==133 )) ? 2 : 0) : \
56 ( ((U8*)s)[0]==133 ) ) ) ) : \
57( ( (e) - (s) > 0 ) ? \
58 ( (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) ? 1 : \
59( (!is_utf8) ? \
60 ( ((U8*)s)[0]==133 ) : 0 ) ) : 0 ) ) )
61
12b72891
RGS
62/*** GENERATED CODE ***/
63#define is_LNBREAK_utf8(s) \
e1d1eefb
YO
64( ( ((U8*)s)[0]==194 ) ? \
65 ( ( ((U8*)s)[1]==133 ) ? 2 : 0 ) : \
66 ( ( ((U8*)s)[0]==226 ) ? \
67 ((( ((U8*)s)[1]==128 ) && ( ((U8*)s)[2]==168 || ((U8*)s)[2]==169 )) ? 3 : 0) :\
68 ( ( ((U8*)s)[0]==13 ) ? \
69 ( ( ((U8*)s)[1]==10 ) ? 2 : 1 ) : \
70 (10<=((U8*)s)[0] && ((U8*)s)[0]<=12) ) ) )
71
12b72891
RGS
72/*** GENERATED CODE ***/
73#define is_LNBREAK_utf8_safe(s,e) \
e1d1eefb
YO
74( ( (e) - (s) > 2 ) ? \
75 ( ( ((U8*)s)[0]==194 ) ? \
76 ( ( ((U8*)s)[1]==133 ) ? 2 : 0 ) : \
77 ( ( ((U8*)s)[0]==226 ) ? \
78 ((( ((U8*)s)[1]==128 ) && ( ((U8*)s)[2]==168 || ((U8*)s)[2]==169 )) ? 3 : 0) :\
79 ( ( ((U8*)s)[0]==13 ) ? \
80 ( ( ((U8*)s)[1]==10 ) ? 2 : 1 ) : \
81 (10<=((U8*)s)[0] && ((U8*)s)[0]<=12) ) ) ) : \
82( ( (e) - (s) > 1 ) ? \
83 ( ( ((U8*)s)[0]==194 ) ? \
84 ( ( ((U8*)s)[1]==133 ) ? 2 : 0 ) : \
85 ( ( ((U8*)s)[0]==13 ) ? \
86 ( ( ((U8*)s)[1]==10 ) ? 2 : 1 ) : \
87 (10<=((U8*)s)[0] && ((U8*)s)[0]<=12) ) ) : \
88( ( (e) - (s) > 0 ) ? \
89 (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) : 0 ) ) )
90
12b72891
RGS
91/*** GENERATED CODE ***/
92#define is_LNBREAK_latin1(s) \
e1d1eefb
YO
93( ( ((U8*)s)[0]==13 ) ? \
94 ( ( ((U8*)s)[1]==10 ) ? 2 : 1 ) : \
95 ( (10<=((U8*)s)[0] && ((U8*)s)[0]<=12) || ((U8*)s)[0]==133 ) )
96
12b72891
RGS
97/*** GENERATED CODE ***/
98#define is_LNBREAK_latin1_safe(s,e) \
e1d1eefb
YO
99( ( (e) - (s) > 1 ) ? \
100 ( ( ((U8*)s)[0]==13 ) ? \
101 ( ( ((U8*)s)[1]==10 ) ? 2 : 1 ) : \
102 ( (10<=((U8*)s)[0] && ((U8*)s)[0]<=12) || ((U8*)s)[0]==133 ) ) : \
103( ( (e) - (s) > 0 ) ? \
104 ( (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) || ((U8*)s)[0]==133 ) : 0 ) )
105
12b72891
RGS
106/*** GENERATED CODE ***/
107#define is_LNBREAK_cp(cp) \
108( (10<=cp && cp<=13) || ( cp > 13 && \
109( cp==133 || ( cp > 133 && \
110( cp==8232 || ( cp > 8232 && \
111cp==8233 ) ) ) ) ) )
112
113/*
114 HORIZWS: Horizontal Whitespace: \h \H
115
116 0x09 # HT
117 0x20 # SPACE
118 0xa0 # NBSP
119 0x1680 # OGHAM SPACE MARK
120 0x180e # MONGOLIAN VOWEL SEPARATOR
121 0x2000 # EN QUAD
122 0x2001 # EM QUAD
123 0x2002 # EN SPACE
124 0x2003 # EM SPACE
125 0x2004 # THREE-PER-EM SPACE
126 0x2005 # FOUR-PER-EM SPACE
127 0x2006 # SIX-PER-EM SPACE
128 0x2007 # FIGURE SPACE
129 0x2008 # PUNCTUATION SPACE
130 0x2009 # THIN SPACE
131 0x200A # HAIR SPACE
132 0x202f # NARROW NO-BREAK SPACE
133 0x205f # MEDIUM MATHEMATICAL SPACE
134 0x3000 # IDEOGRAPHIC SPACE
135*/
136/*** GENERATED CODE ***/
137#define is_HORIZWS(s,is_utf8) \
e1d1eefb
YO
138( ( ((U8*)s)[0]==9 || ((U8*)s)[0]==32 ) ? 1 : \
139( (is_utf8) ? \
140 ( ( ((U8*)s)[0]==194 ) ? \
141 ( ( ((U8*)s)[1]==160 ) ? 2 : 0 ) : \
142 ( ( ((U8*)s)[0]==225 ) ? \
143 ( ( ((U8*)s)[1]==160 ) ? \
144 ( ( ((U8*)s)[2]==142 ) ? 3 : 0 ) : \
145 ((( ((U8*)s)[1]==154 ) && ( ((U8*)s)[2]==128 )) ? 3 : 0) ) : \
146 ( ( ((U8*)s)[0]==226 ) ? \
147 ( ( ((U8*)s)[1]==129 ) ? \
148 ( ( ((U8*)s)[2]==159 ) ? 3 : 0 ) : \
149 ((( ((U8*)s)[1]==128 ) && ( (128<=((U8*)s)[2] && ((U8*)s)[2]<=138) || ((U8*)s)[2]==175 )) ? 3 : 0) ) :\
150 (((( ((U8*)s)[0]==227 ) && ( ((U8*)s)[1]==128 )) && ( ((U8*)s)[2]==128 )) ? 3 : 0) ) ) ) :\
151 ( ((U8*)s)[0]==160 ) ) )
152
12b72891
RGS
153/*** GENERATED CODE ***/
154#define is_HORIZWS_safe(s,e,is_utf8) \
e1d1eefb
YO
155( ( (e) - (s) > 2 ) ? \
156 ( ( ((U8*)s)[0]==9 || ((U8*)s)[0]==32 ) ? 1 : \
157( (is_utf8) ? \
158 ( ( ((U8*)s)[0]==194 ) ? \
159 ( ( ((U8*)s)[1]==160 ) ? 2 : 0 ) : \
160 ( ( ((U8*)s)[0]==225 ) ? \
161 ( ( ((U8*)s)[1]==160 ) ? \
162 ( ( ((U8*)s)[2]==142 ) ? 3 : 0 ) : \
163 ((( ((U8*)s)[1]==154 ) && ( ((U8*)s)[2]==128 )) ? 3 : 0) ) : \
164 ( ( ((U8*)s)[0]==226 ) ? \
165 ( ( ((U8*)s)[1]==129 ) ? \
166 ( ( ((U8*)s)[2]==159 ) ? 3 : 0 ) : \
167 ((( ((U8*)s)[1]==128 ) && ( (128<=((U8*)s)[2] && ((U8*)s)[2]<=138) || ((U8*)s)[2]==175 )) ? 3 : 0) ) :\
168 (((( ((U8*)s)[0]==227 ) && ( ((U8*)s)[1]==128 )) && ( ((U8*)s)[2]==128 )) ? 3 : 0) ) ) ) :\
169 ( ((U8*)s)[0]==160 ) ) ) : \
170( ( (e) - (s) > 1 ) ? \
171 ( ( ((U8*)s)[0]==9 || ((U8*)s)[0]==32 ) ? 1 : \
172( (is_utf8) ? \
173 ((( ((U8*)s)[0]==194 ) && ( ((U8*)s)[1]==160 )) ? 2 : 0) : \
174 ( ((U8*)s)[0]==160 ) ) ) : \
175( ( (e) - (s) > 0 ) ? \
176 ( ( ((U8*)s)[0]==9 || ((U8*)s)[0]==32 ) ? 1 : \
177( (!is_utf8) ? \
178 ( ((U8*)s)[0]==160 ) : 0 ) ) : 0 ) ) )
179
12b72891
RGS
180/*** GENERATED CODE ***/
181#define is_HORIZWS_utf8(s) \
e1d1eefb
YO
182( ( ((U8*)s)[0]==194 ) ? \
183 ( ( ((U8*)s)[1]==160 ) ? 2 : 0 ) : \
184 ( ( ((U8*)s)[0]==225 ) ? \
185 ( ( ((U8*)s)[1]==160 ) ? \
186 ( ( ((U8*)s)[2]==142 ) ? 3 : 0 ) : \
187 ((( ((U8*)s)[1]==154 ) && ( ((U8*)s)[2]==128 )) ? 3 : 0) ) : \
188 ( ( ((U8*)s)[0]==226 ) ? \
189 ( ( ((U8*)s)[1]==129 ) ? \
190 ( ( ((U8*)s)[2]==159 ) ? 3 : 0 ) : \
191 ((( ((U8*)s)[1]==128 ) && ( (128<=((U8*)s)[2] && ((U8*)s)[2]<=138) || ((U8*)s)[2]==175 )) ? 3 : 0) ) :\
192 ( ( ((U8*)s)[0]==227 ) ? \
193 ((( ((U8*)s)[1]==128 ) && ( ((U8*)s)[2]==128 )) ? 3 : 0) : \
194 ( ((U8*)s)[0]==9 || ((U8*)s)[0]==32 ) ) ) ) )
195
12b72891
RGS
196/*** GENERATED CODE ***/
197#define is_HORIZWS_utf8_safe(s,e) \
e1d1eefb
YO
198( ( (e) - (s) > 2 ) ? \
199 ( ( ((U8*)s)[0]==194 ) ? \
200 ( ( ((U8*)s)[1]==160 ) ? 2 : 0 ) : \
201 ( ( ((U8*)s)[0]==225 ) ? \
202 ( ( ((U8*)s)[1]==160 ) ? \
203 ( ( ((U8*)s)[2]==142 ) ? 3 : 0 ) : \
204 ((( ((U8*)s)[1]==154 ) && ( ((U8*)s)[2]==128 )) ? 3 : 0) ) : \
205 ( ( ((U8*)s)[0]==226 ) ? \
206 ( ( ((U8*)s)[1]==129 ) ? \
207 ( ( ((U8*)s)[2]==159 ) ? 3 : 0 ) : \
208 ((( ((U8*)s)[1]==128 ) && ( (128<=((U8*)s)[2] && ((U8*)s)[2]<=138) || ((U8*)s)[2]==175 )) ? 3 : 0) ) :\
209 ( ( ((U8*)s)[0]==227 ) ? \
210 ((( ((U8*)s)[1]==128 ) && ( ((U8*)s)[2]==128 )) ? 3 : 0) : \
211 ( ((U8*)s)[0]==9 || ((U8*)s)[0]==32 ) ) ) ) ) : \
212( ( (e) - (s) > 1 ) ? \
213 ( ( ((U8*)s)[0]==194 ) ? \
214 ( ( ((U8*)s)[1]==160 ) ? 2 : 0 ) : \
215 ( ((U8*)s)[0]==9 || ((U8*)s)[0]==32 ) ) : \
216( ( (e) - (s) > 0 ) ? \
217 ( ((U8*)s)[0]==9 || ((U8*)s)[0]==32 ) : 0 ) ) )
218
12b72891
RGS
219/*** GENERATED CODE ***/
220#define is_HORIZWS_latin1(s) \
e1d1eefb
YO
221( ((U8*)s)[0]==9 || ((U8*)s)[0]==32 || ((U8*)s)[0]==160 )
222
12b72891
RGS
223/*** GENERATED CODE ***/
224#define is_HORIZWS_latin1_safe(s,e) \
e1d1eefb
YO
225( ( (e) - (s) > 0 ) ? \
226 ( ((U8*)s)[0]==9 || ((U8*)s)[0]==32 || ((U8*)s)[0]==160 ) : 0 )
227
12b72891
RGS
228/*** GENERATED CODE ***/
229#define is_HORIZWS_cp(cp) \
230( cp==9 || ( cp > 9 && \
231( cp==32 || ( cp > 32 && \
232( cp==160 || ( cp > 160 && \
233( cp==5760 || ( cp > 5760 && \
234( cp==6158 || ( cp > 6158 && \
235( (8192<=cp && cp<=8202) || ( cp > 8202 && \
236( cp==8239 || ( cp > 8239 && \
237( cp==8287 || ( cp > 8287 && \
238cp==12288 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )
e1d1eefb 239
12b72891
RGS
240/*
241 VERTWS: Vertical Whitespace: \v \V
e1d1eefb 242
12b72891
RGS
243 0x0A # LF
244 0x0B # VT
58fbde93 245 0x0C # FF
12b72891
RGS
246 0x0D # CR
247 0x85 # NEL
248 0x2028 # LINE SEPARATOR
249 0x2029 # PARAGRAPH SEPARATOR
250*/
251/*** GENERATED CODE ***/
252#define is_VERTWS(s,is_utf8) \
e1d1eefb
YO
253( (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) ? 1 : \
254( (is_utf8) ? \
255 ( ( ((U8*)s)[0]==194 ) ? \
256 ( ( ((U8*)s)[1]==133 ) ? 2 : 0 ) : \
257 (((( ((U8*)s)[0]==226 ) && ( ((U8*)s)[1]==128 )) && ( ((U8*)s)[2]==168 || ((U8*)s)[2]==169 )) ? 3 : 0) ) :\
258 ( ((U8*)s)[0]==133 ) ) )
259
12b72891
RGS
260/*** GENERATED CODE ***/
261#define is_VERTWS_safe(s,e,is_utf8) \
e1d1eefb
YO
262( ( (e) - (s) > 2 ) ? \
263 ( (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) ? 1 : \
264( (is_utf8) ? \
265 ( ( ((U8*)s)[0]==194 ) ? \
266 ( ( ((U8*)s)[1]==133 ) ? 2 : 0 ) : \
267 (((( ((U8*)s)[0]==226 ) && ( ((U8*)s)[1]==128 )) && ( ((U8*)s)[2]==168 || ((U8*)s)[2]==169 )) ? 3 : 0) ) :\
268 ( ((U8*)s)[0]==133 ) ) ) : \
269( ( (e) - (s) > 1 ) ? \
270 ( (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) ? 1 : \
271( (is_utf8) ? \
272 ((( ((U8*)s)[0]==194 ) && ( ((U8*)s)[1]==133 )) ? 2 : 0) : \
273 ( ((U8*)s)[0]==133 ) ) ) : \
274( ( (e) - (s) > 0 ) ? \
275 ( (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) ? 1 : \
276( (!is_utf8) ? \
277 ( ((U8*)s)[0]==133 ) : 0 ) ) : 0 ) ) )
278
12b72891
RGS
279/*** GENERATED CODE ***/
280#define is_VERTWS_utf8(s) \
e1d1eefb
YO
281( ( ((U8*)s)[0]==194 ) ? \
282 ( ( ((U8*)s)[1]==133 ) ? 2 : 0 ) : \
283 ( ( ((U8*)s)[0]==226 ) ? \
284 ((( ((U8*)s)[1]==128 ) && ( ((U8*)s)[2]==168 || ((U8*)s)[2]==169 )) ? 3 : 0) :\
285 (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) ) )
286
12b72891
RGS
287/*** GENERATED CODE ***/
288#define is_VERTWS_utf8_safe(s,e) \
e1d1eefb
YO
289( ( (e) - (s) > 2 ) ? \
290 ( ( ((U8*)s)[0]==194 ) ? \
291 ( ( ((U8*)s)[1]==133 ) ? 2 : 0 ) : \
292 ( ( ((U8*)s)[0]==226 ) ? \
293 ((( ((U8*)s)[1]==128 ) && ( ((U8*)s)[2]==168 || ((U8*)s)[2]==169 )) ? 3 : 0) :\
294 (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) ) ) : \
295( ( (e) - (s) > 1 ) ? \
296 ( ( ((U8*)s)[0]==194 ) ? \
297 ( ( ((U8*)s)[1]==133 ) ? 2 : 0 ) : \
298 (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) ) : \
299( ( (e) - (s) > 0 ) ? \
300 (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) : 0 ) ) )
301
12b72891
RGS
302/*** GENERATED CODE ***/
303#define is_VERTWS_latin1(s) \
e1d1eefb
YO
304( (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) || ((U8*)s)[0]==133 )
305
12b72891
RGS
306/*** GENERATED CODE ***/
307#define is_VERTWS_latin1_safe(s,e) \
e1d1eefb
YO
308( ( (e) - (s) > 0 ) ? \
309 ( (10<=((U8*)s)[0] && ((U8*)s)[0]<=13) || ((U8*)s)[0]==133 ) : 0 )
310
12b72891
RGS
311/*** GENERATED CODE ***/
312#define is_VERTWS_cp(cp) \
313( (10<=cp && cp<=13) || ( cp > 13 && \
314( cp==133 || ( cp > 133 && \
315( cp==8232 || ( cp > 8232 && \
316cp==8233 ) ) ) ) ) )
e1d1eefb 317
58fbde93 318/* ex: set ro: */