Compact syntax parsing fixes
[cxml-rng.git] / unicode.lisp
blob0a53f7bccb1213bad72b4e015f91b8a7e1bbcab1
1 ;;; -*- show-trailing-whitespace: t; indent-tabs: nil -*-
3 ;;; Copyright (c) 2007 David Lichteblau. All rights reserved.
5 ;;; Redistribution and use in source and binary forms, with or without
6 ;;; modification, are permitted provided that the following conditions
7 ;;; are met:
8 ;;;
9 ;;; * Redistributions of source code must retain the above copyright
10 ;;; notice, this list of conditions and the following disclaimer.
11 ;;;
12 ;;; * Redistributions in binary form must reproduce the above
13 ;;; copyright notice, this list of conditions and the following
14 ;;; disclaimer in the documentation and/or other materials
15 ;;; provided with the distribution.
16 ;;;
17 ;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
18 ;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 ;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 ;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
21 ;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 ;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 ;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 ;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 ;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 (in-package :cxml-types)
31 ;;; FIXME: On Lisps using UTF-16 characters, we are unable to recognize
32 ;;; ranges including code points above #x10000. To do so, we would have
33 ;;; to check for substrings of up to two characters rather than individual
34 ;;; characters.
36 (eval-when (:compile-toplevel :load-toplevel :execute)
37 (defconstant +limit-1+ (1- cl-ppcre::*regex-char-code-limit*)))
39 (defconstant +1+ (code-char 1))
41 (defmacro defranges (name form)
42 `(progn
43 (defparameter ,name ,form)
44 (defun ,name (character)
45 (some (lambda (range)
46 (<= (char-code (second range))
47 (char-code character)
48 (char-code (third range))))
49 ,name))
50 (setf (cl-ppcre:parse-tree-synonym ',name) (cons :char-class ,name))))
52 (defmacro defblock (name min max)
53 (let ((ranges
54 (when (and (code-char min)
55 (code-char max))
56 `((:range ,(code-char min) ,(code-char max))))))
57 `(defranges ,name ',ranges)))
59 (defun massage-ranges (l)
60 (mapcan (lambda (x)
61 (let ((a (code-char (car x)))
62 (b (code-char (cadr x))))
63 (if (and a b)
64 (list (list :range a b))
65 '())))
66 l))
68 (defun range- (a b)
69 (destructuring-bind (amin amax) (mapcar #'char-code (cdr a))
70 (destructuring-bind (bmin bmax) (mapcar #'char-code (cdr b))
71 (incf amax)
72 (incf bmax)
73 (let ((result nil))
74 (labels ((range* (min max)
75 (when (and (< min max)
76 (code-char min)
77 (code-char (1- max))
78 #-rune-is-utf-16
79 (not (or (<= #xD800 min #xDFFF)
80 (<= #xD800 (1- max) #xDFFF)))
81 #+rune-is-utf-16
82 ;; FIXME: See surrogate comment above.
83 (< max #x10000))
84 (push (list :range (code-char min) (code-char (1- max)))
85 result))))
86 (range* amin (min bmin amax))
87 (range* (max amin bmax) amax))
88 result))))
90 (defun ranges-range (aa b)
91 (mapcan (lambda (a) (range- a b)) aa))
93 (defun ranges- (aa &rest bb)
94 (dolist (b bb)
95 (dolist (l b)
96 (setf aa (ranges-range aa l))))
97 aa)
99 (defblock |p{isBasicLatin}| 0 127)
100 (defblock |p{isLatin-1Supplement}| 128 255)
101 (defblock |p{isLatinExtended-A}| 256 383)
102 (defblock |p{isLatinExtended-B}| 384 591)
103 (defblock |p{isIPAExtensions}| 592 687)
104 (defblock |p{isSpacingModifierLetters}| 688 767)
105 (defblock |p{isCombiningDiacriticalMarks}| 768 879)
106 (defblock |p{isGreek}| 880 1023)
107 (defblock |p{isCyrillic}| 1024 1279)
108 (defblock |p{isArmenian}| 1328 1423)
109 (defblock |p{isHebrew}| 1424 1535)
110 (defblock |p{isArabic}| 1536 1791)
111 (defblock |p{isSyriac}| 1792 1871)
112 (defblock |p{isThaana}| 1920 1983)
113 (defblock |p{isDevanagari}| 2304 2431)
114 (defblock |p{isBengali}| 2432 2559)
115 (defblock |p{isGurmukhi}| 2560 2687)
116 (defblock |p{isGujarati}| 2688 2815)
117 (defblock |p{isOriya}| 2816 2943)
118 (defblock |p{isTamil}| 2944 3071)
119 (defblock |p{isTelugu}| 3072 3199)
120 (defblock |p{isKannada}| 3200 3327)
121 (defblock |p{isMalayalam}| 3328 3455)
122 (defblock |p{isSinhala}| 3456 3583)
123 (defblock |p{isThai}| 3584 3711)
124 (defblock |p{isLao}| 3712 3839)
125 (defblock |p{isTibetan}| 3840 4095)
126 (defblock |p{isMyanmar}| 4096 4255)
127 (defblock |p{isGeorgian}| 4256 4351)
128 (defblock |p{isHangulJamo}| 4352 4607)
129 (defblock |p{isEthiopic}| 4608 4991)
130 (defblock |p{isCherokee}| 5024 5119)
131 (defblock |p{isUnifiedCanadianAboriginalSyllabics}| 5120 5759)
132 (defblock |p{isOgham}| 5760 5791)
133 (defblock |p{isRunic}| 5792 5887)
134 (defblock |p{isKhmer}| 6016 6143)
135 (defblock |p{isMongolian}| 6144 6319)
136 (defblock |p{isLatinExtendedAdditional}| 7680 7935)
137 (defblock |p{isGreekExtended}| 7936 8191)
138 (defblock |p{isGeneralPunctuation}| 8192 8303)
139 (defblock |p{isSuperscriptsandSubscripts}| 8304 8351)
140 (defblock |p{isCurrencySymbols}| 8352 8399)
141 (defblock |p{isCombiningMarksforSymbols}| 8400 8447)
142 (defblock |p{isLetterlikeSymbols}| 8448 8527)
143 (defblock |p{isNumberForms}| 8528 8591)
144 (defblock |p{isArrows}| 8592 8703)
145 (defblock |p{isMathematicalOperators}| 8704 8959)
146 (defblock |p{isMiscellaneousTechnical}| 8960 9215)
147 (defblock |p{isControlPictures}| 9216 9279)
148 (defblock |p{isOpticalCharacterRecognition}| 9280 9311)
149 (defblock |p{isEnclosedAlphanumerics}| 9312 9471)
150 (defblock |p{isBoxDrawing}| 9472 9599)
151 (defblock |p{isBlockElements}| 9600 9631)
152 (defblock |p{isGeometricShapes}| 9632 9727)
153 (defblock |p{isMiscellaneousSymbols}| 9728 9983)
154 (defblock |p{isDingbats}| 9984 10175)
155 (defblock |p{isBraillePatterns}| 10240 10495)
156 (defblock |p{isCJKRadicalsSupplement}| 11904 12031)
157 (defblock |p{isKangxiRadicals}| 12032 12255)
158 (defblock |p{isIdeographicDescriptionCharacters}| 12272 12287)
159 (defblock |p{isCJKSymbolsandPunctuation}| 12288 12351)
160 (defblock |p{isHiragana}| 12352 12447)
161 (defblock |p{isKatakana}| 12448 12543)
162 (defblock |p{isBopomofo}| 12544 12591)
163 (defblock |p{isHangulCompatibilityJamo}| 12592 12687)
164 (defblock |p{isKanbun}| 12688 12703)
165 (defblock |p{isBopomofoExtended}| 12704 12735)
166 (defblock |p{isEnclosedCJKLettersandMonths}| 12800 13055)
167 (defblock |p{isCJKCompatibility}| 13056 13311)
168 (defblock |p{isCJKUnifiedIdeographsExtensionA}| 13312 19893)
169 (defblock |p{isCJKUnifiedIdeographs}| 19968 40959)
170 (defblock |p{isYiSyllables}| 40960 42127)
171 (defblock |p{isYiRadicals}| 42128 42191)
172 (defblock |p{isHangulSyllables}| 44032 55203)
173 (defblock |p{isPrivateUse}| 57344 63743)
174 (defblock |p{isCJKCompatibilityIdeographs}| 63744 64255)
175 (defblock |p{isAlphabeticPresentationForms}| 64256 64335)
176 (defblock |p{isArabicPresentationForms-A}| 64336 65023)
177 (defblock |p{isCombiningHalfMarks}| 65056 65071)
178 (defblock |p{isCJKCompatibilityForms}| 65072 65103)
179 (defblock |p{isSmallFormVariants}| 65104 65135)
180 (defblock |p{isArabicPresentationForms-B}| 65136 65278)
181 (defblock |p{isHalfwidthandFullwidthForms}| 65280 65519)
183 ;; FIXME: which one is correct?
184 ;; (defblock |p{isSpecials}| 65279 65279)
185 (defblock |p{isSpecials}| 65520 65533)
187 (DEFRANGES |p{Lu}|
188 (MASSAGE-RANGES
189 '((65 90) (192 214) (216 222) (256 256) (258 258) (260 260) (262 262)
190 (264 264) (266 266) (268 268) (270 270) (272 272) (274 274) (276 276)
191 (278 278) (280 280) (282 282) (284 284) (286 286) (288 288) (290 290)
192 (292 292) (294 294) (296 296) (298 298) (300 300) (302 302) (304 304)
193 (306 306) (308 308) (310 310) (313 313) (315 315) (317 317) (319 319)
194 (321 321) (323 323) (325 325) (327 327) (330 330) (332 332) (334 334)
195 (336 336) (338 338) (340 340) (342 342) (344 344) (346 346) (348 348)
196 (350 350) (352 352) (354 354) (356 356) (358 358) (360 360) (362 362)
197 (364 364) (366 366) (368 368) (370 370) (372 372) (374 374) (376 377)
198 (379 379) (381 381) (385 386) (388 388) (390 391) (393 395) (398 401)
199 (403 404) (406 408) (412 413) (415 416) (418 418) (420 420) (422 423)
200 (425 425) (428 428) (430 431) (433 435) (437 437) (439 440) (444 444)
201 (452 452) (455 455) (458 458) (461 461) (463 463) (465 465) (467 467)
202 (469 469) (471 471) (473 473) (475 475) (478 478) (480 480) (482 482)
203 (484 484) (486 486) (488 488) (490 490) (492 492) (494 494) (497 497)
204 (500 500) (502 504) (506 506) (508 508) (510 510) (512 512) (514 514)
205 (516 516) (518 518) (520 520) (522 522) (524 524) (526 526) (528 528)
206 (530 530) (532 532) (534 534) (536 536) (538 538) (540 540) (542 542)
207 (546 546) (548 548) (550 550) (552 552) (554 554) (556 556) (558 558)
208 (560 560) (562 562) (902 902) (904 906) (908 908) (910 911) (913 929)
209 (931 939) (978 980) (986 986) (988 988) (990 990) (992 992) (994 994)
210 (996 996) (998 998) (1000 1000) (1002 1002) (1004 1004) (1006 1006)
211 (1012 1012) (1024 1071) (1120 1120) (1122 1122) (1124 1124)
212 (1126 1126) (1128 1128) (1130 1130) (1132 1132) (1134 1134)
213 (1136 1136) (1138 1138) (1140 1140) (1142 1142) (1144 1144)
214 (1146 1146) (1148 1148) (1150 1150) (1152 1152) (1164 1164)
215 (1166 1166) (1168 1168) (1170 1170) (1172 1172) (1174 1174)
216 (1176 1176) (1178 1178) (1180 1180) (1182 1182) (1184 1184)
217 (1186 1186) (1188 1188) (1190 1190) (1192 1192) (1194 1194)
218 (1196 1196) (1198 1198) (1200 1200) (1202 1202) (1204 1204)
219 (1206 1206) (1208 1208) (1210 1210) (1212 1212) (1214 1214)
220 (1216 1217) (1219 1219) (1223 1223) (1227 1227) (1232 1232)
221 (1234 1234) (1236 1236) (1238 1238) (1240 1240) (1242 1242)
222 (1244 1244) (1246 1246) (1248 1248) (1250 1250) (1252 1252)
223 (1254 1254) (1256 1256) (1258 1258) (1260 1260) (1262 1262)
224 (1264 1264) (1266 1266) (1268 1268) (1272 1272) (1329 1366)
225 (4256 4293) (7680 7680) (7682 7682) (7684 7684) (7686 7686)
226 (7688 7688) (7690 7690) (7692 7692) (7694 7694) (7696 7696)
227 (7698 7698) (7700 7700) (7702 7702) (7704 7704) (7706 7706)
228 (7708 7708) (7710 7710) (7712 7712) (7714 7714) (7716 7716)
229 (7718 7718) (7720 7720) (7722 7722) (7724 7724) (7726 7726)
230 (7728 7728) (7730 7730) (7732 7732) (7734 7734) (7736 7736)
231 (7738 7738) (7740 7740) (7742 7742) (7744 7744) (7746 7746)
232 (7748 7748) (7750 7750) (7752 7752) (7754 7754) (7756 7756)
233 (7758 7758) (7760 7760) (7762 7762) (7764 7764) (7766 7766)
234 (7768 7768) (7770 7770) (7772 7772) (7774 7774) (7776 7776)
235 (7778 7778) (7780 7780) (7782 7782) (7784 7784) (7786 7786)
236 (7788 7788) (7790 7790) (7792 7792) (7794 7794) (7796 7796)
237 (7798 7798) (7800 7800) (7802 7802) (7804 7804) (7806 7806)
238 (7808 7808) (7810 7810) (7812 7812) (7814 7814) (7816 7816)
239 (7818 7818) (7820 7820) (7822 7822) (7824 7824) (7826 7826)
240 (7828 7828) (7840 7840) (7842 7842) (7844 7844) (7846 7846)
241 (7848 7848) (7850 7850) (7852 7852) (7854 7854) (7856 7856)
242 (7858 7858) (7860 7860) (7862 7862) (7864 7864) (7866 7866)
243 (7868 7868) (7870 7870) (7872 7872) (7874 7874) (7876 7876)
244 (7878 7878) (7880 7880) (7882 7882) (7884 7884) (7886 7886)
245 (7888 7888) (7890 7890) (7892 7892) (7894 7894) (7896 7896)
246 (7898 7898) (7900 7900) (7902 7902) (7904 7904) (7906 7906)
247 (7908 7908) (7910 7910) (7912 7912) (7914 7914) (7916 7916)
248 (7918 7918) (7920 7920) (7922 7922) (7924 7924) (7926 7926)
249 (7928 7928) (7944 7951) (7960 7965) (7976 7983) (7992 7999)
250 (8008 8013) (8025 8025) (8027 8027) (8029 8029) (8031 8031)
251 (8040 8047) (8120 8123) (8136 8139) (8152 8155) (8168 8172)
252 (8184 8187) (8450 8450) (8455 8455) (8459 8461) (8464 8466)
253 (8469 8469) (8473 8477) (8484 8484) (8486 8486) (8488 8488)
254 (8490 8493) (8496 8497) (8499 8499) (65313 65338) (66560 66597)
255 (119808 119833) (119860 119885) (119912 119937) (119964 119964)
256 (119966 119967) (119970 119970) (119973 119974) (119977 119980)
257 (119982 119989) (120016 120041) (120068 120069) (120071 120074)
258 (120077 120084) (120086 120092) (120120 120121) (120123 120126)
259 (120128 120132) (120134 120134) (120138 120144) (120172 120197)
260 (120224 120249) (120276 120301) (120328 120353) (120380 120405)
261 (120432 120457) (120488 120512) (120546 120570) (120604 120628)
262 (120662 120686) (120720 120744))))
264 (DEFRANGES |p{Ll}|
265 (MASSAGE-RANGES
266 '((97 122) (170 170) (181 181) (186 186) (223 246) (248 255) (257 257)
267 (259 259) (261 261) (263 263) (265 265) (267 267) (269 269) (271 271)
268 (273 273) (275 275) (277 277) (279 279) (281 281) (283 283) (285 285)
269 (287 287) (289 289) (291 291) (293 293) (295 295) (297 297) (299 299)
270 (301 301) (303 303) (305 305) (307 307) (309 309) (311 312) (314 314)
271 (316 316) (318 318) (320 320) (322 322) (324 324) (326 326) (328 329)
272 (331 331) (333 333) (335 335) (337 337) (339 339) (341 341) (343 343)
273 (345 345) (347 347) (349 349) (351 351) (353 353) (355 355) (357 357)
274 (359 359) (361 361) (363 363) (365 365) (367 367) (369 369) (371 371)
275 (373 373) (375 375) (378 378) (380 380) (382 384) (387 387) (389 389)
276 (392 392) (396 397) (402 402) (405 405) (409 411) (414 414) (417 417)
277 (419 419) (421 421) (424 424) (426 427) (429 429) (432 432) (436 436)
278 (438 438) (441 442) (445 447) (454 454) (457 457) (460 460) (462 462)
279 (464 464) (466 466) (468 468) (470 470) (472 472) (474 474) (476 477)
280 (479 479) (481 481) (483 483) (485 485) (487 487) (489 489) (491 491)
281 (493 493) (495 496) (499 499) (501 501) (505 505) (507 507) (509 509)
282 (511 511) (513 513) (515 515) (517 517) (519 519) (521 521) (523 523)
283 (525 525) (527 527) (529 529) (531 531) (533 533) (535 535) (537 537)
284 (539 539) (541 541) (543 543) (547 547) (549 549) (551 551) (553 553)
285 (555 555) (557 557) (559 559) (561 561) (563 563) (592 685) (912 912)
286 (940 974) (976 977) (981 983) (987 987) (989 989) (991 991) (993 993)
287 (995 995) (997 997) (999 999) (1001 1001) (1003 1003) (1005 1005)
288 (1007 1011) (1013 1013) (1072 1119) (1121 1121) (1123 1123)
289 (1125 1125) (1127 1127) (1129 1129) (1131 1131) (1133 1133)
290 (1135 1135) (1137 1137) (1139 1139) (1141 1141) (1143 1143)
291 (1145 1145) (1147 1147) (1149 1149) (1151 1151) (1153 1153)
292 (1165 1165) (1167 1167) (1169 1169) (1171 1171) (1173 1173)
293 (1175 1175) (1177 1177) (1179 1179) (1181 1181) (1183 1183)
294 (1185 1185) (1187 1187) (1189 1189) (1191 1191) (1193 1193)
295 (1195 1195) (1197 1197) (1199 1199) (1201 1201) (1203 1203)
296 (1205 1205) (1207 1207) (1209 1209) (1211 1211) (1213 1213)
297 (1215 1215) (1218 1218) (1220 1220) (1224 1224) (1228 1228)
298 (1233 1233) (1235 1235) (1237 1237) (1239 1239) (1241 1241)
299 (1243 1243) (1245 1245) (1247 1247) (1249 1249) (1251 1251)
300 (1253 1253) (1255 1255) (1257 1257) (1259 1259) (1261 1261)
301 (1263 1263) (1265 1265) (1267 1267) (1269 1269) (1273 1273)
302 (1377 1415) (7681 7681) (7683 7683) (7685 7685) (7687 7687)
303 (7689 7689) (7691 7691) (7693 7693) (7695 7695) (7697 7697)
304 (7699 7699) (7701 7701) (7703 7703) (7705 7705) (7707 7707)
305 (7709 7709) (7711 7711) (7713 7713) (7715 7715) (7717 7717)
306 (7719 7719) (7721 7721) (7723 7723) (7725 7725) (7727 7727)
307 (7729 7729) (7731 7731) (7733 7733) (7735 7735) (7737 7737)
308 (7739 7739) (7741 7741) (7743 7743) (7745 7745) (7747 7747)
309 (7749 7749) (7751 7751) (7753 7753) (7755 7755) (7757 7757)
310 (7759 7759) (7761 7761) (7763 7763) (7765 7765) (7767 7767)
311 (7769 7769) (7771 7771) (7773 7773) (7775 7775) (7777 7777)
312 (7779 7779) (7781 7781) (7783 7783) (7785 7785) (7787 7787)
313 (7789 7789) (7791 7791) (7793 7793) (7795 7795) (7797 7797)
314 (7799 7799) (7801 7801) (7803 7803) (7805 7805) (7807 7807)
315 (7809 7809) (7811 7811) (7813 7813) (7815 7815) (7817 7817)
316 (7819 7819) (7821 7821) (7823 7823) (7825 7825) (7827 7827)
317 (7829 7835) (7841 7841) (7843 7843) (7845 7845) (7847 7847)
318 (7849 7849) (7851 7851) (7853 7853) (7855 7855) (7857 7857)
319 (7859 7859) (7861 7861) (7863 7863) (7865 7865) (7867 7867)
320 (7869 7869) (7871 7871) (7873 7873) (7875 7875) (7877 7877)
321 (7879 7879) (7881 7881) (7883 7883) (7885 7885) (7887 7887)
322 (7889 7889) (7891 7891) (7893 7893) (7895 7895) (7897 7897)
323 (7899 7899) (7901 7901) (7903 7903) (7905 7905) (7907 7907)
324 (7909 7909) (7911 7911) (7913 7913) (7915 7915) (7917 7917)
325 (7919 7919) (7921 7921) (7923 7923) (7925 7925) (7927 7927)
326 (7929 7929) (7936 7943) (7952 7957) (7968 7975) (7984 7991)
327 (8000 8005) (8016 8023) (8032 8039) (8048 8061) (8064 8071)
328 (8080 8087) (8096 8103) (8112 8116) (8118 8119) (8126 8126)
329 (8130 8132) (8134 8135) (8144 8147) (8150 8151) (8160 8167)
330 (8178 8180) (8182 8183) (8319 8319) (8458 8458) (8462 8463)
331 (8467 8467) (8495 8495) (8500 8500) (8505 8505) (64256 64262)
332 (64275 64279) (65345 65370) (66600 66637) (119834 119859)
333 (119886 119892) (119894 119911) (119938 119963) (119990 119993)
334 (119995 119995) (119997 120000) (120002 120003) (120005 120015)
335 (120042 120067) (120094 120119) (120146 120171) (120198 120223)
336 (120250 120275) (120302 120327) (120354 120379) (120406 120431)
337 (120458 120483) (120514 120538) (120540 120545) (120572 120596)
338 (120598 120603) (120630 120654) (120656 120661) (120688 120712)
339 (120714 120719) (120746 120770) (120772 120777))))
341 (DEFRANGES |p{Lt}|
342 (MASSAGE-RANGES
343 '((453 453) (456 456) (459 459) (498 498) (8072 8079) (8088 8095)
344 (8104 8111) (8124 8124) (8140 8140) (8188 8188))))
346 (DEFRANGES |p{Lm}|
347 (MASSAGE-RANGES
348 '((688 696) (699 705) (720 721) (736 740) (750 750) (890 890)
349 (1369 1369) (1600 1600) (1765 1766) (3654 3654) (3782 3782)
350 (6211 6211) (12293 12293) (12337 12341) (12445 12446) (12540 12542)
351 (65392 65392) (65438 65439))))
353 (DEFRANGES |p{Lo}|
354 (MASSAGE-RANGES
355 '((443 443) (448 451) (1488 1514) (1520 1522) (1569 1594) (1601 1610)
356 (1649 1747) (1749 1749) (1786 1788) (1808 1808) (1810 1836)
357 (1920 1957) (2309 2361) (2365 2365) (2384 2384) (2392 2401)
358 (2437 2444) (2447 2448) (2451 2472) (2474 2480) (2482 2482)
359 (2486 2489) (2524 2525) (2527 2529) (2544 2545) (2565 2570)
360 (2575 2576) (2579 2600) (2602 2608) (2610 2611) (2613 2614)
361 (2616 2617) (2649 2652) (2654 2654) (2674 2676) (2693 2699)
362 (2701 2701) (2703 2705) (2707 2728) (2730 2736) (2738 2739)
363 (2741 2745) (2749 2749) (2768 2768) (2784 2784) (2821 2828)
364 (2831 2832) (2835 2856) (2858 2864) (2866 2867) (2870 2873)
365 (2877 2877) (2908 2909) (2911 2913) (2949 2954) (2958 2960)
366 (2962 2965) (2969 2970) (2972 2972) (2974 2975) (2979 2980)
367 (2984 2986) (2990 2997) (2999 3001) (3077 3084) (3086 3088)
368 (3090 3112) (3114 3123) (3125 3129) (3168 3169) (3205 3212)
369 (3214 3216) (3218 3240) (3242 3251) (3253 3257) (3294 3294)
370 (3296 3297) (3333 3340) (3342 3344) (3346 3368) (3370 3385)
371 (3424 3425) (3461 3478) (3482 3505) (3507 3515) (3517 3517)
372 (3520 3526) (3585 3632) (3634 3635) (3648 3653) (3713 3714)
373 (3716 3716) (3719 3720) (3722 3722) (3725 3725) (3732 3735)
374 (3737 3743) (3745 3747) (3749 3749) (3751 3751) (3754 3755)
375 (3757 3760) (3762 3763) (3773 3773) (3776 3780) (3804 3805)
376 (3840 3840) (3904 3911) (3913 3946) (3976 3979) (4096 4129)
377 (4131 4135) (4137 4138) (4176 4181) (4304 4342) (4352 4441)
378 (4447 4514) (4520 4601) (4608 4614) (4616 4678) (4680 4680)
379 (4682 4685) (4688 4694) (4696 4696) (4698 4701) (4704 4742)
380 (4744 4744) (4746 4749) (4752 4782) (4784 4784) (4786 4789)
381 (4792 4798) (4800 4800) (4802 4805) (4808 4814) (4816 4822)
382 (4824 4846) (4848 4878) (4880 4880) (4882 4885) (4888 4894)
383 (4896 4934) (4936 4954) (5024 5108) (5121 5740) (5743 5750)
384 (5761 5786) (5792 5866) (6016 6067) (6176 6210) (6212 6263)
385 (6272 6312) (8501 8504) (12294 12294) (12353 12436) (12449 12538)
386 (12549 12588) (12593 12686) (12704 12727) (13312 19893) (19968 40869)
387 (40960 42124) (44032 55203) (63744 64045) (64285 64285) (64287 64296)
388 (64298 64310) (64312 64316) (64318 64318) (64320 64321) (64323 64324)
389 (64326 64433) (64467 64829) (64848 64911) (64914 64967) (65008 65019)
390 (65136 65138) (65140 65140) (65142 65276) (65382 65391) (65393 65437)
391 (65440 65470) (65474 65479) (65482 65487) (65490 65495) (65498 65500)
392 (66304 66334) (66352 66377) (131072 173782) (194560 195101))))
394 (DEFRANGES |p{Mn}|
395 (MASSAGE-RANGES
396 '((768 846) (864 866) (1155 1158) (1425 1441) (1443 1465) (1467 1469)
397 (1471 1471) (1473 1474) (1476 1476) (1611 1621) (1648 1648)
398 (1750 1756) (1759 1764) (1767 1768) (1770 1773) (1809 1809)
399 (1840 1866) (1958 1968) (2305 2306) (2364 2364) (2369 2376)
400 (2381 2381) (2385 2388) (2402 2403) (2433 2433) (2492 2492)
401 (2497 2500) (2509 2509) (2530 2531) (2562 2562) (2620 2620)
402 (2625 2626) (2631 2632) (2635 2637) (2672 2673) (2689 2690)
403 (2748 2748) (2753 2757) (2759 2760) (2765 2765) (2817 2817)
404 (2876 2876) (2879 2879) (2881 2883) (2893 2893) (2902 2902)
405 (2946 2946) (3008 3008) (3021 3021) (3134 3136) (3142 3144)
406 (3146 3149) (3157 3158) (3263 3263) (3270 3270) (3276 3277)
407 (3393 3395) (3405 3405) (3530 3530) (3538 3540) (3542 3542)
408 (3633 3633) (3636 3642) (3655 3662) (3761 3761) (3764 3769)
409 (3771 3772) (3784 3789) (3864 3865) (3893 3893) (3895 3895)
410 (3897 3897) (3953 3966) (3968 3972) (3974 3975) (3984 3991)
411 (3993 4028) (4038 4038) (4141 4144) (4146 4146) (4150 4151)
412 (4153 4153) (4184 4185) (6071 6077) (6086 6086) (6089 6099)
413 (6313 6313) (8400 8412) (8417 8417) (12330 12335) (12441 12442)
414 (64286 64286) (65056 65059) (119143 119145) (119163 119170)
415 (119173 119179) (119210 119213))))
417 (DEFRANGES |p{Mc}|
418 (MASSAGE-RANGES
419 '((2307 2307) (2366 2368) (2377 2380) (2434 2435) (2494 2496)
420 (2503 2504) (2507 2508) (2519 2519) (2622 2624) (2691 2691)
421 (2750 2752) (2761 2761) (2763 2764) (2818 2819) (2878 2878)
422 (2880 2880) (2887 2888) (2891 2892) (2903 2903) (2947 2947)
423 (3006 3007) (3009 3010) (3014 3016) (3018 3020) (3031 3031)
424 (3073 3075) (3137 3140) (3202 3203) (3262 3262) (3264 3268)
425 (3271 3272) (3274 3275) (3285 3286) (3330 3331) (3390 3392)
426 (3398 3400) (3402 3404) (3415 3415) (3458 3459) (3535 3537)
427 (3544 3551) (3570 3571) (3902 3903) (3967 3967) (4140 4140)
428 (4145 4145) (4152 4152) (4182 4183) (6068 6070) (6078 6085)
429 (6087 6088) (119141 119142) (119149 119154))))
431 (DEFRANGES |p{Me}|
432 (MASSAGE-RANGES '((1160 1161) (1757 1758) (8413 8416) (8418 8419))))
434 (DEFRANGES |p{Nd}|
435 (MASSAGE-RANGES
436 '((48 57) (1632 1641) (1776 1785) (2406 2415) (2534 2543) (2662 2671)
437 (2790 2799) (2918 2927) (3047 3055) (3174 3183) (3302 3311)
438 (3430 3439) (3664 3673) (3792 3801) (3872 3881) (4160 4169)
439 (4969 4977) (6112 6121) (6160 6169) (65296 65305) (120782 120831))))
441 (DEFRANGES |p{Nl}|
442 (MASSAGE-RANGES
443 '((5870 5872) (8544 8579) (12295 12295) (12321 12329) (12344 12346)
444 (66378 66378))))
446 (DEFRANGES |p{No}|
447 (MASSAGE-RANGES
448 '((178 179) (185 185) (188 190) (2548 2553) (3056 3058) (3882 3891)
449 (4978 4988) (8304 8304) (8308 8313) (8320 8329) (8531 8543)
450 (9312 9371) (9450 9450) (10102 10131) (12690 12693) (12832 12841)
451 (12928 12937) (66336 66339))))
453 (DEFRANGES |p{Pc}|
454 (MASSAGE-RANGES
455 '((95 95) (8255 8256) (12539 12539) (65075 65076) (65101 65103)
456 (65343 65343) (65381 65381))))
458 (DEFRANGES |p{Pd}|
459 (MASSAGE-RANGES
460 '((45 45) (173 173) (1418 1418) (6150 6150) (8208 8213) (12316 12316)
461 (12336 12336) (65073 65074) (65112 65112) (65123 65123)
462 (65293 65293))))
464 (DEFRANGES |p{Ps}|
465 (MASSAGE-RANGES
466 '((40 40) (91 91) (123 123) (3898 3898) (3900 3900) (5787 5787)
467 (8218 8218) (8222 8222) (8261 8261) (8317 8317) (8333 8333)
468 (9001 9001) (12296 12296) (12298 12298) (12300 12300) (12302 12302)
469 (12304 12304) (12308 12308) (12310 12310) (12312 12312) (12314 12314)
470 (12317 12317) (64830 64830) (65077 65077) (65079 65079) (65081 65081)
471 (65083 65083) (65085 65085) (65087 65087) (65089 65089) (65091 65091)
472 (65113 65113) (65115 65115) (65117 65117) (65288 65288) (65339 65339)
473 (65371 65371) (65378 65378))))
475 (DEFRANGES |p{Pe}|
476 (MASSAGE-RANGES
477 '((41 41) (93 93) (125 125) (3899 3899) (3901 3901) (5788 5788)
478 (8262 8262) (8318 8318) (8334 8334) (9002 9002) (12297 12297)
479 (12299 12299) (12301 12301) (12303 12303) (12305 12305) (12309 12309)
480 (12311 12311) (12313 12313) (12315 12315) (12318 12319) (64831 64831)
481 (65078 65078) (65080 65080) (65082 65082) (65084 65084) (65086 65086)
482 (65088 65088) (65090 65090) (65092 65092) (65114 65114) (65116 65116)
483 (65118 65118) (65289 65289) (65341 65341) (65373 65373)
484 (65379 65379))))
486 (DEFRANGES |p{Pi}|
487 (MASSAGE-RANGES
488 '((171 171) (8216 8216) (8219 8220) (8223 8223) (8249 8249))))
490 (DEFRANGES |p{Pf}|
491 (MASSAGE-RANGES '((187 187) (8217 8217) (8221 8221) (8250 8250))))
493 (DEFRANGES |p{Po}|
494 (MASSAGE-RANGES
495 '((33 35) (37 39) (42 42) (44 44) (46 47) (58 59) (63 64) (92 92)
496 (161 161) (183 183) (191 191) (894 894) (903 903) (1370 1375)
497 (1417 1417) (1470 1470) (1472 1472) (1475 1475) (1523 1524)
498 (1548 1548) (1563 1563) (1567 1567) (1642 1645) (1748 1748)
499 (1792 1805) (2404 2405) (2416 2416) (3572 3572) (3663 3663)
500 (3674 3675) (3844 3858) (3973 3973) (4170 4175) (4347 4347)
501 (4961 4968) (5741 5742) (5867 5869) (6100 6106) (6108 6108)
502 (6144 6149) (6151 6154) (8214 8215) (8224 8231) (8240 8248)
503 (8251 8254) (8257 8259) (8264 8269) (12289 12291) (65072 65072)
504 (65097 65100) (65104 65106) (65108 65111) (65119 65121) (65128 65128)
505 (65130 65131) (65281 65283) (65285 65287) (65290 65290) (65292 65292)
506 (65294 65295) (65306 65307) (65311 65312) (65340 65340) (65377 65377)
507 (65380 65380))))
509 (DEFRANGES |p{Zs}|
510 (MASSAGE-RANGES
511 '((32 32) (160 160) (5760 5760) (8192 8203) (8239 8239) (12288 12288))))
513 (DEFRANGES |p{Zl}| (MASSAGE-RANGES '((8232 8232))))
515 (DEFRANGES |p{Zp}| (MASSAGE-RANGES '((8233 8233))))
517 (DEFRANGES |p{Sm}|
518 (MASSAGE-RANGES
519 '((43 43) (60 62) (124 124) (126 126) (172 172) (177 177) (215 215)
520 (247 247) (8260 8260) (8314 8316) (8330 8332) (8592 8596) (8602 8603)
521 (8608 8608) (8611 8611) (8614 8614) (8622 8622) (8654 8655)
522 (8658 8658) (8660 8660) (8704 8945) (8968 8971) (8992 8993)
523 (9655 9655) (9665 9665) (9839 9839) (64297 64297) (65122 65122)
524 (65124 65126) (65291 65291) (65308 65310) (65372 65372) (65374 65374)
525 (65506 65506) (65513 65516) (120513 120513) (120539 120539)
526 (120571 120571) (120597 120597) (120629 120629) (120655 120655)
527 (120687 120687) (120713 120713) (120745 120745) (120771 120771))))
529 (DEFRANGES |p{Sc}|
530 (MASSAGE-RANGES
531 '((36 36) (162 165) (2546 2547) (3647 3647) (6107 6107) (8352 8367)
532 (65129 65129) (65284 65284) (65504 65505) (65509 65510))))
534 (DEFRANGES |p{Sk}|
535 (MASSAGE-RANGES
536 '((94 94) (96 96) (168 168) (175 175) (180 180) (184 184) (697 698)
537 (706 719) (722 735) (741 749) (884 885) (900 901) (8125 8125)
538 (8127 8129) (8141 8143) (8157 8159) (8173 8175) (8189 8190)
539 (12443 12444) (65342 65342) (65344 65344) (65507 65507))))
541 (DEFRANGES |p{So}|
542 (MASSAGE-RANGES
543 '((166 167) (169 169) (174 174) (176 176) (182 182) (1154 1154)
544 (1769 1769) (1789 1790) (2554 2554) (2928 2928) (3841 3843)
545 (3859 3863) (3866 3871) (3892 3892) (3894 3894) (3896 3896)
546 (4030 4037) (4039 4044) (4047 4047) (8448 8449) (8451 8454)
547 (8456 8457) (8468 8468) (8470 8472) (8478 8483) (8485 8485)
548 (8487 8487) (8489 8489) (8494 8494) (8498 8498) (8506 8506)
549 (8597 8601) (8604 8607) (8609 8610) (8612 8613) (8615 8621)
550 (8623 8653) (8656 8657) (8659 8659) (8661 8691) (8960 8967)
551 (8972 8991) (8994 9000) (9003 9083) (9085 9114) (9216 9254)
552 (9280 9290) (9372 9449) (9472 9621) (9632 9654) (9656 9664)
553 (9666 9719) (9728 9747) (9753 9838) (9840 9841) (9985 9988)
554 (9990 9993) (9996 10023) (10025 10059) (10061 10061) (10063 10066)
555 (10070 10070) (10072 10078) (10081 10087) (10132 10132) (10136 10159)
556 (10161 10174) (10240 10495) (11904 11929) (11931 12019) (12032 12245)
557 (12272 12283) (12292 12292) (12306 12307) (12320 12320) (12342 12343)
558 (12350 12351) (12688 12689) (12694 12703) (12800 12828) (12842 12867)
559 (12896 12923) (12927 12927) (12938 12976) (12992 13003) (13008 13054)
560 (13056 13174) (13179 13277) (13280 13310) (42128 42145) (42148 42163)
561 (42165 42176) (42178 42180) (42182 42182) (65508 65508) (65512 65512)
562 (65517 65518) (65532 65533) (118784 119029) (119040 119078)
563 (119082 119140) (119146 119148) (119171 119172) (119180 119209)
564 (119214 119261))))
566 (DEFRANGES |p{Cc}| (MASSAGE-RANGES '((0 31) (127 159))))
568 (DEFRANGES |p{Cf}|
569 (MASSAGE-RANGES
570 '((1807 1807) (6155 6158) (8204 8207) (8234 8238) (8298 8303)
571 (65279 65279) (65529 65531) (119155 119162) (917505 917505)
572 (917536 917631))))
574 (DEFRANGES |p{Co}|
575 (MASSAGE-RANGES '((57344 63743) (983040 1048573) (1048576 1114109))))
577 (defranges |p{L}| (append |p{Lu}| |p{Ll}| |p{Lt}| |p{Lm}| |p{Lo}|))
578 (defranges |p{M}| (append |p{Mn}| |p{Mc}| |p{Me}|))
579 (defranges |p{N}| (append |p{Nd}| |p{Nl}| |p{No}|))
580 (defranges |p{P}| (append |p{Pc}| |p{Pd}| |p{Ps}| |p{Pe}| |p{Pi}| |p{Pf}|
581 |p{Po}|))
582 (defranges |p{Z}| (append |p{Zs}| |p{Zl}| |p{Zp}|))
583 (defranges |p{S}| (append |p{Sm}| |p{Sc}| |p{Sk}| |p{So}|))
584 (defranges |p{Cn}| (ranges- (massage-ranges '((0 #.+limit-1+)))
585 |p{L}| |p{M}| |p{N}| |p{P}| |p{Z}| |p{S}|
586 |p{Cc}| |p{Cf}| |p{Co}|))
587 (defranges |p{C}| (append |p{Cc}| |p{Cf}| |p{Co}| |p{Cn}|))
590 (defranges \\i
591 (massage-ranges '((58 58) (65 90) (95 95) (97 122)
592 (192 214) (216 246) (248 255) (256 305)
593 (308 318) (321 328) (330 382) (384 451)
594 (461 496) (500 501) (506 535) (592 680)
595 (699 705) (902 902) (904 906) (908 908)
596 (910 929) (931 974) (976 982) (986 986)
597 (988 988) (990 990) (992 992) (994 1011)
598 (1025 1036) (1038 1103) (1105 1116) (1118 1153)
599 (1168 1220) (1223 1224) (1227 1228) (1232 1259)
600 (1262 1269) (1272 1273) (1329 1366) (1369 1369)
601 (1377 1414) (1488 1514) (1520 1522) (1569 1594)
602 (1601 1610) (1649 1719) (1722 1726) (1728 1742)
603 (1744 1747) (1749 1749) (1765 1766) (2309 2361)
604 (2365 2365) (2392 2401) (2437 2444) (2447 2448)
605 (2451 2472) (2474 2480) (2482 2482) (2486 2489)
606 (2524 2525) (2527 2529) (2544 2545) (2565 2570)
607 (2575 2576) (2579 2600) (2602 2608) (2610 2611)
608 (2613 2614) (2616 2617) (2649 2652) (2654 2654)
609 (2674 2676) (2693 2699) (2701 2701) (2703 2705)
610 (2707 2728) (2730 2736) (2738 2739) (2741 2745)
611 (2749 2749) (2784 2784) (2821 2828) (2831 2832)
612 (2835 2856) (2858 2864) (2866 2867) (2870 2873)
613 (2877 2877) (2908 2909) (2911 2913) (2949 2954)
614 (2958 2960) (2962 2965) (2969 2970) (2972 2972)
615 (2974 2975) (2979 2980) (2984 2986) (2990 2997)
616 (2999 3001) (3077 3084) (3086 3088) (3090 3112)
617 (3114 3123) (3125 3129) (3168 3169) (3205 3212)
618 (3214 3216) (3218 3240) (3242 3251) (3253 3257)
619 (3294 3294) (3296 3297) (3333 3340) (3342 3344)
620 (3346 3368) (3370 3385) (3424 3425) (3585 3630)
621 (3632 3632) (3634 3635) (3648 3653) (3713 3714)
622 (3716 3716) (3719 3720) (3722 3722) (3725 3725)
623 (3732 3735) (3737 3743) (3745 3747) (3749 3749)
624 (3751 3751) (3754 3755) (3757 3758) (3760 3760)
625 (3762 3763) (3773 3773) (3776 3780) (3904 3911)
626 (3913 3945) (4256 4293) (4304 4342) (4352 4352)
627 (4354 4355) (4357 4359) (4361 4361) (4363 4364)
628 (4366 4370) (4412 4412) (4414 4414) (4416 4416)
629 (4428 4428) (4430 4430) (4432 4432) (4436 4437)
630 (4441 4441) (4447 4449) (4451 4451) (4453 4453)
631 (4455 4455) (4457 4457) (4461 4462) (4466 4467)
632 (4469 4469) (4510 4510) (4520 4520) (4523 4523)
633 (4526 4527) (4535 4536) (4538 4538) (4540 4546)
634 (4587 4587) (4592 4592) (4601 4601) (7680 7835)
635 (7840 7929) (7936 7957) (7960 7965) (7968 8005)
636 (8008 8013) (8016 8023) (8025 8025) (8027 8027)
637 (8029 8029) (8031 8061) (8064 8116) (8118 8124)
638 (8126 8126) (8130 8132) (8134 8140) (8144 8147)
639 (8150 8155) (8160 8172) (8178 8180) (8182 8188)
640 (8486 8486) (8490 8491) (8494 8494) (8576 8578)
641 (12295 12295) (12321 12329) (12353 12436)
642 (12449 12538) (12549 12588) (19968 40869)
643 (44032 55203))))
645 (defranges \\c
646 (append \\i
647 (massage-ranges '((45 45) (46 46) (48 57) (183 183)
648 (720 720) (721 721) (768 837) (864 865)
649 (903 903) (1155 1158) (1425 1441)
650 (1443 1465) (1467 1469) (1471 1471)
651 (1473 1474) (1476 1476) (1600 1600)
652 (1611 1618) (1632 1641) (1648 1648)
653 (1750 1756) (1757 1759) (1760 1764)
654 (1767 1768) (1770 1773) (1776 1785)
655 (2305 2307) (2364 2364) (2366 2380)
656 (2381 2381) (2385 2388) (2402 2403)
657 (2406 2415) (2433 2435) (2492 2492)
658 (2494 2494) (2495 2495) (2496 2500)
659 (2503 2504) (2507 2509) (2519 2519)
660 (2530 2531) (2534 2543) (2562 2562)
661 (2620 2620) (2622 2622) (2623 2623)
662 (2624 2626) (2631 2632) (2635 2637)
663 (2662 2671) (2672 2673) (2689 2691)
664 (2748 2748) (2750 2757) (2759 2761)
665 (2763 2765) (2790 2799) (2817 2819)
666 (2876 2876) (2878 2883) (2887 2888)
667 (2891 2893) (2902 2903) (2918 2927)
668 (2946 2947) (3006 3010) (3014 3016)
669 (3018 3021) (3031 3031) (3047 3055)
670 (3073 3075) (3134 3140) (3142 3144)
671 (3146 3149) (3157 3158) (3174 3183)
672 (3202 3203) (3262 3268) (3270 3272)
673 (3274 3277) (3285 3286) (3302 3311)
674 (3330 3331) (3390 3395) (3398 3400)
675 (3402 3405) (3415 3415) (3430 3439)
676 (3633 3633) (3636 3642) (3654 3654)
677 (3655 3662) (3664 3673) (3761 3761)
678 (3764 3769) (3771 3772) (3782 3782)
679 (3784 3789) (3792 3801) (3864 3865)
680 (3872 3881) (3893 3893) (3895 3895)
681 (3897 3897) (3902 3902) (3903 3903)
682 (3953 3972) (3974 3979) (3984 3989)
683 (3991 3991) (3993 4013) (4017 4023)
684 (4025 4025) (8400 8412) (8417 8417)
685 (12293 12293) (12330 12335) (12337 12341)
686 (12441 12441) (12442 12442) (12445 12446)
687 (12540 12542)))))
689 (defranges \.
690 (massage-ranges
691 '((0 9)
692 ;; 10 newline
693 (11 12)
694 ;; 13 return
695 (14 #.+limit-1+))))
697 (defranges \\s
698 (massage-ranges
699 '((0 8)
700 ;; 9 tab
701 ;; 10 newline
702 (11 12)
703 ;; 13 return
704 (14 31)
705 ;; 32 space
706 (33 #.+limit-1+))))
708 (defranges \\d |p{Nd}|)
710 (defranges \\w (ranges- (massage-ranges '((0 #.+limit-1+)))
711 |p{P}|
712 |p{Z}|
713 |p{C}|))
715 (defranges ^s (ranges- (massage-ranges '((0 #.+limit-1+))) \\s))
716 (defranges ^i (ranges- (massage-ranges '((0 #.+limit-1+))) \\i))
717 (defranges ^c (ranges- (massage-ranges '((0 #.+limit-1+))) \\c))
718 (defranges ^d (ranges- (massage-ranges '((0 #.+limit-1+))) \\d))
719 (defranges ^w (ranges- (massage-ranges '((0 #.+limit-1+))) \\w))