blob: 5bf62de2c53c0e41baa34a9cc3ac9eaeef6b3996 [file] [log] [blame]
Yang Guo4fd355c2019-09-19 10:59:03 +02001/*! @author Toru Nagashima <https://github.com/mysticatea> */
2
3
4var ast = /*#__PURE__*/Object.freeze({
5
6});
7
8function isIdStart(cp) {
9 if (cp < 0x41)
10 return false;
11 if (cp < 0x5b)
12 return true;
13 if (cp < 0x61)
14 return false;
15 if (cp < 0x7b)
16 return true;
17 return isLargeIdStart(cp);
18}
19function isIdContinue(cp) {
20 if (cp < 0x30)
21 return false;
22 if (cp < 0x3a)
23 return true;
24 if (cp < 0x41)
25 return false;
26 if (cp < 0x5b)
27 return true;
28 if (cp === 0x5f)
29 return true;
30 if (cp < 0x61)
31 return false;
32 if (cp < 0x7b)
33 return true;
34 return isLargeIdStart(cp) || isLargeIdContinue(cp);
35}
36function isLargeIdStart(cp) {
37 if (cp < 0x30a1) {
38 if (cp < 0xec0) {
39 if (cp < 0xa35) {
40 if (cp < 0x6e5) {
41 if (cp < 0x37a) {
42 if (cp < 0x294) {
43 if (cp < 0xf8) {
44 if (cp === 0xaa)
45 return true;
46 if (cp === 0xb5)
47 return true;
48 if (cp === 0xba)
49 return true;
50 if (cp < 0xc0)
51 return false;
52 if (cp < 0xd7)
53 return true;
54 if (cp < 0xd8)
55 return false;
56 if (cp < 0xf7)
57 return true;
58 return false;
59 }
60 if (cp < 0x1bb)
61 return true;
62 if (cp === 0x1bb)
63 return true;
64 if (cp < 0x1bc)
65 return false;
66 if (cp < 0x1c0)
67 return true;
68 if (cp < 0x1c0)
69 return false;
70 if (cp < 0x1c4)
71 return true;
72 if (cp < 0x1c4)
73 return false;
74 if (cp < 0x294)
75 return true;
76 return false;
77 }
78 if (cp < 0x2ec) {
79 if (cp === 0x294)
80 return true;
81 if (cp < 0x295)
82 return false;
83 if (cp < 0x2b0)
84 return true;
85 if (cp < 0x2b0)
86 return false;
87 if (cp < 0x2c2)
88 return true;
89 if (cp < 0x2c6)
90 return false;
91 if (cp < 0x2d2)
92 return true;
93 if (cp < 0x2e0)
94 return false;
95 if (cp < 0x2e5)
96 return true;
97 return false;
98 }
99 if (cp === 0x2ec)
100 return true;
101 if (cp === 0x2ee)
102 return true;
103 if (cp < 0x370)
104 return false;
105 if (cp < 0x374)
106 return true;
107 if (cp === 0x374)
108 return true;
109 if (cp < 0x376)
110 return false;
111 if (cp < 0x378)
112 return true;
113 return false;
114 }
115 if (cp < 0x531) {
116 if (cp < 0x38c) {
117 if (cp === 0x37a)
118 return true;
119 if (cp < 0x37b)
120 return false;
121 if (cp < 0x37e)
122 return true;
123 if (cp === 0x37f)
124 return true;
125 if (cp === 0x386)
126 return true;
127 if (cp < 0x388)
128 return false;
129 if (cp < 0x38b)
130 return true;
131 return false;
132 }
133 if (cp === 0x38c)
134 return true;
135 if (cp < 0x38e)
136 return false;
137 if (cp < 0x3a2)
138 return true;
139 if (cp < 0x3a3)
140 return false;
141 if (cp < 0x3f6)
142 return true;
143 if (cp < 0x3f7)
144 return false;
145 if (cp < 0x482)
146 return true;
147 if (cp < 0x48a)
148 return false;
149 if (cp < 0x530)
150 return true;
151 return false;
152 }
153 if (cp < 0x620) {
154 if (cp < 0x531)
155 return false;
156 if (cp < 0x557)
157 return true;
158 if (cp === 0x559)
159 return true;
160 if (cp < 0x560)
161 return false;
162 if (cp < 0x589)
163 return true;
164 if (cp < 0x5d0)
165 return false;
166 if (cp < 0x5eb)
167 return true;
168 if (cp < 0x5ef)
169 return false;
170 if (cp < 0x5f3)
171 return true;
172 return false;
173 }
174 if (cp < 0x640)
175 return true;
176 if (cp === 0x640)
177 return true;
178 if (cp < 0x641)
179 return false;
180 if (cp < 0x64b)
181 return true;
182 if (cp < 0x66e)
183 return false;
184 if (cp < 0x670)
185 return true;
186 if (cp < 0x671)
187 return false;
188 if (cp < 0x6d4)
189 return true;
190 if (cp === 0x6d5)
191 return true;
192 return false;
193 }
194 if (cp < 0x950) {
195 if (cp < 0x7fa) {
196 if (cp < 0x712) {
197 if (cp < 0x6e5)
198 return false;
199 if (cp < 0x6e7)
200 return true;
201 if (cp < 0x6ee)
202 return false;
203 if (cp < 0x6f0)
204 return true;
205 if (cp < 0x6fa)
206 return false;
207 if (cp < 0x6fd)
208 return true;
209 if (cp === 0x6ff)
210 return true;
211 if (cp === 0x710)
212 return true;
213 return false;
214 }
215 if (cp < 0x730)
216 return true;
217 if (cp < 0x74d)
218 return false;
219 if (cp < 0x7a6)
220 return true;
221 if (cp === 0x7b1)
222 return true;
223 if (cp < 0x7ca)
224 return false;
225 if (cp < 0x7eb)
226 return true;
227 if (cp < 0x7f4)
228 return false;
229 if (cp < 0x7f6)
230 return true;
231 return false;
232 }
233 if (cp < 0x840) {
234 if (cp === 0x7fa)
235 return true;
236 if (cp < 0x800)
237 return false;
238 if (cp < 0x816)
239 return true;
240 if (cp === 0x81a)
241 return true;
242 if (cp === 0x824)
243 return true;
244 if (cp === 0x828)
245 return true;
246 return false;
247 }
248 if (cp < 0x859)
249 return true;
250 if (cp < 0x860)
251 return false;
252 if (cp < 0x86b)
253 return true;
254 if (cp < 0x8a0)
255 return false;
256 if (cp < 0x8b5)
257 return true;
258 if (cp < 0x8b6)
259 return false;
260 if (cp < 0x8be)
261 return true;
262 if (cp < 0x904)
263 return false;
264 if (cp < 0x93a)
265 return true;
266 if (cp === 0x93d)
267 return true;
268 return false;
269 }
270 if (cp < 0x9bd) {
271 if (cp < 0x98f) {
272 if (cp === 0x950)
273 return true;
274 if (cp < 0x958)
275 return false;
276 if (cp < 0x962)
277 return true;
278 if (cp === 0x971)
279 return true;
280 if (cp < 0x972)
281 return false;
282 if (cp < 0x981)
283 return true;
284 if (cp < 0x985)
285 return false;
286 if (cp < 0x98d)
287 return true;
288 return false;
289 }
290 if (cp < 0x991)
291 return true;
292 if (cp < 0x993)
293 return false;
294 if (cp < 0x9a9)
295 return true;
296 if (cp < 0x9aa)
297 return false;
298 if (cp < 0x9b1)
299 return true;
300 if (cp === 0x9b2)
301 return true;
302 if (cp < 0x9b6)
303 return false;
304 if (cp < 0x9ba)
305 return true;
306 return false;
307 }
308 if (cp < 0x9fc) {
309 if (cp === 0x9bd)
310 return true;
311 if (cp === 0x9ce)
312 return true;
313 if (cp < 0x9dc)
314 return false;
315 if (cp < 0x9de)
316 return true;
317 if (cp < 0x9df)
318 return false;
319 if (cp < 0x9e2)
320 return true;
321 if (cp < 0x9f0)
322 return false;
323 if (cp < 0x9f2)
324 return true;
325 return false;
326 }
327 if (cp === 0x9fc)
328 return true;
329 if (cp < 0xa05)
330 return false;
331 if (cp < 0xa0b)
332 return true;
333 if (cp < 0xa0f)
334 return false;
335 if (cp < 0xa11)
336 return true;
337 if (cp < 0xa13)
338 return false;
339 if (cp < 0xa29)
340 return true;
341 if (cp < 0xa2a)
342 return false;
343 if (cp < 0xa31)
344 return true;
345 if (cp < 0xa32)
346 return false;
347 if (cp < 0xa34)
348 return true;
349 return false;
350 }
351 if (cp < 0xc60) {
352 if (cp < 0xb3d) {
353 if (cp < 0xab5) {
354 if (cp < 0xa85) {
355 if (cp < 0xa35)
356 return false;
357 if (cp < 0xa37)
358 return true;
359 if (cp < 0xa38)
360 return false;
361 if (cp < 0xa3a)
362 return true;
363 if (cp < 0xa59)
364 return false;
365 if (cp < 0xa5d)
366 return true;
367 if (cp === 0xa5e)
368 return true;
369 if (cp < 0xa72)
370 return false;
371 if (cp < 0xa75)
372 return true;
373 return false;
374 }
375 if (cp < 0xa8e)
376 return true;
377 if (cp < 0xa8f)
378 return false;
379 if (cp < 0xa92)
380 return true;
381 if (cp < 0xa93)
382 return false;
383 if (cp < 0xaa9)
384 return true;
385 if (cp < 0xaaa)
386 return false;
387 if (cp < 0xab1)
388 return true;
389 if (cp < 0xab2)
390 return false;
391 if (cp < 0xab4)
392 return true;
393 return false;
394 }
395 if (cp < 0xb05) {
396 if (cp < 0xab5)
397 return false;
398 if (cp < 0xaba)
399 return true;
400 if (cp === 0xabd)
401 return true;
402 if (cp === 0xad0)
403 return true;
404 if (cp < 0xae0)
405 return false;
406 if (cp < 0xae2)
407 return true;
408 if (cp === 0xaf9)
409 return true;
410 return false;
411 }
412 if (cp < 0xb0d)
413 return true;
414 if (cp < 0xb0f)
415 return false;
416 if (cp < 0xb11)
417 return true;
418 if (cp < 0xb13)
419 return false;
420 if (cp < 0xb29)
421 return true;
422 if (cp < 0xb2a)
423 return false;
424 if (cp < 0xb31)
425 return true;
426 if (cp < 0xb32)
427 return false;
428 if (cp < 0xb34)
429 return true;
430 if (cp < 0xb35)
431 return false;
432 if (cp < 0xb3a)
433 return true;
434 return false;
435 }
436 if (cp < 0xb9e) {
437 if (cp < 0xb85) {
438 if (cp === 0xb3d)
439 return true;
440 if (cp < 0xb5c)
441 return false;
442 if (cp < 0xb5e)
443 return true;
444 if (cp < 0xb5f)
445 return false;
446 if (cp < 0xb62)
447 return true;
448 if (cp === 0xb71)
449 return true;
450 if (cp === 0xb83)
451 return true;
452 return false;
453 }
454 if (cp < 0xb8b)
455 return true;
456 if (cp < 0xb8e)
457 return false;
458 if (cp < 0xb91)
459 return true;
460 if (cp < 0xb92)
461 return false;
462 if (cp < 0xb96)
463 return true;
464 if (cp < 0xb99)
465 return false;
466 if (cp < 0xb9b)
467 return true;
468 if (cp === 0xb9c)
469 return true;
470 return false;
471 }
472 if (cp < 0xc05) {
473 if (cp < 0xb9e)
474 return false;
475 if (cp < 0xba0)
476 return true;
477 if (cp < 0xba3)
478 return false;
479 if (cp < 0xba5)
480 return true;
481 if (cp < 0xba8)
482 return false;
483 if (cp < 0xbab)
484 return true;
485 if (cp < 0xbae)
486 return false;
487 if (cp < 0xbba)
488 return true;
489 if (cp === 0xbd0)
490 return true;
491 return false;
492 }
493 if (cp < 0xc0d)
494 return true;
495 if (cp < 0xc0e)
496 return false;
497 if (cp < 0xc11)
498 return true;
499 if (cp < 0xc12)
500 return false;
501 if (cp < 0xc29)
502 return true;
503 if (cp < 0xc2a)
504 return false;
505 if (cp < 0xc3a)
506 return true;
507 if (cp === 0xc3d)
508 return true;
509 if (cp < 0xc58)
510 return false;
511 if (cp < 0xc5b)
512 return true;
513 return false;
514 }
515 if (cp < 0xdb3) {
516 if (cp < 0xcf1) {
517 if (cp < 0xcaa) {
518 if (cp < 0xc60)
519 return false;
520 if (cp < 0xc62)
521 return true;
522 if (cp === 0xc80)
523 return true;
524 if (cp < 0xc85)
525 return false;
526 if (cp < 0xc8d)
527 return true;
528 if (cp < 0xc8e)
529 return false;
530 if (cp < 0xc91)
531 return true;
532 if (cp < 0xc92)
533 return false;
534 if (cp < 0xca9)
535 return true;
536 return false;
537 }
538 if (cp < 0xcb4)
539 return true;
540 if (cp < 0xcb5)
541 return false;
542 if (cp < 0xcba)
543 return true;
544 if (cp === 0xcbd)
545 return true;
546 if (cp === 0xcde)
547 return true;
548 if (cp < 0xce0)
549 return false;
550 if (cp < 0xce2)
551 return true;
552 return false;
553 }
554 if (cp < 0xd4e) {
555 if (cp < 0xcf1)
556 return false;
557 if (cp < 0xcf3)
558 return true;
559 if (cp < 0xd05)
560 return false;
561 if (cp < 0xd0d)
562 return true;
563 if (cp < 0xd0e)
564 return false;
565 if (cp < 0xd11)
566 return true;
567 if (cp < 0xd12)
568 return false;
569 if (cp < 0xd3b)
570 return true;
571 if (cp === 0xd3d)
572 return true;
573 return false;
574 }
575 if (cp === 0xd4e)
576 return true;
577 if (cp < 0xd54)
578 return false;
579 if (cp < 0xd57)
580 return true;
581 if (cp < 0xd5f)
582 return false;
583 if (cp < 0xd62)
584 return true;
585 if (cp < 0xd7a)
586 return false;
587 if (cp < 0xd80)
588 return true;
589 if (cp < 0xd85)
590 return false;
591 if (cp < 0xd97)
592 return true;
593 if (cp < 0xd9a)
594 return false;
595 if (cp < 0xdb2)
596 return true;
597 return false;
598 }
599 if (cp < 0xe8a) {
600 if (cp < 0xe40) {
601 if (cp < 0xdb3)
602 return false;
603 if (cp < 0xdbc)
604 return true;
605 if (cp === 0xdbd)
606 return true;
607 if (cp < 0xdc0)
608 return false;
609 if (cp < 0xdc7)
610 return true;
611 if (cp < 0xe01)
612 return false;
613 if (cp < 0xe31)
614 return true;
615 if (cp < 0xe32)
616 return false;
617 if (cp < 0xe34)
618 return true;
619 return false;
620 }
621 if (cp < 0xe46)
622 return true;
623 if (cp === 0xe46)
624 return true;
625 if (cp < 0xe81)
626 return false;
627 if (cp < 0xe83)
628 return true;
629 if (cp === 0xe84)
630 return true;
631 if (cp < 0xe87)
632 return false;
633 if (cp < 0xe89)
634 return true;
635 return false;
636 }
637 if (cp < 0xea5) {
638 if (cp === 0xe8a)
639 return true;
640 if (cp === 0xe8d)
641 return true;
642 if (cp < 0xe94)
643 return false;
644 if (cp < 0xe98)
645 return true;
646 if (cp < 0xe99)
647 return false;
648 if (cp < 0xea0)
649 return true;
650 if (cp < 0xea1)
651 return false;
652 if (cp < 0xea4)
653 return true;
654 return false;
655 }
656 if (cp === 0xea5)
657 return true;
658 if (cp === 0xea7)
659 return true;
660 if (cp < 0xeaa)
661 return false;
662 if (cp < 0xeac)
663 return true;
664 if (cp < 0xead)
665 return false;
666 if (cp < 0xeb1)
667 return true;
668 if (cp < 0xeb2)
669 return false;
670 if (cp < 0xeb4)
671 return true;
672 if (cp === 0xebd)
673 return true;
674 return false;
675 }
676 if (cp < 0x1ce9) {
677 if (cp < 0x166f) {
678 if (cp < 0x10fd) {
679 if (cp < 0x105a) {
680 if (cp < 0xf49) {
681 if (cp < 0xec0)
682 return false;
683 if (cp < 0xec5)
684 return true;
685 if (cp === 0xec6)
686 return true;
687 if (cp < 0xedc)
688 return false;
689 if (cp < 0xee0)
690 return true;
691 if (cp === 0xf00)
692 return true;
693 if (cp < 0xf40)
694 return false;
695 if (cp < 0xf48)
696 return true;
697 return false;
698 }
699 if (cp < 0xf6d)
700 return true;
701 if (cp < 0xf88)
702 return false;
703 if (cp < 0xf8d)
704 return true;
705 if (cp < 0x1000)
706 return false;
707 if (cp < 0x102b)
708 return true;
709 if (cp === 0x103f)
710 return true;
711 if (cp < 0x1050)
712 return false;
713 if (cp < 0x1056)
714 return true;
715 return false;
716 }
717 if (cp < 0x108e) {
718 if (cp < 0x105a)
719 return false;
720 if (cp < 0x105e)
721 return true;
722 if (cp === 0x1061)
723 return true;
724 if (cp < 0x1065)
725 return false;
726 if (cp < 0x1067)
727 return true;
728 if (cp < 0x106e)
729 return false;
730 if (cp < 0x1071)
731 return true;
732 if (cp < 0x1075)
733 return false;
734 if (cp < 0x1082)
735 return true;
736 return false;
737 }
738 if (cp === 0x108e)
739 return true;
740 if (cp < 0x10a0)
741 return false;
742 if (cp < 0x10c6)
743 return true;
744 if (cp === 0x10c7)
745 return true;
746 if (cp === 0x10cd)
747 return true;
748 if (cp < 0x10d0)
749 return false;
750 if (cp < 0x10fb)
751 return true;
752 if (cp === 0x10fc)
753 return true;
754 return false;
755 }
756 if (cp < 0x12b8) {
757 if (cp < 0x125a) {
758 if (cp < 0x10fd)
759 return false;
760 if (cp < 0x1100)
761 return true;
762 if (cp < 0x1100)
763 return false;
764 if (cp < 0x1249)
765 return true;
766 if (cp < 0x124a)
767 return false;
768 if (cp < 0x124e)
769 return true;
770 if (cp < 0x1250)
771 return false;
772 if (cp < 0x1257)
773 return true;
774 if (cp === 0x1258)
775 return true;
776 return false;
777 }
778 if (cp < 0x125e)
779 return true;
780 if (cp < 0x1260)
781 return false;
782 if (cp < 0x1289)
783 return true;
784 if (cp < 0x128a)
785 return false;
786 if (cp < 0x128e)
787 return true;
788 if (cp < 0x1290)
789 return false;
790 if (cp < 0x12b1)
791 return true;
792 if (cp < 0x12b2)
793 return false;
794 if (cp < 0x12b6)
795 return true;
796 return false;
797 }
798 if (cp < 0x1312) {
799 if (cp < 0x12b8)
800 return false;
801 if (cp < 0x12bf)
802 return true;
803 if (cp === 0x12c0)
804 return true;
805 if (cp < 0x12c2)
806 return false;
807 if (cp < 0x12c6)
808 return true;
809 if (cp < 0x12c8)
810 return false;
811 if (cp < 0x12d7)
812 return true;
813 if (cp < 0x12d8)
814 return false;
815 if (cp < 0x1311)
816 return true;
817 return false;
818 }
819 if (cp < 0x1316)
820 return true;
821 if (cp < 0x1318)
822 return false;
823 if (cp < 0x135b)
824 return true;
825 if (cp < 0x1380)
826 return false;
827 if (cp < 0x1390)
828 return true;
829 if (cp < 0x13a0)
830 return false;
831 if (cp < 0x13f6)
832 return true;
833 if (cp < 0x13f8)
834 return false;
835 if (cp < 0x13fe)
836 return true;
837 if (cp < 0x1401)
838 return false;
839 if (cp < 0x166d)
840 return true;
841 return false;
842 }
843 if (cp < 0x18b0) {
844 if (cp < 0x176e) {
845 if (cp < 0x1700) {
846 if (cp < 0x166f)
847 return false;
848 if (cp < 0x1680)
849 return true;
850 if (cp < 0x1681)
851 return false;
852 if (cp < 0x169b)
853 return true;
854 if (cp < 0x16a0)
855 return false;
856 if (cp < 0x16eb)
857 return true;
858 if (cp < 0x16ee)
859 return false;
860 if (cp < 0x16f1)
861 return true;
862 if (cp < 0x16f1)
863 return false;
864 if (cp < 0x16f9)
865 return true;
866 return false;
867 }
868 if (cp < 0x170d)
869 return true;
870 if (cp < 0x170e)
871 return false;
872 if (cp < 0x1712)
873 return true;
874 if (cp < 0x1720)
875 return false;
876 if (cp < 0x1732)
877 return true;
878 if (cp < 0x1740)
879 return false;
880 if (cp < 0x1752)
881 return true;
882 if (cp < 0x1760)
883 return false;
884 if (cp < 0x176d)
885 return true;
886 return false;
887 }
888 if (cp < 0x1843) {
889 if (cp < 0x176e)
890 return false;
891 if (cp < 0x1771)
892 return true;
893 if (cp < 0x1780)
894 return false;
895 if (cp < 0x17b4)
896 return true;
897 if (cp === 0x17d7)
898 return true;
899 if (cp === 0x17dc)
900 return true;
901 if (cp < 0x1820)
902 return false;
903 if (cp < 0x1843)
904 return true;
905 return false;
906 }
907 if (cp === 0x1843)
908 return true;
909 if (cp < 0x1844)
910 return false;
911 if (cp < 0x1879)
912 return true;
913 if (cp < 0x1880)
914 return false;
915 if (cp < 0x1885)
916 return true;
917 if (cp < 0x1885)
918 return false;
919 if (cp < 0x1887)
920 return true;
921 if (cp < 0x1887)
922 return false;
923 if (cp < 0x18a9)
924 return true;
925 if (cp === 0x18aa)
926 return true;
927 return false;
928 }
929 if (cp < 0x1b45) {
930 if (cp < 0x19b0) {
931 if (cp < 0x18b0)
932 return false;
933 if (cp < 0x18f6)
934 return true;
935 if (cp < 0x1900)
936 return false;
937 if (cp < 0x191f)
938 return true;
939 if (cp < 0x1950)
940 return false;
941 if (cp < 0x196e)
942 return true;
943 if (cp < 0x1970)
944 return false;
945 if (cp < 0x1975)
946 return true;
947 if (cp < 0x1980)
948 return false;
949 if (cp < 0x19ac)
950 return true;
951 return false;
952 }
953 if (cp < 0x19ca)
954 return true;
955 if (cp < 0x1a00)
956 return false;
957 if (cp < 0x1a17)
958 return true;
959 if (cp < 0x1a20)
960 return false;
961 if (cp < 0x1a55)
962 return true;
963 if (cp === 0x1aa7)
964 return true;
965 if (cp < 0x1b05)
966 return false;
967 if (cp < 0x1b34)
968 return true;
969 return false;
970 }
971 if (cp < 0x1c4d) {
972 if (cp < 0x1b45)
973 return false;
974 if (cp < 0x1b4c)
975 return true;
976 if (cp < 0x1b83)
977 return false;
978 if (cp < 0x1ba1)
979 return true;
980 if (cp < 0x1bae)
981 return false;
982 if (cp < 0x1bb0)
983 return true;
984 if (cp < 0x1bba)
985 return false;
986 if (cp < 0x1be6)
987 return true;
988 if (cp < 0x1c00)
989 return false;
990 if (cp < 0x1c24)
991 return true;
992 return false;
993 }
994 if (cp < 0x1c50)
995 return true;
996 if (cp < 0x1c5a)
997 return false;
998 if (cp < 0x1c78)
999 return true;
1000 if (cp < 0x1c78)
1001 return false;
1002 if (cp < 0x1c7e)
1003 return true;
1004 if (cp < 0x1c80)
1005 return false;
1006 if (cp < 0x1c89)
1007 return true;
1008 if (cp < 0x1c90)
1009 return false;
1010 if (cp < 0x1cbb)
1011 return true;
1012 if (cp < 0x1cbd)
1013 return false;
1014 if (cp < 0x1cc0)
1015 return true;
1016 return false;
1017 }
1018 if (cp < 0x212f) {
1019 if (cp < 0x1fc2) {
1020 if (cp < 0x1f18) {
1021 if (cp < 0x1d6b) {
1022 if (cp < 0x1ce9)
1023 return false;
1024 if (cp < 0x1ced)
1025 return true;
1026 if (cp < 0x1cee)
1027 return false;
1028 if (cp < 0x1cf2)
1029 return true;
1030 if (cp < 0x1cf5)
1031 return false;
1032 if (cp < 0x1cf7)
1033 return true;
1034 if (cp < 0x1d00)
1035 return false;
1036 if (cp < 0x1d2c)
1037 return true;
1038 if (cp < 0x1d2c)
1039 return false;
1040 if (cp < 0x1d6b)
1041 return true;
1042 return false;
1043 }
1044 if (cp < 0x1d78)
1045 return true;
1046 if (cp === 0x1d78)
1047 return true;
1048 if (cp < 0x1d79)
1049 return false;
1050 if (cp < 0x1d9b)
1051 return true;
1052 if (cp < 0x1d9b)
1053 return false;
1054 if (cp < 0x1dc0)
1055 return true;
1056 if (cp < 0x1e00)
1057 return false;
1058 if (cp < 0x1f16)
1059 return true;
1060 return false;
1061 }
1062 if (cp < 0x1f5b) {
1063 if (cp < 0x1f18)
1064 return false;
1065 if (cp < 0x1f1e)
1066 return true;
1067 if (cp < 0x1f20)
1068 return false;
1069 if (cp < 0x1f46)
1070 return true;
1071 if (cp < 0x1f48)
1072 return false;
1073 if (cp < 0x1f4e)
1074 return true;
1075 if (cp < 0x1f50)
1076 return false;
1077 if (cp < 0x1f58)
1078 return true;
1079 if (cp === 0x1f59)
1080 return true;
1081 return false;
1082 }
1083 if (cp === 0x1f5b)
1084 return true;
1085 if (cp === 0x1f5d)
1086 return true;
1087 if (cp < 0x1f5f)
1088 return false;
1089 if (cp < 0x1f7e)
1090 return true;
1091 if (cp < 0x1f80)
1092 return false;
1093 if (cp < 0x1fb5)
1094 return true;
1095 if (cp < 0x1fb6)
1096 return false;
1097 if (cp < 0x1fbd)
1098 return true;
1099 if (cp === 0x1fbe)
1100 return true;
1101 return false;
1102 }
1103 if (cp < 0x2102) {
1104 if (cp < 0x1ff2) {
1105 if (cp < 0x1fc2)
1106 return false;
1107 if (cp < 0x1fc5)
1108 return true;
1109 if (cp < 0x1fc6)
1110 return false;
1111 if (cp < 0x1fcd)
1112 return true;
1113 if (cp < 0x1fd0)
1114 return false;
1115 if (cp < 0x1fd4)
1116 return true;
1117 if (cp < 0x1fd6)
1118 return false;
1119 if (cp < 0x1fdc)
1120 return true;
1121 if (cp < 0x1fe0)
1122 return false;
1123 if (cp < 0x1fed)
1124 return true;
1125 return false;
1126 }
1127 if (cp < 0x1ff5)
1128 return true;
1129 if (cp < 0x1ff6)
1130 return false;
1131 if (cp < 0x1ffd)
1132 return true;
1133 if (cp === 0x2071)
1134 return true;
1135 if (cp === 0x207f)
1136 return true;
1137 if (cp < 0x2090)
1138 return false;
1139 if (cp < 0x209d)
1140 return true;
1141 return false;
1142 }
1143 if (cp < 0x2119) {
1144 if (cp === 0x2102)
1145 return true;
1146 if (cp === 0x2107)
1147 return true;
1148 if (cp < 0x210a)
1149 return false;
1150 if (cp < 0x2114)
1151 return true;
1152 if (cp === 0x2115)
1153 return true;
1154 if (cp === 0x2118)
1155 return true;
1156 return false;
1157 }
1158 if (cp < 0x211e)
1159 return true;
1160 if (cp === 0x2124)
1161 return true;
1162 if (cp === 0x2126)
1163 return true;
1164 if (cp === 0x2128)
1165 return true;
1166 if (cp < 0x212a)
1167 return false;
1168 if (cp < 0x212e)
1169 return true;
1170 if (cp === 0x212e)
1171 return true;
1172 return false;
1173 }
1174 if (cp < 0x2d80) {
1175 if (cp < 0x2c30) {
1176 if (cp < 0x214e) {
1177 if (cp < 0x212f)
1178 return false;
1179 if (cp < 0x2135)
1180 return true;
1181 if (cp < 0x2135)
1182 return false;
1183 if (cp < 0x2139)
1184 return true;
1185 if (cp === 0x2139)
1186 return true;
1187 if (cp < 0x213c)
1188 return false;
1189 if (cp < 0x2140)
1190 return true;
1191 if (cp < 0x2145)
1192 return false;
1193 if (cp < 0x214a)
1194 return true;
1195 return false;
1196 }
1197 if (cp === 0x214e)
1198 return true;
1199 if (cp < 0x2160)
1200 return false;
1201 if (cp < 0x2183)
1202 return true;
1203 if (cp < 0x2183)
1204 return false;
1205 if (cp < 0x2185)
1206 return true;
1207 if (cp < 0x2185)
1208 return false;
1209 if (cp < 0x2189)
1210 return true;
1211 if (cp < 0x2c00)
1212 return false;
1213 if (cp < 0x2c2f)
1214 return true;
1215 return false;
1216 }
1217 if (cp < 0x2cf2) {
1218 if (cp < 0x2c30)
1219 return false;
1220 if (cp < 0x2c5f)
1221 return true;
1222 if (cp < 0x2c60)
1223 return false;
1224 if (cp < 0x2c7c)
1225 return true;
1226 if (cp < 0x2c7c)
1227 return false;
1228 if (cp < 0x2c7e)
1229 return true;
1230 if (cp < 0x2c7e)
1231 return false;
1232 if (cp < 0x2ce5)
1233 return true;
1234 if (cp < 0x2ceb)
1235 return false;
1236 if (cp < 0x2cef)
1237 return true;
1238 return false;
1239 }
1240 if (cp < 0x2cf4)
1241 return true;
1242 if (cp < 0x2d00)
1243 return false;
1244 if (cp < 0x2d26)
1245 return true;
1246 if (cp === 0x2d27)
1247 return true;
1248 if (cp === 0x2d2d)
1249 return true;
1250 if (cp < 0x2d30)
1251 return false;
1252 if (cp < 0x2d68)
1253 return true;
1254 if (cp === 0x2d6f)
1255 return true;
1256 return false;
1257 }
1258 if (cp < 0x3006) {
1259 if (cp < 0x2dc0) {
1260 if (cp < 0x2d80)
1261 return false;
1262 if (cp < 0x2d97)
1263 return true;
1264 if (cp < 0x2da0)
1265 return false;
1266 if (cp < 0x2da7)
1267 return true;
1268 if (cp < 0x2da8)
1269 return false;
1270 if (cp < 0x2daf)
1271 return true;
1272 if (cp < 0x2db0)
1273 return false;
1274 if (cp < 0x2db7)
1275 return true;
1276 if (cp < 0x2db8)
1277 return false;
1278 if (cp < 0x2dbf)
1279 return true;
1280 return false;
1281 }
1282 if (cp < 0x2dc7)
1283 return true;
1284 if (cp < 0x2dc8)
1285 return false;
1286 if (cp < 0x2dcf)
1287 return true;
1288 if (cp < 0x2dd0)
1289 return false;
1290 if (cp < 0x2dd7)
1291 return true;
1292 if (cp < 0x2dd8)
1293 return false;
1294 if (cp < 0x2ddf)
1295 return true;
1296 if (cp === 0x3005)
1297 return true;
1298 return false;
1299 }
1300 if (cp < 0x303b) {
1301 if (cp === 0x3006)
1302 return true;
1303 if (cp === 0x3007)
1304 return true;
1305 if (cp < 0x3021)
1306 return false;
1307 if (cp < 0x302a)
1308 return true;
1309 if (cp < 0x3031)
1310 return false;
1311 if (cp < 0x3036)
1312 return true;
1313 if (cp < 0x3038)
1314 return false;
1315 if (cp < 0x303b)
1316 return true;
1317 return false;
1318 }
1319 if (cp === 0x303b)
1320 return true;
1321 if (cp === 0x303c)
1322 return true;
1323 if (cp < 0x3041)
1324 return false;
1325 if (cp < 0x3097)
1326 return true;
1327 if (cp < 0x309b)
1328 return false;
1329 if (cp < 0x309d)
1330 return true;
1331 if (cp < 0x309d)
1332 return false;
1333 if (cp < 0x309f)
1334 return true;
1335 if (cp === 0x309f)
1336 return true;
1337 return false;
1338 }
1339 if (cp < 0x10b60) {
1340 if (cp < 0xd7b0) {
1341 if (cp < 0xa882) {
1342 if (cp < 0xa67f) {
1343 if (cp < 0xa015) {
1344 if (cp < 0x31a0) {
1345 if (cp < 0x30a1)
1346 return false;
1347 if (cp < 0x30fb)
1348 return true;
1349 if (cp < 0x30fc)
1350 return false;
1351 if (cp < 0x30ff)
1352 return true;
1353 if (cp === 0x30ff)
1354 return true;
1355 if (cp < 0x3105)
1356 return false;
1357 if (cp < 0x3130)
1358 return true;
1359 if (cp < 0x3131)
1360 return false;
1361 if (cp < 0x318f)
1362 return true;
1363 return false;
1364 }
1365 if (cp < 0x31bb)
1366 return true;
1367 if (cp < 0x31f0)
1368 return false;
1369 if (cp < 0x3200)
1370 return true;
1371 if (cp < 0x3400)
1372 return false;
1373 if (cp < 0x4db6)
1374 return true;
1375 if (cp < 0x4e00)
1376 return false;
1377 if (cp < 0x9ff0)
1378 return true;
1379 if (cp < 0xa000)
1380 return false;
1381 if (cp < 0xa015)
1382 return true;
1383 return false;
1384 }
1385 if (cp < 0xa60c) {
1386 if (cp === 0xa015)
1387 return true;
1388 if (cp < 0xa016)
1389 return false;
1390 if (cp < 0xa48d)
1391 return true;
1392 if (cp < 0xa4d0)
1393 return false;
1394 if (cp < 0xa4f8)
1395 return true;
1396 if (cp < 0xa4f8)
1397 return false;
1398 if (cp < 0xa4fe)
1399 return true;
1400 if (cp < 0xa500)
1401 return false;
1402 if (cp < 0xa60c)
1403 return true;
1404 return false;
1405 }
1406 if (cp === 0xa60c)
1407 return true;
1408 if (cp < 0xa610)
1409 return false;
1410 if (cp < 0xa620)
1411 return true;
1412 if (cp < 0xa62a)
1413 return false;
1414 if (cp < 0xa62c)
1415 return true;
1416 if (cp < 0xa640)
1417 return false;
1418 if (cp < 0xa66e)
1419 return true;
1420 if (cp === 0xa66e)
1421 return true;
1422 return false;
1423 }
1424 if (cp < 0xa78b) {
1425 if (cp < 0xa717) {
1426 if (cp === 0xa67f)
1427 return true;
1428 if (cp < 0xa680)
1429 return false;
1430 if (cp < 0xa69c)
1431 return true;
1432 if (cp < 0xa69c)
1433 return false;
1434 if (cp < 0xa69e)
1435 return true;
1436 if (cp < 0xa6a0)
1437 return false;
1438 if (cp < 0xa6e6)
1439 return true;
1440 if (cp < 0xa6e6)
1441 return false;
1442 if (cp < 0xa6f0)
1443 return true;
1444 return false;
1445 }
1446 if (cp < 0xa720)
1447 return true;
1448 if (cp < 0xa722)
1449 return false;
1450 if (cp < 0xa770)
1451 return true;
1452 if (cp === 0xa770)
1453 return true;
1454 if (cp < 0xa771)
1455 return false;
1456 if (cp < 0xa788)
1457 return true;
1458 if (cp === 0xa788)
1459 return true;
1460 return false;
1461 }
1462 if (cp < 0xa7fa) {
1463 if (cp < 0xa78b)
1464 return false;
1465 if (cp < 0xa78f)
1466 return true;
1467 if (cp === 0xa78f)
1468 return true;
1469 if (cp < 0xa790)
1470 return false;
1471 if (cp < 0xa7ba)
1472 return true;
1473 if (cp === 0xa7f7)
1474 return true;
1475 if (cp < 0xa7f8)
1476 return false;
1477 if (cp < 0xa7fa)
1478 return true;
1479 return false;
1480 }
1481 if (cp === 0xa7fa)
1482 return true;
1483 if (cp < 0xa7fb)
1484 return false;
1485 if (cp < 0xa802)
1486 return true;
1487 if (cp < 0xa803)
1488 return false;
1489 if (cp < 0xa806)
1490 return true;
1491 if (cp < 0xa807)
1492 return false;
1493 if (cp < 0xa80b)
1494 return true;
1495 if (cp < 0xa80c)
1496 return false;
1497 if (cp < 0xa823)
1498 return true;
1499 if (cp < 0xa840)
1500 return false;
1501 if (cp < 0xa874)
1502 return true;
1503 return false;
1504 }
1505 if (cp < 0xaab1) {
1506 if (cp < 0xa9e6) {
1507 if (cp < 0xa930) {
1508 if (cp < 0xa882)
1509 return false;
1510 if (cp < 0xa8b4)
1511 return true;
1512 if (cp < 0xa8f2)
1513 return false;
1514 if (cp < 0xa8f8)
1515 return true;
1516 if (cp === 0xa8fb)
1517 return true;
1518 if (cp < 0xa8fd)
1519 return false;
1520 if (cp < 0xa8ff)
1521 return true;
1522 if (cp < 0xa90a)
1523 return false;
1524 if (cp < 0xa926)
1525 return true;
1526 return false;
1527 }
1528 if (cp < 0xa947)
1529 return true;
1530 if (cp < 0xa960)
1531 return false;
1532 if (cp < 0xa97d)
1533 return true;
1534 if (cp < 0xa984)
1535 return false;
1536 if (cp < 0xa9b3)
1537 return true;
1538 if (cp === 0xa9cf)
1539 return true;
1540 if (cp < 0xa9e0)
1541 return false;
1542 if (cp < 0xa9e5)
1543 return true;
1544 return false;
1545 }
1546 if (cp < 0xaa44) {
1547 if (cp === 0xa9e6)
1548 return true;
1549 if (cp < 0xa9e7)
1550 return false;
1551 if (cp < 0xa9f0)
1552 return true;
1553 if (cp < 0xa9fa)
1554 return false;
1555 if (cp < 0xa9ff)
1556 return true;
1557 if (cp < 0xaa00)
1558 return false;
1559 if (cp < 0xaa29)
1560 return true;
1561 if (cp < 0xaa40)
1562 return false;
1563 if (cp < 0xaa43)
1564 return true;
1565 return false;
1566 }
1567 if (cp < 0xaa4c)
1568 return true;
1569 if (cp < 0xaa60)
1570 return false;
1571 if (cp < 0xaa70)
1572 return true;
1573 if (cp === 0xaa70)
1574 return true;
1575 if (cp < 0xaa71)
1576 return false;
1577 if (cp < 0xaa77)
1578 return true;
1579 if (cp === 0xaa7a)
1580 return true;
1581 if (cp < 0xaa7e)
1582 return false;
1583 if (cp < 0xaab0)
1584 return true;
1585 return false;
1586 }
1587 if (cp < 0xab01) {
1588 if (cp < 0xaadb) {
1589 if (cp === 0xaab1)
1590 return true;
1591 if (cp < 0xaab5)
1592 return false;
1593 if (cp < 0xaab7)
1594 return true;
1595 if (cp < 0xaab9)
1596 return false;
1597 if (cp < 0xaabe)
1598 return true;
1599 if (cp === 0xaac0)
1600 return true;
1601 if (cp === 0xaac2)
1602 return true;
1603 return false;
1604 }
1605 if (cp < 0xaadd)
1606 return true;
1607 if (cp === 0xaadd)
1608 return true;
1609 if (cp < 0xaae0)
1610 return false;
1611 if (cp < 0xaaeb)
1612 return true;
1613 if (cp === 0xaaf2)
1614 return true;
1615 if (cp < 0xaaf3)
1616 return false;
1617 if (cp < 0xaaf5)
1618 return true;
1619 return false;
1620 }
1621 if (cp < 0xab30) {
1622 if (cp < 0xab01)
1623 return false;
1624 if (cp < 0xab07)
1625 return true;
1626 if (cp < 0xab09)
1627 return false;
1628 if (cp < 0xab0f)
1629 return true;
1630 if (cp < 0xab11)
1631 return false;
1632 if (cp < 0xab17)
1633 return true;
1634 if (cp < 0xab20)
1635 return false;
1636 if (cp < 0xab27)
1637 return true;
1638 if (cp < 0xab28)
1639 return false;
1640 if (cp < 0xab2f)
1641 return true;
1642 return false;
1643 }
1644 if (cp < 0xab5b)
1645 return true;
1646 if (cp < 0xab5c)
1647 return false;
1648 if (cp < 0xab60)
1649 return true;
1650 if (cp < 0xab60)
1651 return false;
1652 if (cp < 0xab66)
1653 return true;
1654 if (cp < 0xab70)
1655 return false;
1656 if (cp < 0xabc0)
1657 return true;
1658 if (cp < 0xabc0)
1659 return false;
1660 if (cp < 0xabe3)
1661 return true;
1662 if (cp < 0xac00)
1663 return false;
1664 if (cp < 0xd7a4)
1665 return true;
1666 return false;
1667 }
1668 if (cp < 0x1032d) {
1669 if (cp < 0xff41) {
1670 if (cp < 0xfb3e) {
1671 if (cp < 0xfb13) {
1672 if (cp < 0xd7b0)
1673 return false;
1674 if (cp < 0xd7c7)
1675 return true;
1676 if (cp < 0xd7cb)
1677 return false;
1678 if (cp < 0xd7fc)
1679 return true;
1680 if (cp < 0xf900)
1681 return false;
1682 if (cp < 0xfa6e)
1683 return true;
1684 if (cp < 0xfa70)
1685 return false;
1686 if (cp < 0xfada)
1687 return true;
1688 if (cp < 0xfb00)
1689 return false;
1690 if (cp < 0xfb07)
1691 return true;
1692 return false;
1693 }
1694 if (cp < 0xfb18)
1695 return true;
1696 if (cp === 0xfb1d)
1697 return true;
1698 if (cp < 0xfb1f)
1699 return false;
1700 if (cp < 0xfb29)
1701 return true;
1702 if (cp < 0xfb2a)
1703 return false;
1704 if (cp < 0xfb37)
1705 return true;
1706 if (cp < 0xfb38)
1707 return false;
1708 if (cp < 0xfb3d)
1709 return true;
1710 return false;
1711 }
1712 if (cp < 0xfd50) {
1713 if (cp === 0xfb3e)
1714 return true;
1715 if (cp < 0xfb40)
1716 return false;
1717 if (cp < 0xfb42)
1718 return true;
1719 if (cp < 0xfb43)
1720 return false;
1721 if (cp < 0xfb45)
1722 return true;
1723 if (cp < 0xfb46)
1724 return false;
1725 if (cp < 0xfbb2)
1726 return true;
1727 if (cp < 0xfbd3)
1728 return false;
1729 if (cp < 0xfd3e)
1730 return true;
1731 return false;
1732 }
1733 if (cp < 0xfd90)
1734 return true;
1735 if (cp < 0xfd92)
1736 return false;
1737 if (cp < 0xfdc8)
1738 return true;
1739 if (cp < 0xfdf0)
1740 return false;
1741 if (cp < 0xfdfc)
1742 return true;
1743 if (cp < 0xfe70)
1744 return false;
1745 if (cp < 0xfe75)
1746 return true;
1747 if (cp < 0xfe76)
1748 return false;
1749 if (cp < 0xfefd)
1750 return true;
1751 if (cp < 0xff21)
1752 return false;
1753 if (cp < 0xff3b)
1754 return true;
1755 return false;
1756 }
1757 if (cp < 0x10000) {
1758 if (cp < 0xffa0) {
1759 if (cp < 0xff41)
1760 return false;
1761 if (cp < 0xff5b)
1762 return true;
1763 if (cp < 0xff66)
1764 return false;
1765 if (cp < 0xff70)
1766 return true;
1767 if (cp === 0xff70)
1768 return true;
1769 if (cp < 0xff71)
1770 return false;
1771 if (cp < 0xff9e)
1772 return true;
1773 if (cp < 0xff9e)
1774 return false;
1775 if (cp < 0xffa0)
1776 return true;
1777 return false;
1778 }
1779 if (cp < 0xffbf)
1780 return true;
1781 if (cp < 0xffc2)
1782 return false;
1783 if (cp < 0xffc8)
1784 return true;
1785 if (cp < 0xffca)
1786 return false;
1787 if (cp < 0xffd0)
1788 return true;
1789 if (cp < 0xffd2)
1790 return false;
1791 if (cp < 0xffd8)
1792 return true;
1793 if (cp < 0xffda)
1794 return false;
1795 if (cp < 0xffdd)
1796 return true;
1797 return false;
1798 }
1799 if (cp < 0x10050) {
1800 if (cp < 0x10000)
1801 return false;
1802 if (cp < 0x1000c)
1803 return true;
1804 if (cp < 0x1000d)
1805 return false;
1806 if (cp < 0x10027)
1807 return true;
1808 if (cp < 0x10028)
1809 return false;
1810 if (cp < 0x1003b)
1811 return true;
1812 if (cp < 0x1003c)
1813 return false;
1814 if (cp < 0x1003e)
1815 return true;
1816 if (cp < 0x1003f)
1817 return false;
1818 if (cp < 0x1004e)
1819 return true;
1820 return false;
1821 }
1822 if (cp < 0x1005e)
1823 return true;
1824 if (cp < 0x10080)
1825 return false;
1826 if (cp < 0x100fb)
1827 return true;
1828 if (cp < 0x10140)
1829 return false;
1830 if (cp < 0x10175)
1831 return true;
1832 if (cp < 0x10280)
1833 return false;
1834 if (cp < 0x1029d)
1835 return true;
1836 if (cp < 0x102a0)
1837 return false;
1838 if (cp < 0x102d1)
1839 return true;
1840 if (cp < 0x10300)
1841 return false;
1842 if (cp < 0x10320)
1843 return true;
1844 return false;
1845 }
1846 if (cp < 0x10837) {
1847 if (cp < 0x10450) {
1848 if (cp < 0x10380) {
1849 if (cp < 0x1032d)
1850 return false;
1851 if (cp < 0x10341)
1852 return true;
1853 if (cp === 0x10341)
1854 return true;
1855 if (cp < 0x10342)
1856 return false;
1857 if (cp < 0x1034a)
1858 return true;
1859 if (cp === 0x1034a)
1860 return true;
1861 if (cp < 0x10350)
1862 return false;
1863 if (cp < 0x10376)
1864 return true;
1865 return false;
1866 }
1867 if (cp < 0x1039e)
1868 return true;
1869 if (cp < 0x103a0)
1870 return false;
1871 if (cp < 0x103c4)
1872 return true;
1873 if (cp < 0x103c8)
1874 return false;
1875 if (cp < 0x103d0)
1876 return true;
1877 if (cp < 0x103d1)
1878 return false;
1879 if (cp < 0x103d6)
1880 return true;
1881 if (cp < 0x10400)
1882 return false;
1883 if (cp < 0x10450)
1884 return true;
1885 return false;
1886 }
1887 if (cp < 0x10600) {
1888 if (cp < 0x10450)
1889 return false;
1890 if (cp < 0x1049e)
1891 return true;
1892 if (cp < 0x104b0)
1893 return false;
1894 if (cp < 0x104d4)
1895 return true;
1896 if (cp < 0x104d8)
1897 return false;
1898 if (cp < 0x104fc)
1899 return true;
1900 if (cp < 0x10500)
1901 return false;
1902 if (cp < 0x10528)
1903 return true;
1904 if (cp < 0x10530)
1905 return false;
1906 if (cp < 0x10564)
1907 return true;
1908 return false;
1909 }
1910 if (cp < 0x10737)
1911 return true;
1912 if (cp < 0x10740)
1913 return false;
1914 if (cp < 0x10756)
1915 return true;
1916 if (cp < 0x10760)
1917 return false;
1918 if (cp < 0x10768)
1919 return true;
1920 if (cp < 0x10800)
1921 return false;
1922 if (cp < 0x10806)
1923 return true;
1924 if (cp === 0x10808)
1925 return true;
1926 if (cp < 0x1080a)
1927 return false;
1928 if (cp < 0x10836)
1929 return true;
1930 return false;
1931 }
1932 if (cp < 0x109be) {
1933 if (cp < 0x108e0) {
1934 if (cp < 0x10837)
1935 return false;
1936 if (cp < 0x10839)
1937 return true;
1938 if (cp === 0x1083c)
1939 return true;
1940 if (cp < 0x1083f)
1941 return false;
1942 if (cp < 0x10856)
1943 return true;
1944 if (cp < 0x10860)
1945 return false;
1946 if (cp < 0x10877)
1947 return true;
1948 if (cp < 0x10880)
1949 return false;
1950 if (cp < 0x1089f)
1951 return true;
1952 return false;
1953 }
1954 if (cp < 0x108f3)
1955 return true;
1956 if (cp < 0x108f4)
1957 return false;
1958 if (cp < 0x108f6)
1959 return true;
1960 if (cp < 0x10900)
1961 return false;
1962 if (cp < 0x10916)
1963 return true;
1964 if (cp < 0x10920)
1965 return false;
1966 if (cp < 0x1093a)
1967 return true;
1968 if (cp < 0x10980)
1969 return false;
1970 if (cp < 0x109b8)
1971 return true;
1972 return false;
1973 }
1974 if (cp < 0x10a60) {
1975 if (cp < 0x109be)
1976 return false;
1977 if (cp < 0x109c0)
1978 return true;
1979 if (cp === 0x10a00)
1980 return true;
1981 if (cp < 0x10a10)
1982 return false;
1983 if (cp < 0x10a14)
1984 return true;
1985 if (cp < 0x10a15)
1986 return false;
1987 if (cp < 0x10a18)
1988 return true;
1989 if (cp < 0x10a19)
1990 return false;
1991 if (cp < 0x10a36)
1992 return true;
1993 return false;
1994 }
1995 if (cp < 0x10a7d)
1996 return true;
1997 if (cp < 0x10a80)
1998 return false;
1999 if (cp < 0x10a9d)
2000 return true;
2001 if (cp < 0x10ac0)
2002 return false;
2003 if (cp < 0x10ac8)
2004 return true;
2005 if (cp < 0x10ac9)
2006 return false;
2007 if (cp < 0x10ae5)
2008 return true;
2009 if (cp < 0x10b00)
2010 return false;
2011 if (cp < 0x10b36)
2012 return true;
2013 if (cp < 0x10b40)
2014 return false;
2015 if (cp < 0x10b56)
2016 return true;
2017 return false;
2018 }
2019 if (cp < 0x16e40) {
2020 if (cp < 0x11580) {
2021 if (cp < 0x11213) {
2022 if (cp < 0x11083) {
2023 if (cp < 0x10d00) {
2024 if (cp < 0x10b60)
2025 return false;
2026 if (cp < 0x10b73)
2027 return true;
2028 if (cp < 0x10b80)
2029 return false;
2030 if (cp < 0x10b92)
2031 return true;
2032 if (cp < 0x10c00)
2033 return false;
2034 if (cp < 0x10c49)
2035 return true;
2036 if (cp < 0x10c80)
2037 return false;
2038 if (cp < 0x10cb3)
2039 return true;
2040 if (cp < 0x10cc0)
2041 return false;
2042 if (cp < 0x10cf3)
2043 return true;
2044 return false;
2045 }
2046 if (cp < 0x10d24)
2047 return true;
2048 if (cp < 0x10f00)
2049 return false;
2050 if (cp < 0x10f1d)
2051 return true;
2052 if (cp === 0x10f27)
2053 return true;
2054 if (cp < 0x10f30)
2055 return false;
2056 if (cp < 0x10f46)
2057 return true;
2058 if (cp < 0x11003)
2059 return false;
2060 if (cp < 0x11038)
2061 return true;
2062 return false;
2063 }
2064 if (cp < 0x11176) {
2065 if (cp < 0x11083)
2066 return false;
2067 if (cp < 0x110b0)
2068 return true;
2069 if (cp < 0x110d0)
2070 return false;
2071 if (cp < 0x110e9)
2072 return true;
2073 if (cp < 0x11103)
2074 return false;
2075 if (cp < 0x11127)
2076 return true;
2077 if (cp === 0x11144)
2078 return true;
2079 if (cp < 0x11150)
2080 return false;
2081 if (cp < 0x11173)
2082 return true;
2083 return false;
2084 }
2085 if (cp === 0x11176)
2086 return true;
2087 if (cp < 0x11183)
2088 return false;
2089 if (cp < 0x111b3)
2090 return true;
2091 if (cp < 0x111c1)
2092 return false;
2093 if (cp < 0x111c5)
2094 return true;
2095 if (cp === 0x111da)
2096 return true;
2097 if (cp === 0x111dc)
2098 return true;
2099 if (cp < 0x11200)
2100 return false;
2101 if (cp < 0x11212)
2102 return true;
2103 return false;
2104 }
2105 if (cp < 0x1132a) {
2106 if (cp < 0x1129f) {
2107 if (cp < 0x11213)
2108 return false;
2109 if (cp < 0x1122c)
2110 return true;
2111 if (cp < 0x11280)
2112 return false;
2113 if (cp < 0x11287)
2114 return true;
2115 if (cp === 0x11288)
2116 return true;
2117 if (cp < 0x1128a)
2118 return false;
2119 if (cp < 0x1128e)
2120 return true;
2121 if (cp < 0x1128f)
2122 return false;
2123 if (cp < 0x1129e)
2124 return true;
2125 return false;
2126 }
2127 if (cp < 0x112a9)
2128 return true;
2129 if (cp < 0x112b0)
2130 return false;
2131 if (cp < 0x112df)
2132 return true;
2133 if (cp < 0x11305)
2134 return false;
2135 if (cp < 0x1130d)
2136 return true;
2137 if (cp < 0x1130f)
2138 return false;
2139 if (cp < 0x11311)
2140 return true;
2141 if (cp < 0x11313)
2142 return false;
2143 if (cp < 0x11329)
2144 return true;
2145 return false;
2146 }
2147 if (cp < 0x1135d) {
2148 if (cp < 0x1132a)
2149 return false;
2150 if (cp < 0x11331)
2151 return true;
2152 if (cp < 0x11332)
2153 return false;
2154 if (cp < 0x11334)
2155 return true;
2156 if (cp < 0x11335)
2157 return false;
2158 if (cp < 0x1133a)
2159 return true;
2160 if (cp === 0x1133d)
2161 return true;
2162 if (cp === 0x11350)
2163 return true;
2164 return false;
2165 }
2166 if (cp < 0x11362)
2167 return true;
2168 if (cp < 0x11400)
2169 return false;
2170 if (cp < 0x11435)
2171 return true;
2172 if (cp < 0x11447)
2173 return false;
2174 if (cp < 0x1144b)
2175 return true;
2176 if (cp < 0x11480)
2177 return false;
2178 if (cp < 0x114b0)
2179 return true;
2180 if (cp < 0x114c4)
2181 return false;
2182 if (cp < 0x114c6)
2183 return true;
2184 if (cp === 0x114c7)
2185 return true;
2186 return false;
2187 }
2188 if (cp < 0x11d00) {
2189 if (cp < 0x11a0b) {
2190 if (cp < 0x11700) {
2191 if (cp < 0x11580)
2192 return false;
2193 if (cp < 0x115af)
2194 return true;
2195 if (cp < 0x115d8)
2196 return false;
2197 if (cp < 0x115dc)
2198 return true;
2199 if (cp < 0x11600)
2200 return false;
2201 if (cp < 0x11630)
2202 return true;
2203 if (cp === 0x11644)
2204 return true;
2205 if (cp < 0x11680)
2206 return false;
2207 if (cp < 0x116ab)
2208 return true;
2209 return false;
2210 }
2211 if (cp < 0x1171b)
2212 return true;
2213 if (cp < 0x11800)
2214 return false;
2215 if (cp < 0x1182c)
2216 return true;
2217 if (cp < 0x118a0)
2218 return false;
2219 if (cp < 0x118e0)
2220 return true;
2221 if (cp === 0x118ff)
2222 return true;
2223 if (cp === 0x11a00)
2224 return true;
2225 return false;
2226 }
2227 if (cp < 0x11a9d) {
2228 if (cp < 0x11a0b)
2229 return false;
2230 if (cp < 0x11a33)
2231 return true;
2232 if (cp === 0x11a3a)
2233 return true;
2234 if (cp === 0x11a50)
2235 return true;
2236 if (cp < 0x11a5c)
2237 return false;
2238 if (cp < 0x11a84)
2239 return true;
2240 if (cp < 0x11a86)
2241 return false;
2242 if (cp < 0x11a8a)
2243 return true;
2244 return false;
2245 }
2246 if (cp === 0x11a9d)
2247 return true;
2248 if (cp < 0x11ac0)
2249 return false;
2250 if (cp < 0x11af9)
2251 return true;
2252 if (cp < 0x11c00)
2253 return false;
2254 if (cp < 0x11c09)
2255 return true;
2256 if (cp < 0x11c0a)
2257 return false;
2258 if (cp < 0x11c2f)
2259 return true;
2260 if (cp === 0x11c40)
2261 return true;
2262 if (cp < 0x11c72)
2263 return false;
2264 if (cp < 0x11c90)
2265 return true;
2266 return false;
2267 }
2268 if (cp < 0x12400) {
2269 if (cp < 0x11d67) {
2270 if (cp < 0x11d00)
2271 return false;
2272 if (cp < 0x11d07)
2273 return true;
2274 if (cp < 0x11d08)
2275 return false;
2276 if (cp < 0x11d0a)
2277 return true;
2278 if (cp < 0x11d0b)
2279 return false;
2280 if (cp < 0x11d31)
2281 return true;
2282 if (cp === 0x11d46)
2283 return true;
2284 if (cp < 0x11d60)
2285 return false;
2286 if (cp < 0x11d66)
2287 return true;
2288 return false;
2289 }
2290 if (cp < 0x11d69)
2291 return true;
2292 if (cp < 0x11d6a)
2293 return false;
2294 if (cp < 0x11d8a)
2295 return true;
2296 if (cp === 0x11d98)
2297 return true;
2298 if (cp < 0x11ee0)
2299 return false;
2300 if (cp < 0x11ef3)
2301 return true;
2302 if (cp < 0x12000)
2303 return false;
2304 if (cp < 0x1239a)
2305 return true;
2306 return false;
2307 }
2308 if (cp < 0x16a40) {
2309 if (cp < 0x12400)
2310 return false;
2311 if (cp < 0x1246f)
2312 return true;
2313 if (cp < 0x12480)
2314 return false;
2315 if (cp < 0x12544)
2316 return true;
2317 if (cp < 0x13000)
2318 return false;
2319 if (cp < 0x1342f)
2320 return true;
2321 if (cp < 0x14400)
2322 return false;
2323 if (cp < 0x14647)
2324 return true;
2325 if (cp < 0x16800)
2326 return false;
2327 if (cp < 0x16a39)
2328 return true;
2329 return false;
2330 }
2331 if (cp < 0x16a5f)
2332 return true;
2333 if (cp < 0x16ad0)
2334 return false;
2335 if (cp < 0x16aee)
2336 return true;
2337 if (cp < 0x16b00)
2338 return false;
2339 if (cp < 0x16b30)
2340 return true;
2341 if (cp < 0x16b40)
2342 return false;
2343 if (cp < 0x16b44)
2344 return true;
2345 if (cp < 0x16b63)
2346 return false;
2347 if (cp < 0x16b78)
2348 return true;
2349 if (cp < 0x16b7d)
2350 return false;
2351 if (cp < 0x16b90)
2352 return true;
2353 return false;
2354 }
2355 if (cp < 0x1d7c4) {
2356 if (cp < 0x1d4bd) {
2357 if (cp < 0x1bc70) {
2358 if (cp < 0x17000) {
2359 if (cp < 0x16e40)
2360 return false;
2361 if (cp < 0x16e80)
2362 return true;
2363 if (cp < 0x16f00)
2364 return false;
2365 if (cp < 0x16f45)
2366 return true;
2367 if (cp === 0x16f50)
2368 return true;
2369 if (cp < 0x16f93)
2370 return false;
2371 if (cp < 0x16fa0)
2372 return true;
2373 if (cp < 0x16fe0)
2374 return false;
2375 if (cp < 0x16fe2)
2376 return true;
2377 return false;
2378 }
2379 if (cp < 0x187f2)
2380 return true;
2381 if (cp < 0x18800)
2382 return false;
2383 if (cp < 0x18af3)
2384 return true;
2385 if (cp < 0x1b000)
2386 return false;
2387 if (cp < 0x1b11f)
2388 return true;
2389 if (cp < 0x1b170)
2390 return false;
2391 if (cp < 0x1b2fc)
2392 return true;
2393 if (cp < 0x1bc00)
2394 return false;
2395 if (cp < 0x1bc6b)
2396 return true;
2397 return false;
2398 }
2399 if (cp < 0x1d49e) {
2400 if (cp < 0x1bc70)
2401 return false;
2402 if (cp < 0x1bc7d)
2403 return true;
2404 if (cp < 0x1bc80)
2405 return false;
2406 if (cp < 0x1bc89)
2407 return true;
2408 if (cp < 0x1bc90)
2409 return false;
2410 if (cp < 0x1bc9a)
2411 return true;
2412 if (cp < 0x1d400)
2413 return false;
2414 if (cp < 0x1d455)
2415 return true;
2416 if (cp < 0x1d456)
2417 return false;
2418 if (cp < 0x1d49d)
2419 return true;
2420 return false;
2421 }
2422 if (cp < 0x1d4a0)
2423 return true;
2424 if (cp === 0x1d4a2)
2425 return true;
2426 if (cp < 0x1d4a5)
2427 return false;
2428 if (cp < 0x1d4a7)
2429 return true;
2430 if (cp < 0x1d4a9)
2431 return false;
2432 if (cp < 0x1d4ad)
2433 return true;
2434 if (cp < 0x1d4ae)
2435 return false;
2436 if (cp < 0x1d4ba)
2437 return true;
2438 if (cp === 0x1d4bb)
2439 return true;
2440 return false;
2441 }
2442 if (cp < 0x1d552) {
2443 if (cp < 0x1d51e) {
2444 if (cp < 0x1d4bd)
2445 return false;
2446 if (cp < 0x1d4c4)
2447 return true;
2448 if (cp < 0x1d4c5)
2449 return false;
2450 if (cp < 0x1d506)
2451 return true;
2452 if (cp < 0x1d507)
2453 return false;
2454 if (cp < 0x1d50b)
2455 return true;
2456 if (cp < 0x1d50d)
2457 return false;
2458 if (cp < 0x1d515)
2459 return true;
2460 if (cp < 0x1d516)
2461 return false;
2462 if (cp < 0x1d51d)
2463 return true;
2464 return false;
2465 }
2466 if (cp < 0x1d53a)
2467 return true;
2468 if (cp < 0x1d53b)
2469 return false;
2470 if (cp < 0x1d53f)
2471 return true;
2472 if (cp < 0x1d540)
2473 return false;
2474 if (cp < 0x1d545)
2475 return true;
2476 if (cp === 0x1d546)
2477 return true;
2478 if (cp < 0x1d54a)
2479 return false;
2480 if (cp < 0x1d551)
2481 return true;
2482 return false;
2483 }
2484 if (cp < 0x1d716) {
2485 if (cp < 0x1d552)
2486 return false;
2487 if (cp < 0x1d6a6)
2488 return true;
2489 if (cp < 0x1d6a8)
2490 return false;
2491 if (cp < 0x1d6c1)
2492 return true;
2493 if (cp < 0x1d6c2)
2494 return false;
2495 if (cp < 0x1d6db)
2496 return true;
2497 if (cp < 0x1d6dc)
2498 return false;
2499 if (cp < 0x1d6fb)
2500 return true;
2501 if (cp < 0x1d6fc)
2502 return false;
2503 if (cp < 0x1d715)
2504 return true;
2505 return false;
2506 }
2507 if (cp < 0x1d735)
2508 return true;
2509 if (cp < 0x1d736)
2510 return false;
2511 if (cp < 0x1d74f)
2512 return true;
2513 if (cp < 0x1d750)
2514 return false;
2515 if (cp < 0x1d76f)
2516 return true;
2517 if (cp < 0x1d770)
2518 return false;
2519 if (cp < 0x1d789)
2520 return true;
2521 if (cp < 0x1d78a)
2522 return false;
2523 if (cp < 0x1d7a9)
2524 return true;
2525 if (cp < 0x1d7aa)
2526 return false;
2527 if (cp < 0x1d7c3)
2528 return true;
2529 return false;
2530 }
2531 if (cp < 0x1ee5b) {
2532 if (cp < 0x1ee39) {
2533 if (cp < 0x1ee21) {
2534 if (cp < 0x1d7c4)
2535 return false;
2536 if (cp < 0x1d7cc)
2537 return true;
2538 if (cp < 0x1e800)
2539 return false;
2540 if (cp < 0x1e8c5)
2541 return true;
2542 if (cp < 0x1e900)
2543 return false;
2544 if (cp < 0x1e944)
2545 return true;
2546 if (cp < 0x1ee00)
2547 return false;
2548 if (cp < 0x1ee04)
2549 return true;
2550 if (cp < 0x1ee05)
2551 return false;
2552 if (cp < 0x1ee20)
2553 return true;
2554 return false;
2555 }
2556 if (cp < 0x1ee23)
2557 return true;
2558 if (cp === 0x1ee24)
2559 return true;
2560 if (cp === 0x1ee27)
2561 return true;
2562 if (cp < 0x1ee29)
2563 return false;
2564 if (cp < 0x1ee33)
2565 return true;
2566 if (cp < 0x1ee34)
2567 return false;
2568 if (cp < 0x1ee38)
2569 return true;
2570 return false;
2571 }
2572 if (cp < 0x1ee4b) {
2573 if (cp === 0x1ee39)
2574 return true;
2575 if (cp === 0x1ee3b)
2576 return true;
2577 if (cp === 0x1ee42)
2578 return true;
2579 if (cp === 0x1ee47)
2580 return true;
2581 if (cp === 0x1ee49)
2582 return true;
2583 return false;
2584 }
2585 if (cp === 0x1ee4b)
2586 return true;
2587 if (cp < 0x1ee4d)
2588 return false;
2589 if (cp < 0x1ee50)
2590 return true;
2591 if (cp < 0x1ee51)
2592 return false;
2593 if (cp < 0x1ee53)
2594 return true;
2595 if (cp === 0x1ee54)
2596 return true;
2597 if (cp === 0x1ee57)
2598 return true;
2599 if (cp === 0x1ee59)
2600 return true;
2601 return false;
2602 }
2603 if (cp < 0x1ee80) {
2604 if (cp < 0x1ee67) {
2605 if (cp === 0x1ee5b)
2606 return true;
2607 if (cp === 0x1ee5d)
2608 return true;
2609 if (cp === 0x1ee5f)
2610 return true;
2611 if (cp < 0x1ee61)
2612 return false;
2613 if (cp < 0x1ee63)
2614 return true;
2615 if (cp === 0x1ee64)
2616 return true;
2617 return false;
2618 }
2619 if (cp < 0x1ee6b)
2620 return true;
2621 if (cp < 0x1ee6c)
2622 return false;
2623 if (cp < 0x1ee73)
2624 return true;
2625 if (cp < 0x1ee74)
2626 return false;
2627 if (cp < 0x1ee78)
2628 return true;
2629 if (cp < 0x1ee79)
2630 return false;
2631 if (cp < 0x1ee7d)
2632 return true;
2633 if (cp === 0x1ee7e)
2634 return true;
2635 return false;
2636 }
2637 if (cp < 0x20000) {
2638 if (cp < 0x1ee80)
2639 return false;
2640 if (cp < 0x1ee8a)
2641 return true;
2642 if (cp < 0x1ee8b)
2643 return false;
2644 if (cp < 0x1ee9c)
2645 return true;
2646 if (cp < 0x1eea1)
2647 return false;
2648 if (cp < 0x1eea4)
2649 return true;
2650 if (cp < 0x1eea5)
2651 return false;
2652 if (cp < 0x1eeaa)
2653 return true;
2654 if (cp < 0x1eeab)
2655 return false;
2656 if (cp < 0x1eebc)
2657 return true;
2658 return false;
2659 }
2660 if (cp < 0x2a6d7)
2661 return true;
2662 if (cp < 0x2a700)
2663 return false;
2664 if (cp < 0x2b735)
2665 return true;
2666 if (cp < 0x2b740)
2667 return false;
2668 if (cp < 0x2b81e)
2669 return true;
2670 if (cp < 0x2b820)
2671 return false;
2672 if (cp < 0x2cea2)
2673 return true;
2674 if (cp < 0x2ceb0)
2675 return false;
2676 if (cp < 0x2ebe1)
2677 return true;
2678 if (cp < 0x2f800)
2679 return false;
2680 if (cp < 0x2fa1e)
2681 return true;
2682 return false;
2683}
2684function isLargeIdContinue(cp) {
2685 if (cp < 0x1cd0) {
2686 if (cp < 0xd82) {
2687 if (cp < 0xa83) {
2688 if (cp < 0x93b) {
2689 if (cp < 0x6ea) {
2690 if (cp < 0x5c7) {
2691 if (cp === 0xb7)
2692 return true;
2693 if (cp < 0x300)
2694 return false;
2695 if (cp < 0x370)
2696 return true;
2697 if (cp === 0x387)
2698 return true;
2699 if (cp < 0x483)
2700 return false;
2701 if (cp < 0x488)
2702 return true;
2703 if (cp < 0x591)
2704 return false;
2705 if (cp < 0x5be)
2706 return true;
2707 if (cp === 0x5bf)
2708 return true;
2709 if (cp < 0x5c1)
2710 return false;
2711 if (cp < 0x5c3)
2712 return true;
2713 if (cp < 0x5c4)
2714 return false;
2715 if (cp < 0x5c6)
2716 return true;
2717 return false;
2718 }
2719 if (cp === 0x5c7)
2720 return true;
2721 if (cp < 0x610)
2722 return false;
2723 if (cp < 0x61b)
2724 return true;
2725 if (cp < 0x64b)
2726 return false;
2727 if (cp < 0x660)
2728 return true;
2729 if (cp < 0x660)
2730 return false;
2731 if (cp < 0x66a)
2732 return true;
2733 if (cp === 0x670)
2734 return true;
2735 if (cp < 0x6d6)
2736 return false;
2737 if (cp < 0x6dd)
2738 return true;
2739 if (cp < 0x6df)
2740 return false;
2741 if (cp < 0x6e5)
2742 return true;
2743 if (cp < 0x6e7)
2744 return false;
2745 if (cp < 0x6e9)
2746 return true;
2747 return false;
2748 }
2749 if (cp < 0x816) {
2750 if (cp < 0x6ea)
2751 return false;
2752 if (cp < 0x6ee)
2753 return true;
2754 if (cp < 0x6f0)
2755 return false;
2756 if (cp < 0x6fa)
2757 return true;
2758 if (cp === 0x711)
2759 return true;
2760 if (cp < 0x730)
2761 return false;
2762 if (cp < 0x74b)
2763 return true;
2764 if (cp < 0x7a6)
2765 return false;
2766 if (cp < 0x7b1)
2767 return true;
2768 if (cp < 0x7c0)
2769 return false;
2770 if (cp < 0x7ca)
2771 return true;
2772 if (cp < 0x7eb)
2773 return false;
2774 if (cp < 0x7f4)
2775 return true;
2776 if (cp === 0x7fd)
2777 return true;
2778 return false;
2779 }
2780 if (cp < 0x81a)
2781 return true;
2782 if (cp < 0x81b)
2783 return false;
2784 if (cp < 0x824)
2785 return true;
2786 if (cp < 0x825)
2787 return false;
2788 if (cp < 0x828)
2789 return true;
2790 if (cp < 0x829)
2791 return false;
2792 if (cp < 0x82e)
2793 return true;
2794 if (cp < 0x859)
2795 return false;
2796 if (cp < 0x85c)
2797 return true;
2798 if (cp < 0x8d3)
2799 return false;
2800 if (cp < 0x8e2)
2801 return true;
2802 if (cp < 0x8e3)
2803 return false;
2804 if (cp < 0x903)
2805 return true;
2806 if (cp === 0x903)
2807 return true;
2808 if (cp === 0x93a)
2809 return true;
2810 return false;
2811 }
2812 if (cp < 0x9cd) {
2813 if (cp < 0x962) {
2814 if (cp === 0x93b)
2815 return true;
2816 if (cp === 0x93c)
2817 return true;
2818 if (cp < 0x93e)
2819 return false;
2820 if (cp < 0x941)
2821 return true;
2822 if (cp < 0x941)
2823 return false;
2824 if (cp < 0x949)
2825 return true;
2826 if (cp < 0x949)
2827 return false;
2828 if (cp < 0x94d)
2829 return true;
2830 if (cp === 0x94d)
2831 return true;
2832 if (cp < 0x94e)
2833 return false;
2834 if (cp < 0x950)
2835 return true;
2836 if (cp < 0x951)
2837 return false;
2838 if (cp < 0x958)
2839 return true;
2840 return false;
2841 }
2842 if (cp < 0x964)
2843 return true;
2844 if (cp < 0x966)
2845 return false;
2846 if (cp < 0x970)
2847 return true;
2848 if (cp === 0x981)
2849 return true;
2850 if (cp < 0x982)
2851 return false;
2852 if (cp < 0x984)
2853 return true;
2854 if (cp === 0x9bc)
2855 return true;
2856 if (cp < 0x9be)
2857 return false;
2858 if (cp < 0x9c1)
2859 return true;
2860 if (cp < 0x9c1)
2861 return false;
2862 if (cp < 0x9c5)
2863 return true;
2864 if (cp < 0x9c7)
2865 return false;
2866 if (cp < 0x9c9)
2867 return true;
2868 if (cp < 0x9cb)
2869 return false;
2870 if (cp < 0x9cd)
2871 return true;
2872 return false;
2873 }
2874 if (cp < 0xa3e) {
2875 if (cp === 0x9cd)
2876 return true;
2877 if (cp === 0x9d7)
2878 return true;
2879 if (cp < 0x9e2)
2880 return false;
2881 if (cp < 0x9e4)
2882 return true;
2883 if (cp < 0x9e6)
2884 return false;
2885 if (cp < 0x9f0)
2886 return true;
2887 if (cp === 0x9fe)
2888 return true;
2889 if (cp < 0xa01)
2890 return false;
2891 if (cp < 0xa03)
2892 return true;
2893 if (cp === 0xa03)
2894 return true;
2895 if (cp === 0xa3c)
2896 return true;
2897 return false;
2898 }
2899 if (cp < 0xa41)
2900 return true;
2901 if (cp < 0xa41)
2902 return false;
2903 if (cp < 0xa43)
2904 return true;
2905 if (cp < 0xa47)
2906 return false;
2907 if (cp < 0xa49)
2908 return true;
2909 if (cp < 0xa4b)
2910 return false;
2911 if (cp < 0xa4e)
2912 return true;
2913 if (cp === 0xa51)
2914 return true;
2915 if (cp < 0xa66)
2916 return false;
2917 if (cp < 0xa70)
2918 return true;
2919 if (cp < 0xa70)
2920 return false;
2921 if (cp < 0xa72)
2922 return true;
2923 if (cp === 0xa75)
2924 return true;
2925 if (cp < 0xa81)
2926 return false;
2927 if (cp < 0xa83)
2928 return true;
2929 return false;
2930 }
2931 if (cp < 0xc00) {
2932 if (cp < 0xb41) {
2933 if (cp < 0xae2) {
2934 if (cp === 0xa83)
2935 return true;
2936 if (cp === 0xabc)
2937 return true;
2938 if (cp < 0xabe)
2939 return false;
2940 if (cp < 0xac1)
2941 return true;
2942 if (cp < 0xac1)
2943 return false;
2944 if (cp < 0xac6)
2945 return true;
2946 if (cp < 0xac7)
2947 return false;
2948 if (cp < 0xac9)
2949 return true;
2950 if (cp === 0xac9)
2951 return true;
2952 if (cp < 0xacb)
2953 return false;
2954 if (cp < 0xacd)
2955 return true;
2956 if (cp === 0xacd)
2957 return true;
2958 return false;
2959 }
2960 if (cp < 0xae4)
2961 return true;
2962 if (cp < 0xae6)
2963 return false;
2964 if (cp < 0xaf0)
2965 return true;
2966 if (cp < 0xafa)
2967 return false;
2968 if (cp < 0xb00)
2969 return true;
2970 if (cp === 0xb01)
2971 return true;
2972 if (cp < 0xb02)
2973 return false;
2974 if (cp < 0xb04)
2975 return true;
2976 if (cp === 0xb3c)
2977 return true;
2978 if (cp === 0xb3e)
2979 return true;
2980 if (cp === 0xb3f)
2981 return true;
2982 if (cp === 0xb40)
2983 return true;
2984 return false;
2985 }
2986 if (cp < 0xb82) {
2987 if (cp < 0xb41)
2988 return false;
2989 if (cp < 0xb45)
2990 return true;
2991 if (cp < 0xb47)
2992 return false;
2993 if (cp < 0xb49)
2994 return true;
2995 if (cp < 0xb4b)
2996 return false;
2997 if (cp < 0xb4d)
2998 return true;
2999 if (cp === 0xb4d)
3000 return true;
3001 if (cp === 0xb56)
3002 return true;
3003 if (cp === 0xb57)
3004 return true;
3005 if (cp < 0xb62)
3006 return false;
3007 if (cp < 0xb64)
3008 return true;
3009 if (cp < 0xb66)
3010 return false;
3011 if (cp < 0xb70)
3012 return true;
3013 return false;
3014 }
3015 if (cp === 0xb82)
3016 return true;
3017 if (cp < 0xbbe)
3018 return false;
3019 if (cp < 0xbc0)
3020 return true;
3021 if (cp === 0xbc0)
3022 return true;
3023 if (cp < 0xbc1)
3024 return false;
3025 if (cp < 0xbc3)
3026 return true;
3027 if (cp < 0xbc6)
3028 return false;
3029 if (cp < 0xbc9)
3030 return true;
3031 if (cp < 0xbca)
3032 return false;
3033 if (cp < 0xbcd)
3034 return true;
3035 if (cp === 0xbcd)
3036 return true;
3037 if (cp === 0xbd7)
3038 return true;
3039 if (cp < 0xbe6)
3040 return false;
3041 if (cp < 0xbf0)
3042 return true;
3043 return false;
3044 }
3045 if (cp < 0xcc7) {
3046 if (cp < 0xc62) {
3047 if (cp === 0xc00)
3048 return true;
3049 if (cp < 0xc01)
3050 return false;
3051 if (cp < 0xc04)
3052 return true;
3053 if (cp === 0xc04)
3054 return true;
3055 if (cp < 0xc3e)
3056 return false;
3057 if (cp < 0xc41)
3058 return true;
3059 if (cp < 0xc41)
3060 return false;
3061 if (cp < 0xc45)
3062 return true;
3063 if (cp < 0xc46)
3064 return false;
3065 if (cp < 0xc49)
3066 return true;
3067 if (cp < 0xc4a)
3068 return false;
3069 if (cp < 0xc4e)
3070 return true;
3071 if (cp < 0xc55)
3072 return false;
3073 if (cp < 0xc57)
3074 return true;
3075 return false;
3076 }
3077 if (cp < 0xc64)
3078 return true;
3079 if (cp < 0xc66)
3080 return false;
3081 if (cp < 0xc70)
3082 return true;
3083 if (cp === 0xc81)
3084 return true;
3085 if (cp < 0xc82)
3086 return false;
3087 if (cp < 0xc84)
3088 return true;
3089 if (cp === 0xcbc)
3090 return true;
3091 if (cp === 0xcbe)
3092 return true;
3093 if (cp === 0xcbf)
3094 return true;
3095 if (cp < 0xcc0)
3096 return false;
3097 if (cp < 0xcc5)
3098 return true;
3099 if (cp === 0xcc6)
3100 return true;
3101 return false;
3102 }
3103 if (cp < 0xd3b) {
3104 if (cp < 0xcc7)
3105 return false;
3106 if (cp < 0xcc9)
3107 return true;
3108 if (cp < 0xcca)
3109 return false;
3110 if (cp < 0xccc)
3111 return true;
3112 if (cp < 0xccc)
3113 return false;
3114 if (cp < 0xcce)
3115 return true;
3116 if (cp < 0xcd5)
3117 return false;
3118 if (cp < 0xcd7)
3119 return true;
3120 if (cp < 0xce2)
3121 return false;
3122 if (cp < 0xce4)
3123 return true;
3124 if (cp < 0xce6)
3125 return false;
3126 if (cp < 0xcf0)
3127 return true;
3128 if (cp < 0xd00)
3129 return false;
3130 if (cp < 0xd02)
3131 return true;
3132 if (cp < 0xd02)
3133 return false;
3134 if (cp < 0xd04)
3135 return true;
3136 return false;
3137 }
3138 if (cp < 0xd3d)
3139 return true;
3140 if (cp < 0xd3e)
3141 return false;
3142 if (cp < 0xd41)
3143 return true;
3144 if (cp < 0xd41)
3145 return false;
3146 if (cp < 0xd45)
3147 return true;
3148 if (cp < 0xd46)
3149 return false;
3150 if (cp < 0xd49)
3151 return true;
3152 if (cp < 0xd4a)
3153 return false;
3154 if (cp < 0xd4d)
3155 return true;
3156 if (cp === 0xd4d)
3157 return true;
3158 if (cp === 0xd57)
3159 return true;
3160 if (cp < 0xd62)
3161 return false;
3162 if (cp < 0xd64)
3163 return true;
3164 if (cp < 0xd66)
3165 return false;
3166 if (cp < 0xd70)
3167 return true;
3168 return false;
3169 }
3170 if (cp < 0x17e0) {
3171 if (cp < 0x1038) {
3172 if (cp < 0xf18) {
3173 if (cp < 0xe31) {
3174 if (cp < 0xd82)
3175 return false;
3176 if (cp < 0xd84)
3177 return true;
3178 if (cp === 0xdca)
3179 return true;
3180 if (cp < 0xdcf)
3181 return false;
3182 if (cp < 0xdd2)
3183 return true;
3184 if (cp < 0xdd2)
3185 return false;
3186 if (cp < 0xdd5)
3187 return true;
3188 if (cp === 0xdd6)
3189 return true;
3190 if (cp < 0xdd8)
3191 return false;
3192 if (cp < 0xde0)
3193 return true;
3194 if (cp < 0xde6)
3195 return false;
3196 if (cp < 0xdf0)
3197 return true;
3198 if (cp < 0xdf2)
3199 return false;
3200 if (cp < 0xdf4)
3201 return true;
3202 return false;
3203 }
3204 if (cp === 0xe31)
3205 return true;
3206 if (cp < 0xe34)
3207 return false;
3208 if (cp < 0xe3b)
3209 return true;
3210 if (cp < 0xe47)
3211 return false;
3212 if (cp < 0xe4f)
3213 return true;
3214 if (cp < 0xe50)
3215 return false;
3216 if (cp < 0xe5a)
3217 return true;
3218 if (cp === 0xeb1)
3219 return true;
3220 if (cp < 0xeb4)
3221 return false;
3222 if (cp < 0xeba)
3223 return true;
3224 if (cp < 0xebb)
3225 return false;
3226 if (cp < 0xebd)
3227 return true;
3228 if (cp < 0xec8)
3229 return false;
3230 if (cp < 0xece)
3231 return true;
3232 if (cp < 0xed0)
3233 return false;
3234 if (cp < 0xeda)
3235 return true;
3236 return false;
3237 }
3238 if (cp < 0xf80) {
3239 if (cp < 0xf18)
3240 return false;
3241 if (cp < 0xf1a)
3242 return true;
3243 if (cp < 0xf20)
3244 return false;
3245 if (cp < 0xf2a)
3246 return true;
3247 if (cp === 0xf35)
3248 return true;
3249 if (cp === 0xf37)
3250 return true;
3251 if (cp === 0xf39)
3252 return true;
3253 if (cp < 0xf3e)
3254 return false;
3255 if (cp < 0xf40)
3256 return true;
3257 if (cp < 0xf71)
3258 return false;
3259 if (cp < 0xf7f)
3260 return true;
3261 if (cp === 0xf7f)
3262 return true;
3263 return false;
3264 }
3265 if (cp < 0xf85)
3266 return true;
3267 if (cp < 0xf86)
3268 return false;
3269 if (cp < 0xf88)
3270 return true;
3271 if (cp < 0xf8d)
3272 return false;
3273 if (cp < 0xf98)
3274 return true;
3275 if (cp < 0xf99)
3276 return false;
3277 if (cp < 0xfbd)
3278 return true;
3279 if (cp === 0xfc6)
3280 return true;
3281 if (cp < 0x102b)
3282 return false;
3283 if (cp < 0x102d)
3284 return true;
3285 if (cp < 0x102d)
3286 return false;
3287 if (cp < 0x1031)
3288 return true;
3289 if (cp === 0x1031)
3290 return true;
3291 if (cp < 0x1032)
3292 return false;
3293 if (cp < 0x1038)
3294 return true;
3295 return false;
3296 }
3297 if (cp < 0x1090) {
3298 if (cp < 0x1062) {
3299 if (cp === 0x1038)
3300 return true;
3301 if (cp < 0x1039)
3302 return false;
3303 if (cp < 0x103b)
3304 return true;
3305 if (cp < 0x103b)
3306 return false;
3307 if (cp < 0x103d)
3308 return true;
3309 if (cp < 0x103d)
3310 return false;
3311 if (cp < 0x103f)
3312 return true;
3313 if (cp < 0x1040)
3314 return false;
3315 if (cp < 0x104a)
3316 return true;
3317 if (cp < 0x1056)
3318 return false;
3319 if (cp < 0x1058)
3320 return true;
3321 if (cp < 0x1058)
3322 return false;
3323 if (cp < 0x105a)
3324 return true;
3325 if (cp < 0x105e)
3326 return false;
3327 if (cp < 0x1061)
3328 return true;
3329 return false;
3330 }
3331 if (cp < 0x1065)
3332 return true;
3333 if (cp < 0x1067)
3334 return false;
3335 if (cp < 0x106e)
3336 return true;
3337 if (cp < 0x1071)
3338 return false;
3339 if (cp < 0x1075)
3340 return true;
3341 if (cp === 0x1082)
3342 return true;
3343 if (cp < 0x1083)
3344 return false;
3345 if (cp < 0x1085)
3346 return true;
3347 if (cp < 0x1085)
3348 return false;
3349 if (cp < 0x1087)
3350 return true;
3351 if (cp < 0x1087)
3352 return false;
3353 if (cp < 0x108d)
3354 return true;
3355 if (cp === 0x108d)
3356 return true;
3357 if (cp === 0x108f)
3358 return true;
3359 return false;
3360 }
3361 if (cp < 0x1772) {
3362 if (cp < 0x1090)
3363 return false;
3364 if (cp < 0x109a)
3365 return true;
3366 if (cp < 0x109a)
3367 return false;
3368 if (cp < 0x109d)
3369 return true;
3370 if (cp === 0x109d)
3371 return true;
3372 if (cp < 0x135d)
3373 return false;
3374 if (cp < 0x1360)
3375 return true;
3376 if (cp < 0x1369)
3377 return false;
3378 if (cp < 0x1372)
3379 return true;
3380 if (cp < 0x1712)
3381 return false;
3382 if (cp < 0x1715)
3383 return true;
3384 if (cp < 0x1732)
3385 return false;
3386 if (cp < 0x1735)
3387 return true;
3388 if (cp < 0x1752)
3389 return false;
3390 if (cp < 0x1754)
3391 return true;
3392 return false;
3393 }
3394 if (cp < 0x1774)
3395 return true;
3396 if (cp < 0x17b4)
3397 return false;
3398 if (cp < 0x17b6)
3399 return true;
3400 if (cp === 0x17b6)
3401 return true;
3402 if (cp < 0x17b7)
3403 return false;
3404 if (cp < 0x17be)
3405 return true;
3406 if (cp < 0x17be)
3407 return false;
3408 if (cp < 0x17c6)
3409 return true;
3410 if (cp === 0x17c6)
3411 return true;
3412 if (cp < 0x17c7)
3413 return false;
3414 if (cp < 0x17c9)
3415 return true;
3416 if (cp < 0x17c9)
3417 return false;
3418 if (cp < 0x17d4)
3419 return true;
3420 if (cp === 0x17dd)
3421 return true;
3422 return false;
3423 }
3424 if (cp < 0x1b04) {
3425 if (cp < 0x1a1b) {
3426 if (cp < 0x1930) {
3427 if (cp < 0x17e0)
3428 return false;
3429 if (cp < 0x17ea)
3430 return true;
3431 if (cp < 0x180b)
3432 return false;
3433 if (cp < 0x180e)
3434 return true;
3435 if (cp < 0x1810)
3436 return false;
3437 if (cp < 0x181a)
3438 return true;
3439 if (cp === 0x18a9)
3440 return true;
3441 if (cp < 0x1920)
3442 return false;
3443 if (cp < 0x1923)
3444 return true;
3445 if (cp < 0x1923)
3446 return false;
3447 if (cp < 0x1927)
3448 return true;
3449 if (cp < 0x1927)
3450 return false;
3451 if (cp < 0x1929)
3452 return true;
3453 if (cp < 0x1929)
3454 return false;
3455 if (cp < 0x192c)
3456 return true;
3457 return false;
3458 }
3459 if (cp < 0x1932)
3460 return true;
3461 if (cp === 0x1932)
3462 return true;
3463 if (cp < 0x1933)
3464 return false;
3465 if (cp < 0x1939)
3466 return true;
3467 if (cp < 0x1939)
3468 return false;
3469 if (cp < 0x193c)
3470 return true;
3471 if (cp < 0x1946)
3472 return false;
3473 if (cp < 0x1950)
3474 return true;
3475 if (cp < 0x19d0)
3476 return false;
3477 if (cp < 0x19da)
3478 return true;
3479 if (cp === 0x19da)
3480 return true;
3481 if (cp < 0x1a17)
3482 return false;
3483 if (cp < 0x1a19)
3484 return true;
3485 if (cp < 0x1a19)
3486 return false;
3487 if (cp < 0x1a1b)
3488 return true;
3489 return false;
3490 }
3491 if (cp < 0x1a63) {
3492 if (cp === 0x1a1b)
3493 return true;
3494 if (cp === 0x1a55)
3495 return true;
3496 if (cp === 0x1a56)
3497 return true;
3498 if (cp === 0x1a57)
3499 return true;
3500 if (cp < 0x1a58)
3501 return false;
3502 if (cp < 0x1a5f)
3503 return true;
3504 if (cp === 0x1a60)
3505 return true;
3506 if (cp === 0x1a61)
3507 return true;
3508 if (cp === 0x1a62)
3509 return true;
3510 return false;
3511 }
3512 if (cp < 0x1a65)
3513 return true;
3514 if (cp < 0x1a65)
3515 return false;
3516 if (cp < 0x1a6d)
3517 return true;
3518 if (cp < 0x1a6d)
3519 return false;
3520 if (cp < 0x1a73)
3521 return true;
3522 if (cp < 0x1a73)
3523 return false;
3524 if (cp < 0x1a7d)
3525 return true;
3526 if (cp === 0x1a7f)
3527 return true;
3528 if (cp < 0x1a80)
3529 return false;
3530 if (cp < 0x1a8a)
3531 return true;
3532 if (cp < 0x1a90)
3533 return false;
3534 if (cp < 0x1a9a)
3535 return true;
3536 if (cp < 0x1ab0)
3537 return false;
3538 if (cp < 0x1abe)
3539 return true;
3540 if (cp < 0x1b00)
3541 return false;
3542 if (cp < 0x1b04)
3543 return true;
3544 return false;
3545 }
3546 if (cp < 0x1baa) {
3547 if (cp < 0x1b43) {
3548 if (cp === 0x1b04)
3549 return true;
3550 if (cp === 0x1b34)
3551 return true;
3552 if (cp === 0x1b35)
3553 return true;
3554 if (cp < 0x1b36)
3555 return false;
3556 if (cp < 0x1b3b)
3557 return true;
3558 if (cp === 0x1b3b)
3559 return true;
3560 if (cp === 0x1b3c)
3561 return true;
3562 if (cp < 0x1b3d)
3563 return false;
3564 if (cp < 0x1b42)
3565 return true;
3566 if (cp === 0x1b42)
3567 return true;
3568 return false;
3569 }
3570 if (cp < 0x1b45)
3571 return true;
3572 if (cp < 0x1b50)
3573 return false;
3574 if (cp < 0x1b5a)
3575 return true;
3576 if (cp < 0x1b6b)
3577 return false;
3578 if (cp < 0x1b74)
3579 return true;
3580 if (cp < 0x1b80)
3581 return false;
3582 if (cp < 0x1b82)
3583 return true;
3584 if (cp === 0x1b82)
3585 return true;
3586 if (cp === 0x1ba1)
3587 return true;
3588 if (cp < 0x1ba2)
3589 return false;
3590 if (cp < 0x1ba6)
3591 return true;
3592 if (cp < 0x1ba6)
3593 return false;
3594 if (cp < 0x1ba8)
3595 return true;
3596 if (cp < 0x1ba8)
3597 return false;
3598 if (cp < 0x1baa)
3599 return true;
3600 return false;
3601 }
3602 if (cp < 0x1bee) {
3603 if (cp === 0x1baa)
3604 return true;
3605 if (cp < 0x1bab)
3606 return false;
3607 if (cp < 0x1bae)
3608 return true;
3609 if (cp < 0x1bb0)
3610 return false;
3611 if (cp < 0x1bba)
3612 return true;
3613 if (cp === 0x1be6)
3614 return true;
3615 if (cp === 0x1be7)
3616 return true;
3617 if (cp < 0x1be8)
3618 return false;
3619 if (cp < 0x1bea)
3620 return true;
3621 if (cp < 0x1bea)
3622 return false;
3623 if (cp < 0x1bed)
3624 return true;
3625 if (cp === 0x1bed)
3626 return true;
3627 return false;
3628 }
3629 if (cp === 0x1bee)
3630 return true;
3631 if (cp < 0x1bef)
3632 return false;
3633 if (cp < 0x1bf2)
3634 return true;
3635 if (cp < 0x1bf2)
3636 return false;
3637 if (cp < 0x1bf4)
3638 return true;
3639 if (cp < 0x1c24)
3640 return false;
3641 if (cp < 0x1c2c)
3642 return true;
3643 if (cp < 0x1c2c)
3644 return false;
3645 if (cp < 0x1c34)
3646 return true;
3647 if (cp < 0x1c34)
3648 return false;
3649 if (cp < 0x1c36)
3650 return true;
3651 if (cp < 0x1c36)
3652 return false;
3653 if (cp < 0x1c38)
3654 return true;
3655 if (cp < 0x1c40)
3656 return false;
3657 if (cp < 0x1c4a)
3658 return true;
3659 if (cp < 0x1c50)
3660 return false;
3661 if (cp < 0x1c5a)
3662 return true;
3663 return false;
3664 }
3665 if (cp < 0x1123e) {
3666 if (cp < 0xaab7) {
3667 if (cp < 0xa8b4) {
3668 if (cp < 0x2d7f) {
3669 if (cp < 0x1cf8) {
3670 if (cp < 0x1cd0)
3671 return false;
3672 if (cp < 0x1cd3)
3673 return true;
3674 if (cp < 0x1cd4)
3675 return false;
3676 if (cp < 0x1ce1)
3677 return true;
3678 if (cp === 0x1ce1)
3679 return true;
3680 if (cp < 0x1ce2)
3681 return false;
3682 if (cp < 0x1ce9)
3683 return true;
3684 if (cp === 0x1ced)
3685 return true;
3686 if (cp < 0x1cf2)
3687 return false;
3688 if (cp < 0x1cf4)
3689 return true;
3690 if (cp === 0x1cf4)
3691 return true;
3692 if (cp === 0x1cf7)
3693 return true;
3694 return false;
3695 }
3696 if (cp < 0x1cfa)
3697 return true;
3698 if (cp < 0x1dc0)
3699 return false;
3700 if (cp < 0x1dfa)
3701 return true;
3702 if (cp < 0x1dfb)
3703 return false;
3704 if (cp < 0x1e00)
3705 return true;
3706 if (cp < 0x203f)
3707 return false;
3708 if (cp < 0x2041)
3709 return true;
3710 if (cp === 0x2054)
3711 return true;
3712 if (cp < 0x20d0)
3713 return false;
3714 if (cp < 0x20dd)
3715 return true;
3716 if (cp === 0x20e1)
3717 return true;
3718 if (cp < 0x20e5)
3719 return false;
3720 if (cp < 0x20f1)
3721 return true;
3722 if (cp < 0x2cef)
3723 return false;
3724 if (cp < 0x2cf2)
3725 return true;
3726 return false;
3727 }
3728 if (cp < 0xa69e) {
3729 if (cp === 0x2d7f)
3730 return true;
3731 if (cp < 0x2de0)
3732 return false;
3733 if (cp < 0x2e00)
3734 return true;
3735 if (cp < 0x302a)
3736 return false;
3737 if (cp < 0x302e)
3738 return true;
3739 if (cp < 0x302e)
3740 return false;
3741 if (cp < 0x3030)
3742 return true;
3743 if (cp < 0x3099)
3744 return false;
3745 if (cp < 0x309b)
3746 return true;
3747 if (cp < 0xa620)
3748 return false;
3749 if (cp < 0xa62a)
3750 return true;
3751 if (cp === 0xa66f)
3752 return true;
3753 if (cp < 0xa674)
3754 return false;
3755 if (cp < 0xa67e)
3756 return true;
3757 return false;
3758 }
3759 if (cp < 0xa6a0)
3760 return true;
3761 if (cp < 0xa6f0)
3762 return false;
3763 if (cp < 0xa6f2)
3764 return true;
3765 if (cp === 0xa802)
3766 return true;
3767 if (cp === 0xa806)
3768 return true;
3769 if (cp === 0xa80b)
3770 return true;
3771 if (cp < 0xa823)
3772 return false;
3773 if (cp < 0xa825)
3774 return true;
3775 if (cp < 0xa825)
3776 return false;
3777 if (cp < 0xa827)
3778 return true;
3779 if (cp === 0xa827)
3780 return true;
3781 if (cp < 0xa880)
3782 return false;
3783 if (cp < 0xa882)
3784 return true;
3785 return false;
3786 }
3787 if (cp < 0xa9d0) {
3788 if (cp < 0xa952) {
3789 if (cp < 0xa8b4)
3790 return false;
3791 if (cp < 0xa8c4)
3792 return true;
3793 if (cp < 0xa8c4)
3794 return false;
3795 if (cp < 0xa8c6)
3796 return true;
3797 if (cp < 0xa8d0)
3798 return false;
3799 if (cp < 0xa8da)
3800 return true;
3801 if (cp < 0xa8e0)
3802 return false;
3803 if (cp < 0xa8f2)
3804 return true;
3805 if (cp === 0xa8ff)
3806 return true;
3807 if (cp < 0xa900)
3808 return false;
3809 if (cp < 0xa90a)
3810 return true;
3811 if (cp < 0xa926)
3812 return false;
3813 if (cp < 0xa92e)
3814 return true;
3815 if (cp < 0xa947)
3816 return false;
3817 if (cp < 0xa952)
3818 return true;
3819 return false;
3820 }
3821 if (cp < 0xa954)
3822 return true;
3823 if (cp < 0xa980)
3824 return false;
3825 if (cp < 0xa983)
3826 return true;
3827 if (cp === 0xa983)
3828 return true;
3829 if (cp === 0xa9b3)
3830 return true;
3831 if (cp < 0xa9b4)
3832 return false;
3833 if (cp < 0xa9b6)
3834 return true;
3835 if (cp < 0xa9b6)
3836 return false;
3837 if (cp < 0xa9ba)
3838 return true;
3839 if (cp < 0xa9ba)
3840 return false;
3841 if (cp < 0xa9bc)
3842 return true;
3843 if (cp === 0xa9bc)
3844 return true;
3845 if (cp < 0xa9bd)
3846 return false;
3847 if (cp < 0xa9c1)
3848 return true;
3849 return false;
3850 }
3851 if (cp < 0xaa43) {
3852 if (cp < 0xa9d0)
3853 return false;
3854 if (cp < 0xa9da)
3855 return true;
3856 if (cp === 0xa9e5)
3857 return true;
3858 if (cp < 0xa9f0)
3859 return false;
3860 if (cp < 0xa9fa)
3861 return true;
3862 if (cp < 0xaa29)
3863 return false;
3864 if (cp < 0xaa2f)
3865 return true;
3866 if (cp < 0xaa2f)
3867 return false;
3868 if (cp < 0xaa31)
3869 return true;
3870 if (cp < 0xaa31)
3871 return false;
3872 if (cp < 0xaa33)
3873 return true;
3874 if (cp < 0xaa33)
3875 return false;
3876 if (cp < 0xaa35)
3877 return true;
3878 if (cp < 0xaa35)
3879 return false;
3880 if (cp < 0xaa37)
3881 return true;
3882 return false;
3883 }
3884 if (cp === 0xaa43)
3885 return true;
3886 if (cp === 0xaa4c)
3887 return true;
3888 if (cp === 0xaa4d)
3889 return true;
3890 if (cp < 0xaa50)
3891 return false;
3892 if (cp < 0xaa5a)
3893 return true;
3894 if (cp === 0xaa7b)
3895 return true;
3896 if (cp === 0xaa7c)
3897 return true;
3898 if (cp === 0xaa7d)
3899 return true;
3900 if (cp === 0xaab0)
3901 return true;
3902 if (cp < 0xaab2)
3903 return false;
3904 if (cp < 0xaab5)
3905 return true;
3906 return false;
3907 }
3908 if (cp < 0x10d30) {
3909 if (cp < 0xfe00) {
3910 if (cp < 0xabe3) {
3911 if (cp < 0xaab7)
3912 return false;
3913 if (cp < 0xaab9)
3914 return true;
3915 if (cp < 0xaabe)
3916 return false;
3917 if (cp < 0xaac0)
3918 return true;
3919 if (cp === 0xaac1)
3920 return true;
3921 if (cp === 0xaaeb)
3922 return true;
3923 if (cp < 0xaaec)
3924 return false;
3925 if (cp < 0xaaee)
3926 return true;
3927 if (cp < 0xaaee)
3928 return false;
3929 if (cp < 0xaaf0)
3930 return true;
3931 if (cp === 0xaaf5)
3932 return true;
3933 if (cp === 0xaaf6)
3934 return true;
3935 return false;
3936 }
3937 if (cp < 0xabe5)
3938 return true;
3939 if (cp === 0xabe5)
3940 return true;
3941 if (cp < 0xabe6)
3942 return false;
3943 if (cp < 0xabe8)
3944 return true;
3945 if (cp === 0xabe8)
3946 return true;
3947 if (cp < 0xabe9)
3948 return false;
3949 if (cp < 0xabeb)
3950 return true;
3951 if (cp === 0xabec)
3952 return true;
3953 if (cp === 0xabed)
3954 return true;
3955 if (cp < 0xabf0)
3956 return false;
3957 if (cp < 0xabfa)
3958 return true;
3959 if (cp === 0xfb1e)
3960 return true;
3961 return false;
3962 }
3963 if (cp < 0x10376) {
3964 if (cp < 0xfe00)
3965 return false;
3966 if (cp < 0xfe10)
3967 return true;
3968 if (cp < 0xfe20)
3969 return false;
3970 if (cp < 0xfe30)
3971 return true;
3972 if (cp < 0xfe33)
3973 return false;
3974 if (cp < 0xfe35)
3975 return true;
3976 if (cp < 0xfe4d)
3977 return false;
3978 if (cp < 0xfe50)
3979 return true;
3980 if (cp < 0xff10)
3981 return false;
3982 if (cp < 0xff1a)
3983 return true;
3984 if (cp === 0xff3f)
3985 return true;
3986 if (cp === 0x101fd)
3987 return true;
3988 if (cp === 0x102e0)
3989 return true;
3990 return false;
3991 }
3992 if (cp < 0x1037b)
3993 return true;
3994 if (cp < 0x104a0)
3995 return false;
3996 if (cp < 0x104aa)
3997 return true;
3998 if (cp < 0x10a01)
3999 return false;
4000 if (cp < 0x10a04)
4001 return true;
4002 if (cp < 0x10a05)
4003 return false;
4004 if (cp < 0x10a07)
4005 return true;
4006 if (cp < 0x10a0c)
4007 return false;
4008 if (cp < 0x10a10)
4009 return true;
4010 if (cp < 0x10a38)
4011 return false;
4012 if (cp < 0x10a3b)
4013 return true;
4014 if (cp === 0x10a3f)
4015 return true;
4016 if (cp < 0x10ae5)
4017 return false;
4018 if (cp < 0x10ae7)
4019 return true;
4020 if (cp < 0x10d24)
4021 return false;
4022 if (cp < 0x10d28)
4023 return true;
4024 return false;
4025 }
4026 if (cp < 0x1112d) {
4027 if (cp < 0x11082) {
4028 if (cp < 0x10d30)
4029 return false;
4030 if (cp < 0x10d3a)
4031 return true;
4032 if (cp < 0x10f46)
4033 return false;
4034 if (cp < 0x10f51)
4035 return true;
4036 if (cp === 0x11000)
4037 return true;
4038 if (cp === 0x11001)
4039 return true;
4040 if (cp === 0x11002)
4041 return true;
4042 if (cp < 0x11038)
4043 return false;
4044 if (cp < 0x11047)
4045 return true;
4046 if (cp < 0x11066)
4047 return false;
4048 if (cp < 0x11070)
4049 return true;
4050 if (cp < 0x1107f)
4051 return false;
4052 if (cp < 0x11082)
4053 return true;
4054 return false;
4055 }
4056 if (cp === 0x11082)
4057 return true;
4058 if (cp < 0x110b0)
4059 return false;
4060 if (cp < 0x110b3)
4061 return true;
4062 if (cp < 0x110b3)
4063 return false;
4064 if (cp < 0x110b7)
4065 return true;
4066 if (cp < 0x110b7)
4067 return false;
4068 if (cp < 0x110b9)
4069 return true;
4070 if (cp < 0x110b9)
4071 return false;
4072 if (cp < 0x110bb)
4073 return true;
4074 if (cp < 0x110f0)
4075 return false;
4076 if (cp < 0x110fa)
4077 return true;
4078 if (cp < 0x11100)
4079 return false;
4080 if (cp < 0x11103)
4081 return true;
4082 if (cp < 0x11127)
4083 return false;
4084 if (cp < 0x1112c)
4085 return true;
4086 if (cp === 0x1112c)
4087 return true;
4088 return false;
4089 }
4090 if (cp < 0x111bf) {
4091 if (cp < 0x1112d)
4092 return false;
4093 if (cp < 0x11135)
4094 return true;
4095 if (cp < 0x11136)
4096 return false;
4097 if (cp < 0x11140)
4098 return true;
4099 if (cp < 0x11145)
4100 return false;
4101 if (cp < 0x11147)
4102 return true;
4103 if (cp === 0x11173)
4104 return true;
4105 if (cp < 0x11180)
4106 return false;
4107 if (cp < 0x11182)
4108 return true;
4109 if (cp === 0x11182)
4110 return true;
4111 if (cp < 0x111b3)
4112 return false;
4113 if (cp < 0x111b6)
4114 return true;
4115 if (cp < 0x111b6)
4116 return false;
4117 if (cp < 0x111bf)
4118 return true;
4119 return false;
4120 }
4121 if (cp < 0x111c1)
4122 return true;
4123 if (cp < 0x111c9)
4124 return false;
4125 if (cp < 0x111cd)
4126 return true;
4127 if (cp < 0x111d0)
4128 return false;
4129 if (cp < 0x111da)
4130 return true;
4131 if (cp < 0x1122c)
4132 return false;
4133 if (cp < 0x1122f)
4134 return true;
4135 if (cp < 0x1122f)
4136 return false;
4137 if (cp < 0x11232)
4138 return true;
4139 if (cp < 0x11232)
4140 return false;
4141 if (cp < 0x11234)
4142 return true;
4143 if (cp === 0x11234)
4144 return true;
4145 if (cp === 0x11235)
4146 return true;
4147 if (cp < 0x11236)
4148 return false;
4149 if (cp < 0x11238)
4150 return true;
4151 return false;
4152 }
4153 if (cp < 0x11a33) {
4154 if (cp < 0x115af) {
4155 if (cp < 0x11435) {
4156 if (cp < 0x1133e) {
4157 if (cp === 0x1123e)
4158 return true;
4159 if (cp === 0x112df)
4160 return true;
4161 if (cp < 0x112e0)
4162 return false;
4163 if (cp < 0x112e3)
4164 return true;
4165 if (cp < 0x112e3)
4166 return false;
4167 if (cp < 0x112eb)
4168 return true;
4169 if (cp < 0x112f0)
4170 return false;
4171 if (cp < 0x112fa)
4172 return true;
4173 if (cp < 0x11300)
4174 return false;
4175 if (cp < 0x11302)
4176 return true;
4177 if (cp < 0x11302)
4178 return false;
4179 if (cp < 0x11304)
4180 return true;
4181 if (cp < 0x1133b)
4182 return false;
4183 if (cp < 0x1133d)
4184 return true;
4185 return false;
4186 }
4187 if (cp < 0x11340)
4188 return true;
4189 if (cp === 0x11340)
4190 return true;
4191 if (cp < 0x11341)
4192 return false;
4193 if (cp < 0x11345)
4194 return true;
4195 if (cp < 0x11347)
4196 return false;
4197 if (cp < 0x11349)
4198 return true;
4199 if (cp < 0x1134b)
4200 return false;
4201 if (cp < 0x1134e)
4202 return true;
4203 if (cp === 0x11357)
4204 return true;
4205 if (cp < 0x11362)
4206 return false;
4207 if (cp < 0x11364)
4208 return true;
4209 if (cp < 0x11366)
4210 return false;
4211 if (cp < 0x1136d)
4212 return true;
4213 if (cp < 0x11370)
4214 return false;
4215 if (cp < 0x11375)
4216 return true;
4217 return false;
4218 }
4219 if (cp < 0x114b0) {
4220 if (cp < 0x11435)
4221 return false;
4222 if (cp < 0x11438)
4223 return true;
4224 if (cp < 0x11438)
4225 return false;
4226 if (cp < 0x11440)
4227 return true;
4228 if (cp < 0x11440)
4229 return false;
4230 if (cp < 0x11442)
4231 return true;
4232 if (cp < 0x11442)
4233 return false;
4234 if (cp < 0x11445)
4235 return true;
4236 if (cp === 0x11445)
4237 return true;
4238 if (cp === 0x11446)
4239 return true;
4240 if (cp < 0x11450)
4241 return false;
4242 if (cp < 0x1145a)
4243 return true;
4244 if (cp === 0x1145e)
4245 return true;
4246 return false;
4247 }
4248 if (cp < 0x114b3)
4249 return true;
4250 if (cp < 0x114b3)
4251 return false;
4252 if (cp < 0x114b9)
4253 return true;
4254 if (cp === 0x114b9)
4255 return true;
4256 if (cp === 0x114ba)
4257 return true;
4258 if (cp < 0x114bb)
4259 return false;
4260 if (cp < 0x114bf)
4261 return true;
4262 if (cp < 0x114bf)
4263 return false;
4264 if (cp < 0x114c1)
4265 return true;
4266 if (cp === 0x114c1)
4267 return true;
4268 if (cp < 0x114c2)
4269 return false;
4270 if (cp < 0x114c4)
4271 return true;
4272 if (cp < 0x114d0)
4273 return false;
4274 if (cp < 0x114da)
4275 return true;
4276 return false;
4277 }
4278 if (cp < 0x116ae) {
4279 if (cp < 0x11633) {
4280 if (cp < 0x115af)
4281 return false;
4282 if (cp < 0x115b2)
4283 return true;
4284 if (cp < 0x115b2)
4285 return false;
4286 if (cp < 0x115b6)
4287 return true;
4288 if (cp < 0x115b8)
4289 return false;
4290 if (cp < 0x115bc)
4291 return true;
4292 if (cp < 0x115bc)
4293 return false;
4294 if (cp < 0x115be)
4295 return true;
4296 if (cp === 0x115be)
4297 return true;
4298 if (cp < 0x115bf)
4299 return false;
4300 if (cp < 0x115c1)
4301 return true;
4302 if (cp < 0x115dc)
4303 return false;
4304 if (cp < 0x115de)
4305 return true;
4306 if (cp < 0x11630)
4307 return false;
4308 if (cp < 0x11633)
4309 return true;
4310 return false;
4311 }
4312 if (cp < 0x1163b)
4313 return true;
4314 if (cp < 0x1163b)
4315 return false;
4316 if (cp < 0x1163d)
4317 return true;
4318 if (cp === 0x1163d)
4319 return true;
4320 if (cp === 0x1163e)
4321 return true;
4322 if (cp < 0x1163f)
4323 return false;
4324 if (cp < 0x11641)
4325 return true;
4326 if (cp < 0x11650)
4327 return false;
4328 if (cp < 0x1165a)
4329 return true;
4330 if (cp === 0x116ab)
4331 return true;
4332 if (cp === 0x116ac)
4333 return true;
4334 if (cp === 0x116ad)
4335 return true;
4336 return false;
4337 }
4338 if (cp < 0x11726) {
4339 if (cp < 0x116ae)
4340 return false;
4341 if (cp < 0x116b0)
4342 return true;
4343 if (cp < 0x116b0)
4344 return false;
4345 if (cp < 0x116b6)
4346 return true;
4347 if (cp === 0x116b6)
4348 return true;
4349 if (cp === 0x116b7)
4350 return true;
4351 if (cp < 0x116c0)
4352 return false;
4353 if (cp < 0x116ca)
4354 return true;
4355 if (cp < 0x1171d)
4356 return false;
4357 if (cp < 0x11720)
4358 return true;
4359 if (cp < 0x11720)
4360 return false;
4361 if (cp < 0x11722)
4362 return true;
4363 if (cp < 0x11722)
4364 return false;
4365 if (cp < 0x11726)
4366 return true;
4367 return false;
4368 }
4369 if (cp === 0x11726)
4370 return true;
4371 if (cp < 0x11727)
4372 return false;
4373 if (cp < 0x1172c)
4374 return true;
4375 if (cp < 0x11730)
4376 return false;
4377 if (cp < 0x1173a)
4378 return true;
4379 if (cp < 0x1182c)
4380 return false;
4381 if (cp < 0x1182f)
4382 return true;
4383 if (cp < 0x1182f)
4384 return false;
4385 if (cp < 0x11838)
4386 return true;
4387 if (cp === 0x11838)
4388 return true;
4389 if (cp < 0x11839)
4390 return false;
4391 if (cp < 0x1183b)
4392 return true;
4393 if (cp < 0x118e0)
4394 return false;
4395 if (cp < 0x118ea)
4396 return true;
4397 if (cp < 0x11a01)
4398 return false;
4399 if (cp < 0x11a0b)
4400 return true;
4401 return false;
4402 }
4403 if (cp < 0x11d97) {
4404 if (cp < 0x11ca9) {
4405 if (cp < 0x11a97) {
4406 if (cp < 0x11a33)
4407 return false;
4408 if (cp < 0x11a39)
4409 return true;
4410 if (cp === 0x11a39)
4411 return true;
4412 if (cp < 0x11a3b)
4413 return false;
4414 if (cp < 0x11a3f)
4415 return true;
4416 if (cp === 0x11a47)
4417 return true;
4418 if (cp < 0x11a51)
4419 return false;
4420 if (cp < 0x11a57)
4421 return true;
4422 if (cp < 0x11a57)
4423 return false;
4424 if (cp < 0x11a59)
4425 return true;
4426 if (cp < 0x11a59)
4427 return false;
4428 if (cp < 0x11a5c)
4429 return true;
4430 if (cp < 0x11a8a)
4431 return false;
4432 if (cp < 0x11a97)
4433 return true;
4434 return false;
4435 }
4436 if (cp === 0x11a97)
4437 return true;
4438 if (cp < 0x11a98)
4439 return false;
4440 if (cp < 0x11a9a)
4441 return true;
4442 if (cp === 0x11c2f)
4443 return true;
4444 if (cp < 0x11c30)
4445 return false;
4446 if (cp < 0x11c37)
4447 return true;
4448 if (cp < 0x11c38)
4449 return false;
4450 if (cp < 0x11c3e)
4451 return true;
4452 if (cp === 0x11c3e)
4453 return true;
4454 if (cp === 0x11c3f)
4455 return true;
4456 if (cp < 0x11c50)
4457 return false;
4458 if (cp < 0x11c5a)
4459 return true;
4460 if (cp < 0x11c92)
4461 return false;
4462 if (cp < 0x11ca8)
4463 return true;
4464 return false;
4465 }
4466 if (cp < 0x11d3c) {
4467 if (cp === 0x11ca9)
4468 return true;
4469 if (cp < 0x11caa)
4470 return false;
4471 if (cp < 0x11cb1)
4472 return true;
4473 if (cp === 0x11cb1)
4474 return true;
4475 if (cp < 0x11cb2)
4476 return false;
4477 if (cp < 0x11cb4)
4478 return true;
4479 if (cp === 0x11cb4)
4480 return true;
4481 if (cp < 0x11cb5)
4482 return false;
4483 if (cp < 0x11cb7)
4484 return true;
4485 if (cp < 0x11d31)
4486 return false;
4487 if (cp < 0x11d37)
4488 return true;
4489 if (cp === 0x11d3a)
4490 return true;
4491 return false;
4492 }
4493 if (cp < 0x11d3e)
4494 return true;
4495 if (cp < 0x11d3f)
4496 return false;
4497 if (cp < 0x11d46)
4498 return true;
4499 if (cp === 0x11d47)
4500 return true;
4501 if (cp < 0x11d50)
4502 return false;
4503 if (cp < 0x11d5a)
4504 return true;
4505 if (cp < 0x11d8a)
4506 return false;
4507 if (cp < 0x11d8f)
4508 return true;
4509 if (cp < 0x11d90)
4510 return false;
4511 if (cp < 0x11d92)
4512 return true;
4513 if (cp < 0x11d93)
4514 return false;
4515 if (cp < 0x11d95)
4516 return true;
4517 if (cp === 0x11d95)
4518 return true;
4519 if (cp === 0x11d96)
4520 return true;
4521 return false;
4522 }
4523 if (cp < 0x1d242) {
4524 if (cp < 0x16f51) {
4525 if (cp === 0x11d97)
4526 return true;
4527 if (cp < 0x11da0)
4528 return false;
4529 if (cp < 0x11daa)
4530 return true;
4531 if (cp < 0x11ef3)
4532 return false;
4533 if (cp < 0x11ef5)
4534 return true;
4535 if (cp < 0x11ef5)
4536 return false;
4537 if (cp < 0x11ef7)
4538 return true;
4539 if (cp < 0x16a60)
4540 return false;
4541 if (cp < 0x16a6a)
4542 return true;
4543 if (cp < 0x16af0)
4544 return false;
4545 if (cp < 0x16af5)
4546 return true;
4547 if (cp < 0x16b30)
4548 return false;
4549 if (cp < 0x16b37)
4550 return true;
4551 if (cp < 0x16b50)
4552 return false;
4553 if (cp < 0x16b5a)
4554 return true;
4555 return false;
4556 }
4557 if (cp < 0x16f7f)
4558 return true;
4559 if (cp < 0x16f8f)
4560 return false;
4561 if (cp < 0x16f93)
4562 return true;
4563 if (cp < 0x1bc9d)
4564 return false;
4565 if (cp < 0x1bc9f)
4566 return true;
4567 if (cp < 0x1d165)
4568 return false;
4569 if (cp < 0x1d167)
4570 return true;
4571 if (cp < 0x1d167)
4572 return false;
4573 if (cp < 0x1d16a)
4574 return true;
4575 if (cp < 0x1d16d)
4576 return false;
4577 if (cp < 0x1d173)
4578 return true;
4579 if (cp < 0x1d17b)
4580 return false;
4581 if (cp < 0x1d183)
4582 return true;
4583 if (cp < 0x1d185)
4584 return false;
4585 if (cp < 0x1d18c)
4586 return true;
4587 if (cp < 0x1d1aa)
4588 return false;
4589 if (cp < 0x1d1ae)
4590 return true;
4591 return false;
4592 }
4593 if (cp < 0x1e000) {
4594 if (cp < 0x1d242)
4595 return false;
4596 if (cp < 0x1d245)
4597 return true;
4598 if (cp < 0x1d7ce)
4599 return false;
4600 if (cp < 0x1d800)
4601 return true;
4602 if (cp < 0x1da00)
4603 return false;
4604 if (cp < 0x1da37)
4605 return true;
4606 if (cp < 0x1da3b)
4607 return false;
4608 if (cp < 0x1da6d)
4609 return true;
4610 if (cp === 0x1da75)
4611 return true;
4612 if (cp === 0x1da84)
4613 return true;
4614 if (cp < 0x1da9b)
4615 return false;
4616 if (cp < 0x1daa0)
4617 return true;
4618 if (cp < 0x1daa1)
4619 return false;
4620 if (cp < 0x1dab0)
4621 return true;
4622 return false;
4623 }
4624 if (cp < 0x1e007)
4625 return true;
4626 if (cp < 0x1e008)
4627 return false;
4628 if (cp < 0x1e019)
4629 return true;
4630 if (cp < 0x1e01b)
4631 return false;
4632 if (cp < 0x1e022)
4633 return true;
4634 if (cp < 0x1e023)
4635 return false;
4636 if (cp < 0x1e025)
4637 return true;
4638 if (cp < 0x1e026)
4639 return false;
4640 if (cp < 0x1e02b)
4641 return true;
4642 if (cp < 0x1e8d0)
4643 return false;
4644 if (cp < 0x1e8d7)
4645 return true;
4646 if (cp < 0x1e944)
4647 return false;
4648 if (cp < 0x1e94b)
4649 return true;
4650 if (cp < 0x1e950)
4651 return false;
4652 if (cp < 0x1e95a)
4653 return true;
4654 if (cp < 0xe0100)
4655 return false;
4656 if (cp < 0xe01f0)
4657 return true;
4658 return false;
4659}
4660
4661const PropertyData = {
4662 $LONE: new Set([
4663 "ASCII",
4664 "ASCII_Hex_Digit",
4665 "AHex",
4666 "Alphabetic",
4667 "Alpha",
4668 "Any",
4669 "Assigned",
4670 "Bidi_Control",
4671 "Bidi_C",
4672 "Bidi_Mirrored",
4673 "Bidi_M",
4674 "Case_Ignorable",
4675 "CI",
4676 "Cased",
4677 "Changes_When_Casefolded",
4678 "CWCF",
4679 "Changes_When_Casemapped",
4680 "CWCM",
4681 "Changes_When_Lowercased",
4682 "CWL",
4683 "Changes_When_NFKC_Casefolded",
4684 "CWKCF",
4685 "Changes_When_Titlecased",
4686 "CWT",
4687 "Changes_When_Uppercased",
4688 "CWU",
4689 "Dash",
4690 "Default_Ignorable_Code_Point",
4691 "DI",
4692 "Deprecated",
4693 "Dep",
4694 "Diacritic",
4695 "Dia",
4696 "Emoji",
4697 "Emoji_Component",
4698 "Emoji_Modifier",
4699 "Emoji_Modifier_Base",
4700 "Emoji_Presentation",
4701 "Extender",
4702 "Ext",
4703 "Grapheme_Base",
4704 "Gr_Base",
4705 "Grapheme_Extend",
4706 "Gr_Ext",
4707 "Hex_Digit",
4708 "Hex",
4709 "IDS_Binary_Operator",
4710 "IDSB",
4711 "IDS_Trinary_Operator",
4712 "IDST",
4713 "ID_Continue",
4714 "IDC",
4715 "ID_Start",
4716 "IDS",
4717 "Ideographic",
4718 "Ideo",
4719 "Join_Control",
4720 "Join_C",
4721 "Logical_Order_Exception",
4722 "LOE",
4723 "Lowercase",
4724 "Lower",
4725 "Math",
4726 "Noncharacter_Code_Point",
4727 "NChar",
4728 "Pattern_Syntax",
4729 "Pat_Syn",
4730 "Pattern_White_Space",
4731 "Pat_WS",
4732 "Quotation_Mark",
4733 "QMark",
4734 "Radical",
4735 "Regional_Indicator",
4736 "RI",
4737 "Sentence_Terminal",
4738 "STerm",
4739 "Soft_Dotted",
4740 "SD",
4741 "Terminal_Punctuation",
4742 "Term",
4743 "Unified_Ideograph",
4744 "UIdeo",
4745 "Uppercase",
4746 "Upper",
4747 "Variation_Selector",
4748 "VS",
4749 "White_Space",
4750 "space",
4751 "XID_Continue",
4752 "XIDC",
4753 "XID_Start",
4754 "XIDS",
4755 ]),
4756 General_Category: new Set([
4757 "Cased_Letter",
4758 "LC",
4759 "Close_Punctuation",
4760 "Pe",
4761 "Connector_Punctuation",
4762 "Pc",
4763 "Control",
4764 "Cc",
4765 "cntrl",
4766 "Currency_Symbol",
4767 "Sc",
4768 "Dash_Punctuation",
4769 "Pd",
4770 "Decimal_Number",
4771 "Nd",
4772 "digit",
4773 "Enclosing_Mark",
4774 "Me",
4775 "Final_Punctuation",
4776 "Pf",
4777 "Format",
4778 "Cf",
4779 "Initial_Punctuation",
4780 "Pi",
4781 "Letter",
4782 "L",
4783 "Letter_Number",
4784 "Nl",
4785 "Line_Separator",
4786 "Zl",
4787 "Lowercase_Letter",
4788 "Ll",
4789 "Mark",
4790 "M",
4791 "Combining_Mark",
4792 "Math_Symbol",
4793 "Sm",
4794 "Modifier_Letter",
4795 "Lm",
4796 "Modifier_Symbol",
4797 "Sk",
4798 "Nonspacing_Mark",
4799 "Mn",
4800 "Number",
4801 "N",
4802 "Open_Punctuation",
4803 "Ps",
4804 "Other",
4805 "C",
4806 "Other_Letter",
4807 "Lo",
4808 "Other_Number",
4809 "No",
4810 "Other_Punctuation",
4811 "Po",
4812 "Other_Symbol",
4813 "So",
4814 "Paragraph_Separator",
4815 "Zp",
4816 "Private_Use",
4817 "Co",
4818 "Punctuation",
4819 "P",
4820 "punct",
4821 "Separator",
4822 "Z",
4823 "Space_Separator",
4824 "Zs",
4825 "Spacing_Mark",
4826 "Mc",
4827 "Surrogate",
4828 "Cs",
4829 "Symbol",
4830 "S",
4831 "Titlecase_Letter",
4832 "Lt",
4833 "Unassigned",
4834 "Cn",
4835 "Uppercase_Letter",
4836 "Lu",
4837 ]),
4838 Script: new Set([
4839 "Adlam",
4840 "Adlm",
4841 "Ahom",
4842 "Anatolian_Hieroglyphs",
4843 "Hluw",
4844 "Arabic",
4845 "Arab",
4846 "Armenian",
4847 "Armn",
4848 "Avestan",
4849 "Avst",
4850 "Balinese",
4851 "Bali",
4852 "Bamum",
4853 "Bamu",
4854 "Bassa_Vah",
4855 "Bass",
4856 "Batak",
4857 "Batk",
4858 "Bengali",
4859 "Beng",
4860 "Bhaiksuki",
4861 "Bhks",
4862 "Bopomofo",
4863 "Bopo",
4864 "Brahmi",
4865 "Brah",
4866 "Braille",
4867 "Brai",
4868 "Buginese",
4869 "Bugi",
4870 "Buhid",
4871 "Buhd",
4872 "Canadian_Aboriginal",
4873 "Cans",
4874 "Carian",
4875 "Cari",
4876 "Caucasian_Albanian",
4877 "Aghb",
4878 "Chakma",
4879 "Cakm",
4880 "Cham",
4881 "Cherokee",
4882 "Cher",
4883 "Common",
4884 "Zyyy",
4885 "Coptic",
4886 "Copt",
4887 "Qaac",
4888 "Cuneiform",
4889 "Xsux",
4890 "Cypriot",
4891 "Cprt",
4892 "Cyrillic",
4893 "Cyrl",
4894 "Deseret",
4895 "Dsrt",
4896 "Devanagari",
4897 "Deva",
4898 "Duployan",
4899 "Dupl",
4900 "Egyptian_Hieroglyphs",
4901 "Egyp",
4902 "Elbasan",
4903 "Elba",
4904 "Ethiopic",
4905 "Ethi",
4906 "Georgian",
4907 "Geor",
4908 "Glagolitic",
4909 "Glag",
4910 "Gothic",
4911 "Goth",
4912 "Grantha",
4913 "Gran",
4914 "Greek",
4915 "Grek",
4916 "Gujarati",
4917 "Gujr",
4918 "Gurmukhi",
4919 "Guru",
4920 "Han",
4921 "Hani",
4922 "Hangul",
4923 "Hang",
4924 "Hanunoo",
4925 "Hano",
4926 "Hatran",
4927 "Hatr",
4928 "Hebrew",
4929 "Hebr",
4930 "Hiragana",
4931 "Hira",
4932 "Imperial_Aramaic",
4933 "Armi",
4934 "Inherited",
4935 "Zinh",
4936 "Qaai",
4937 "Inscriptional_Pahlavi",
4938 "Phli",
4939 "Inscriptional_Parthian",
4940 "Prti",
4941 "Javanese",
4942 "Java",
4943 "Kaithi",
4944 "Kthi",
4945 "Kannada",
4946 "Knda",
4947 "Katakana",
4948 "Kana",
4949 "Kayah_Li",
4950 "Kali",
4951 "Kharoshthi",
4952 "Khar",
4953 "Khmer",
4954 "Khmr",
4955 "Khojki",
4956 "Khoj",
4957 "Khudawadi",
4958 "Sind",
4959 "Lao",
4960 "Laoo",
4961 "Latin",
4962 "Latn",
4963 "Lepcha",
4964 "Lepc",
4965 "Limbu",
4966 "Limb",
4967 "Linear_A",
4968 "Lina",
4969 "Linear_B",
4970 "Linb",
4971 "Lisu",
4972 "Lycian",
4973 "Lyci",
4974 "Lydian",
4975 "Lydi",
4976 "Mahajani",
4977 "Mahj",
4978 "Malayalam",
4979 "Mlym",
4980 "Mandaic",
4981 "Mand",
4982 "Manichaean",
4983 "Mani",
4984 "Marchen",
4985 "Marc",
4986 "Masaram_Gondi",
4987 "Gonm",
4988 "Meetei_Mayek",
4989 "Mtei",
4990 "Mende_Kikakui",
4991 "Mend",
4992 "Meroitic_Cursive",
4993 "Merc",
4994 "Meroitic_Hieroglyphs",
4995 "Mero",
4996 "Miao",
4997 "Plrd",
4998 "Modi",
4999 "Mongolian",
5000 "Mong",
5001 "Mro",
5002 "Mroo",
5003 "Multani",
5004 "Mult",
5005 "Myanmar",
5006 "Mymr",
5007 "Nabataean",
5008 "Nbat",
5009 "New_Tai_Lue",
5010 "Talu",
5011 "Newa",
5012 "Nko",
5013 "Nkoo",
5014 "Nushu",
5015 "Nshu",
5016 "Ogham",
5017 "Ogam",
5018 "Ol_Chiki",
5019 "Olck",
5020 "Old_Hungarian",
5021 "Hung",
5022 "Old_Italic",
5023 "Ital",
5024 "Old_North_Arabian",
5025 "Narb",
5026 "Old_Permic",
5027 "Perm",
5028 "Old_Persian",
5029 "Xpeo",
5030 "Old_South_Arabian",
5031 "Sarb",
5032 "Old_Turkic",
5033 "Orkh",
5034 "Oriya",
5035 "Orya",
5036 "Osage",
5037 "Osge",
5038 "Osmanya",
5039 "Osma",
5040 "Pahawh_Hmong",
5041 "Hmng",
5042 "Palmyrene",
5043 "Palm",
5044 "Pau_Cin_Hau",
5045 "Pauc",
5046 "Phags_Pa",
5047 "Phag",
5048 "Phoenician",
5049 "Phnx",
5050 "Psalter_Pahlavi",
5051 "Phlp",
5052 "Rejang",
5053 "Rjng",
5054 "Runic",
5055 "Runr",
5056 "Samaritan",
5057 "Samr",
5058 "Saurashtra",
5059 "Saur",
5060 "Sharada",
5061 "Shrd",
5062 "Shavian",
5063 "Shaw",
5064 "Siddham",
5065 "Sidd",
5066 "SignWriting",
5067 "Sgnw",
5068 "Sinhala",
5069 "Sinh",
5070 "Sora_Sompeng",
5071 "Sora",
5072 "Soyombo",
5073 "Soyo",
5074 "Sundanese",
5075 "Sund",
5076 "Syloti_Nagri",
5077 "Sylo",
5078 "Syriac",
5079 "Syrc",
5080 "Tagalog",
5081 "Tglg",
5082 "Tagbanwa",
5083 "Tagb",
5084 "Tai_Le",
5085 "Tale",
5086 "Tai_Tham",
5087 "Lana",
5088 "Tai_Viet",
5089 "Tavt",
5090 "Takri",
5091 "Takr",
5092 "Tamil",
5093 "Taml",
5094 "Tangut",
5095 "Tang",
5096 "Telugu",
5097 "Telu",
5098 "Thaana",
5099 "Thaa",
5100 "Thai",
5101 "Tibetan",
5102 "Tibt",
5103 "Tifinagh",
5104 "Tfng",
5105 "Tirhuta",
5106 "Tirh",
5107 "Ugaritic",
5108 "Ugar",
5109 "Vai",
5110 "Vaii",
5111 "Warang_Citi",
5112 "Wara",
5113 "Yi",
5114 "Yiii",
5115 "Zanabazar_Square",
5116 "Zanb",
5117 ]),
5118};
5119PropertyData.gc = PropertyData.General_Category;
5120PropertyData.sc = PropertyData.Script_Extensions = PropertyData.scx =
5121 PropertyData.Script;
5122
5123const Backspace = 0x08;
5124const CharacterTabulation = 0x09;
5125const LineFeed = 0x0a;
5126const LineTabulation = 0x0b;
5127const FormFeed = 0x0c;
5128const CarriageReturn = 0x0d;
5129const ExclamationMark = 0x21;
5130const DollarSign = 0x24;
5131const LeftParenthesis = 0x28;
5132const RightParenthesis = 0x29;
5133const Asterisk = 0x2a;
5134const PlusSign = 0x2b;
5135const Comma = 0x2c;
5136const HyphenMinus = 0x2d;
5137const FullStop = 0x2e;
5138const Solidus = 0x2f;
5139const DigitZero = 0x30;
5140const DigitOne = 0x31;
5141const DigitSeven = 0x37;
5142const DigitNine = 0x39;
5143const Colon = 0x3a;
5144const LessThanSign = 0x3c;
5145const EqualsSign = 0x3d;
5146const GreaterThanSign = 0x3e;
5147const QuestionMark = 0x3f;
5148const LatinCapitalLetterA = 0x41;
5149const LatinCapitalLetterB = 0x42;
5150const LatinCapitalLetterD = 0x44;
5151const LatinCapitalLetterF = 0x46;
5152const LatinCapitalLetterP = 0x50;
5153const LatinCapitalLetterS = 0x53;
5154const LatinCapitalLetterW = 0x57;
5155const LatinCapitalLetterZ = 0x5a;
5156const LowLine = 0x5f;
5157const LatinSmallLetterA = 0x61;
5158const LatinSmallLetterB = 0x62;
5159const LatinSmallLetterC = 0x63;
5160const LatinSmallLetterD = 0x64;
5161const LatinSmallLetterF = 0x66;
5162const LatinSmallLetterG = 0x67;
5163const LatinSmallLetterI = 0x69;
5164const LatinSmallLetterK = 0x6b;
5165const LatinSmallLetterM = 0x6d;
5166const LatinSmallLetterN = 0x6e;
5167const LatinSmallLetterP = 0x70;
5168const LatinSmallLetterR = 0x72;
5169const LatinSmallLetterS = 0x73;
5170const LatinSmallLetterT = 0x74;
5171const LatinSmallLetterU = 0x75;
5172const LatinSmallLetterV = 0x76;
5173const LatinSmallLetterW = 0x77;
5174const LatinSmallLetterX = 0x78;
5175const LatinSmallLetterY = 0x79;
5176const LatinSmallLetterZ = 0x7a;
5177const LeftSquareBracket = 0x5b;
5178const ReverseSolidus = 0x5c;
5179const RightSquareBracket = 0x5d;
5180const CircumflexAccent = 0x5e;
5181const LeftCurlyBracket = 0x7b;
5182const VerticalLine = 0x7c;
5183const RightCurlyBracket = 0x7d;
5184const ZeroWidthNonJoiner = 0x200c;
5185const ZeroWidthJoiner = 0x200d;
5186const LineSeparator = 0x2028;
5187const ParagraphSeparator = 0x2029;
5188const MinCodePoint = 0x00;
5189const MaxCodePoint = 0x10ffff;
5190function isLatinLetter(code) {
5191 return ((code >= LatinCapitalLetterA && code <= LatinCapitalLetterZ) ||
5192 (code >= LatinSmallLetterA && code <= LatinSmallLetterZ));
5193}
5194function isDecimalDigit(code) {
5195 return code >= DigitZero && code <= DigitNine;
5196}
5197function isOctalDigit(code) {
5198 return code >= DigitZero && code <= DigitSeven;
5199}
5200function isHexDigit(code) {
5201 return ((code >= DigitZero && code <= DigitNine) ||
5202 (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) ||
5203 (code >= LatinSmallLetterA && code <= LatinSmallLetterF));
5204}
5205function isLineTerminator(code) {
5206 return (code === LineFeed ||
5207 code === CarriageReturn ||
5208 code === LineSeparator ||
5209 code === ParagraphSeparator);
5210}
5211function isValidUnicode(code) {
5212 return code >= MinCodePoint && code <= MaxCodePoint;
5213}
5214function digitToInt(code) {
5215 if (code >= LatinSmallLetterA && code <= LatinSmallLetterF) {
5216 return code - LatinSmallLetterA + 10;
5217 }
5218 if (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) {
5219 return code - LatinCapitalLetterA + 10;
5220 }
5221 return code - DigitZero;
5222}
5223
5224const legacyImpl = {
5225 at(s, end, i) {
5226 return i < end ? s.charCodeAt(i) : -1;
5227 },
5228 width(c) {
5229 return 1;
5230 },
5231};
5232const unicodeImpl = {
5233 at(s, end, i) {
5234 return i < end ? s.codePointAt(i) : -1;
5235 },
5236 width(c) {
5237 return c > 0xffff ? 2 : 1;
5238 },
5239};
5240class Reader {
5241 constructor() {
5242 this._impl = legacyImpl;
5243 this._s = "";
5244 this._i = 0;
5245 this._end = 0;
5246 this._cp1 = -1;
5247 this._w1 = 1;
5248 this._cp2 = -1;
5249 this._w2 = 1;
5250 this._cp3 = -1;
5251 this._w3 = 1;
5252 this._cp4 = -1;
5253 }
5254 get source() {
5255 return this._s;
5256 }
5257 get index() {
5258 return this._i;
5259 }
5260 get currentCodePoint() {
5261 return this._cp1;
5262 }
5263 get nextCodePoint() {
5264 return this._cp2;
5265 }
5266 get nextCodePoint2() {
5267 return this._cp3;
5268 }
5269 get nextCodePoint3() {
5270 return this._cp4;
5271 }
5272 reset(source, start, end, uFlag) {
5273 this._impl = uFlag ? unicodeImpl : legacyImpl;
5274 this._s = source;
5275 this._end = end;
5276 this.rewind(start);
5277 }
5278 rewind(index) {
5279 const impl = this._impl;
5280 this._i = index;
5281 this._cp1 = impl.at(this._s, this._end, index);
5282 this._w1 = impl.width(this._cp1);
5283 this._cp2 = impl.at(this._s, this._end, index + this._w1);
5284 this._w2 = impl.width(this._cp2);
5285 this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2);
5286 this._w3 = impl.width(this._cp3);
5287 this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3);
5288 }
5289 advance() {
5290 if (this._cp1 !== -1) {
5291 const impl = this._impl;
5292 this._i += this._w1;
5293 this._cp1 = this._cp2;
5294 this._w1 = this._w2;
5295 this._cp2 = this._cp3;
5296 this._w2 = impl.width(this._cp2);
5297 this._cp3 = this._cp4;
5298 this._w3 = impl.width(this._cp3);
5299 this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3);
5300 }
5301 }
5302 eat(cp) {
5303 if (this._cp1 === cp) {
5304 this.advance();
5305 return true;
5306 }
5307 return false;
5308 }
5309 eat2(cp1, cp2) {
5310 if (this._cp1 === cp1 && this._cp2 === cp2) {
5311 this.advance();
5312 this.advance();
5313 return true;
5314 }
5315 return false;
5316 }
5317 eat3(cp1, cp2, cp3) {
5318 if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) {
5319 this.advance();
5320 this.advance();
5321 this.advance();
5322 return true;
5323 }
5324 return false;
5325 }
5326}
5327
5328class RegExpSyntaxError extends SyntaxError {
5329 constructor(source, uFlag, index, message) {
5330 if (source) {
5331 if (source[0] !== "/") {
5332 source = `/${source}/${uFlag ? "u" : ""}`;
5333 }
5334 source = `: ${source}`;
5335 }
5336 super(`Invalid regular expression${source}: ${message}`);
5337 this.index = index;
5338 }
5339}
5340
5341function isSyntaxCharacter(cp) {
5342 return (cp === CircumflexAccent ||
5343 cp === DollarSign ||
5344 cp === ReverseSolidus ||
5345 cp === FullStop ||
5346 cp === Asterisk ||
5347 cp === PlusSign ||
5348 cp === QuestionMark ||
5349 cp === LeftParenthesis ||
5350 cp === RightParenthesis ||
5351 cp === LeftSquareBracket ||
5352 cp === RightSquareBracket ||
5353 cp === LeftCurlyBracket ||
5354 cp === RightCurlyBracket ||
5355 cp === VerticalLine);
5356}
5357function isRegExpIdentifierStart(cp) {
5358 return isIdStart(cp) || cp === DollarSign || cp === LowLine;
5359}
5360function isRegExpIdentifierPart(cp) {
5361 return (isIdContinue(cp) ||
5362 cp === DollarSign ||
5363 cp === LowLine ||
5364 cp === ZeroWidthNonJoiner ||
5365 cp === ZeroWidthJoiner);
5366}
5367function isUnicodePropertyNameCharacter(cp) {
5368 return isLatinLetter(cp) || cp === LowLine;
5369}
5370function isUnicodePropertyValueCharacter(cp) {
5371 return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp);
5372}
5373function isValidUnicodeProperty(name, value) {
5374 return PropertyData.hasOwnProperty(name) && PropertyData[name].has(value);
5375}
5376function isValidUnicodePropertyName(name) {
5377 return PropertyData.$LONE.has(name);
5378}
5379class RegExpValidator {
5380 constructor(options) {
5381 this._reader = new Reader();
5382 this._uFlag = false;
5383 this._nFlag = false;
5384 this._lastIntValue = 0;
5385 this._lastMinValue = 0;
5386 this._lastMaxValue = 0;
5387 this._lastStrValue = "";
5388 this._lastKeyValue = "";
5389 this._lastValValue = "";
5390 this._lastAssertionIsQuantifiable = false;
5391 this._numCapturingParens = 0;
5392 this._groupNames = new Set();
5393 this._backreferenceNames = new Set();
5394 this._options = options || {};
5395 }
5396 validateLiteral(source, start = 0, end = source.length) {
5397 this._uFlag = this._nFlag = false;
5398 this.reset(source, start, end);
5399 this.onLiteralEnter(start);
5400 if (this.eat(Solidus) && this.eatRegExpBody() && this.eat(Solidus)) {
5401 const flagStart = this.index;
5402 const uFlag = source.indexOf("u", flagStart) !== -1;
5403 this.validateFlags(source, flagStart, end);
5404 this.validatePattern(source, start + 1, flagStart - 1, uFlag);
5405 }
5406 else if (start >= end) {
5407 this.raise("Empty");
5408 }
5409 else {
5410 const c = String.fromCodePoint(this.currentCodePoint);
5411 this.raise(`Unexpected character '${c}'`);
5412 }
5413 this.onLiteralLeave(start, end);
5414 }
5415 validateFlags(source, start = 0, end = source.length) {
5416 const existingFlags = new Set();
5417 let global = false;
5418 let ignoreCase = false;
5419 let multiline = false;
5420 let sticky = false;
5421 let unicode = false;
5422 let dotAll = false;
5423 for (let i = start; i < end; ++i) {
5424 const flag = source.charCodeAt(i);
5425 if (existingFlags.has(flag)) {
5426 this.raise(`Duplicated flag '${source[i]}'`);
5427 }
5428 existingFlags.add(flag);
5429 if (flag === LatinSmallLetterG) {
5430 global = true;
5431 }
5432 else if (flag === LatinSmallLetterI) {
5433 ignoreCase = true;
5434 }
5435 else if (flag === LatinSmallLetterM) {
5436 multiline = true;
5437 }
5438 else if (flag === LatinSmallLetterU && this.ecmaVersion >= 2015) {
5439 unicode = true;
5440 }
5441 else if (flag === LatinSmallLetterY && this.ecmaVersion >= 2015) {
5442 sticky = true;
5443 }
5444 else if (flag === LatinSmallLetterS && this.ecmaVersion >= 2018) {
5445 dotAll = true;
5446 }
5447 else {
5448 this.raise(`Invalid flag '${source[i]}'`);
5449 }
5450 }
5451 this.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll);
5452 }
5453 validatePattern(source, start = 0, end = source.length, uFlag = false) {
5454 this._uFlag = uFlag && this.ecmaVersion >= 2015;
5455 this._nFlag = uFlag && this.ecmaVersion >= 2018;
5456 this.reset(source, start, end);
5457 this.pattern();
5458 if (!this._nFlag &&
5459 this.ecmaVersion >= 2018 &&
5460 this._groupNames.size > 0) {
5461 this._nFlag = true;
5462 this.rewind(start);
5463 this.pattern();
5464 }
5465 }
5466 get strict() {
5467 return Boolean(this._options.strict || this._uFlag);
5468 }
5469 get ecmaVersion() {
5470 return this._options.ecmaVersion || 2018;
5471 }
5472 onLiteralEnter(start) {
5473 if (this._options.onLiteralEnter) {
5474 this._options.onLiteralEnter(start);
5475 }
5476 }
5477 onLiteralLeave(start, end) {
5478 if (this._options.onLiteralLeave) {
5479 this._options.onLiteralLeave(start, end);
5480 }
5481 }
5482 onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) {
5483 if (this._options.onFlags) {
5484 this._options.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll);
5485 }
5486 }
5487 onPatternEnter(start) {
5488 if (this._options.onPatternEnter) {
5489 this._options.onPatternEnter(start);
5490 }
5491 }
5492 onPatternLeave(start, end) {
5493 if (this._options.onPatternLeave) {
5494 this._options.onPatternLeave(start, end);
5495 }
5496 }
5497 onDisjunctionEnter(start) {
5498 if (this._options.onDisjunctionEnter) {
5499 this._options.onDisjunctionEnter(start);
5500 }
5501 }
5502 onDisjunctionLeave(start, end) {
5503 if (this._options.onDisjunctionLeave) {
5504 this._options.onDisjunctionLeave(start, end);
5505 }
5506 }
5507 onAlternativeEnter(start, index) {
5508 if (this._options.onAlternativeEnter) {
5509 this._options.onAlternativeEnter(start, index);
5510 }
5511 }
5512 onAlternativeLeave(start, end, index) {
5513 if (this._options.onAlternativeLeave) {
5514 this._options.onAlternativeLeave(start, end, index);
5515 }
5516 }
5517 onGroupEnter(start) {
5518 if (this._options.onGroupEnter) {
5519 this._options.onGroupEnter(start);
5520 }
5521 }
5522 onGroupLeave(start, end) {
5523 if (this._options.onGroupLeave) {
5524 this._options.onGroupLeave(start, end);
5525 }
5526 }
5527 onCapturingGroupEnter(start, name) {
5528 if (this._options.onCapturingGroupEnter) {
5529 this._options.onCapturingGroupEnter(start, name);
5530 }
5531 }
5532 onCapturingGroupLeave(start, end, name) {
5533 if (this._options.onCapturingGroupLeave) {
5534 this._options.onCapturingGroupLeave(start, end, name);
5535 }
5536 }
5537 onQuantifier(start, end, min, max, greedy) {
5538 if (this._options.onQuantifier) {
5539 this._options.onQuantifier(start, end, min, max, greedy);
5540 }
5541 }
5542 onLookaroundAssertionEnter(start, kind, negate) {
5543 if (this._options.onLookaroundAssertionEnter) {
5544 this._options.onLookaroundAssertionEnter(start, kind, negate);
5545 }
5546 }
5547 onLookaroundAssertionLeave(start, end, kind, negate) {
5548 if (this._options.onLookaroundAssertionLeave) {
5549 this._options.onLookaroundAssertionLeave(start, end, kind, negate);
5550 }
5551 }
5552 onEdgeAssertion(start, end, kind) {
5553 if (this._options.onEdgeAssertion) {
5554 this._options.onEdgeAssertion(start, end, kind);
5555 }
5556 }
5557 onWordBoundaryAssertion(start, end, kind, negate) {
5558 if (this._options.onWordBoundaryAssertion) {
5559 this._options.onWordBoundaryAssertion(start, end, kind, negate);
5560 }
5561 }
5562 onAnyCharacterSet(start, end, kind) {
5563 if (this._options.onAnyCharacterSet) {
5564 this._options.onAnyCharacterSet(start, end, kind);
5565 }
5566 }
5567 onEscapeCharacterSet(start, end, kind, negate) {
5568 if (this._options.onEscapeCharacterSet) {
5569 this._options.onEscapeCharacterSet(start, end, kind, negate);
5570 }
5571 }
5572 onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) {
5573 if (this._options.onUnicodePropertyCharacterSet) {
5574 this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate);
5575 }
5576 }
5577 onCharacter(start, end, value) {
5578 if (this._options.onCharacter) {
5579 this._options.onCharacter(start, end, value);
5580 }
5581 }
5582 onBackreference(start, end, ref) {
5583 if (this._options.onBackreference) {
5584 this._options.onBackreference(start, end, ref);
5585 }
5586 }
5587 onCharacterClassEnter(start, negate) {
5588 if (this._options.onCharacterClassEnter) {
5589 this._options.onCharacterClassEnter(start, negate);
5590 }
5591 }
5592 onCharacterClassLeave(start, end, negate) {
5593 if (this._options.onCharacterClassLeave) {
5594 this._options.onCharacterClassLeave(start, end, negate);
5595 }
5596 }
5597 onCharacterClassRange(start, end, min, max) {
5598 if (this._options.onCharacterClassRange) {
5599 this._options.onCharacterClassRange(start, end, min, max);
5600 }
5601 }
5602 get source() {
5603 return this._reader.source;
5604 }
5605 get index() {
5606 return this._reader.index;
5607 }
5608 get currentCodePoint() {
5609 return this._reader.currentCodePoint;
5610 }
5611 get nextCodePoint() {
5612 return this._reader.nextCodePoint;
5613 }
5614 get nextCodePoint2() {
5615 return this._reader.nextCodePoint2;
5616 }
5617 get nextCodePoint3() {
5618 return this._reader.nextCodePoint3;
5619 }
5620 reset(source, start, end) {
5621 this._reader.reset(source, start, end, this._uFlag);
5622 }
5623 rewind(index) {
5624 this._reader.rewind(index);
5625 }
5626 advance() {
5627 this._reader.advance();
5628 }
5629 eat(cp) {
5630 return this._reader.eat(cp);
5631 }
5632 eat2(cp1, cp2) {
5633 return this._reader.eat2(cp1, cp2);
5634 }
5635 eat3(cp1, cp2, cp3) {
5636 return this._reader.eat3(cp1, cp2, cp3);
5637 }
5638 raise(message) {
5639 throw new RegExpSyntaxError(this.source, this._uFlag, this.index, message);
5640 }
5641 eatRegExpBody() {
5642 const start = this.index;
5643 let inClass = false;
5644 let escaped = false;
5645 for (;;) {
5646 const cp = this.currentCodePoint;
5647 if (cp === -1 || isLineTerminator(cp)) {
5648 const kind = inClass ? "character class" : "regular expression";
5649 this.raise(`Unterminated ${kind}`);
5650 }
5651 if (escaped) {
5652 escaped = false;
5653 }
5654 else if (cp === ReverseSolidus) {
5655 escaped = true;
5656 }
5657 else if (cp === LeftSquareBracket) {
5658 inClass = true;
5659 }
5660 else if (cp === RightSquareBracket) {
5661 inClass = false;
5662 }
5663 else if ((cp === Solidus && !inClass) ||
5664 (cp === Asterisk && this.index === start)) {
5665 break;
5666 }
5667 this.advance();
5668 }
5669 return this.index !== start;
5670 }
5671 pattern() {
5672 const start = this.index;
5673 this._numCapturingParens = this.countCapturingParens();
5674 this._groupNames.clear();
5675 this._backreferenceNames.clear();
5676 this.onPatternEnter(start);
5677 this.disjunction();
5678 const cp = this.currentCodePoint;
5679 if (this.currentCodePoint !== -1) {
5680 if (cp === RightParenthesis) {
5681 this.raise("Unmatched ')'");
5682 }
5683 if (cp === ReverseSolidus) {
5684 this.raise("\\ at end of pattern");
5685 }
5686 if (cp === RightSquareBracket || cp === RightCurlyBracket) {
5687 this.raise("Lone quantifier brackets");
5688 }
5689 const c = String.fromCodePoint(cp);
5690 this.raise(`Unexpected character '${c}'`);
5691 }
5692 for (const name of this._backreferenceNames) {
5693 if (!this._groupNames.has(name)) {
5694 this.raise("Invalid named capture referenced");
5695 }
5696 }
5697 this.onPatternLeave(start, this.index);
5698 }
5699 countCapturingParens() {
5700 const start = this.index;
5701 let inClass = false;
5702 let escaped = false;
5703 let count = 0;
5704 let cp = 0;
5705 while ((cp = this.currentCodePoint) !== -1) {
5706 if (escaped) {
5707 escaped = false;
5708 }
5709 else if (cp === ReverseSolidus) {
5710 escaped = true;
5711 }
5712 else if (cp === LeftSquareBracket) {
5713 inClass = true;
5714 }
5715 else if (cp === RightSquareBracket) {
5716 inClass = false;
5717 }
5718 else if (cp === LeftParenthesis &&
5719 !inClass &&
5720 (this.nextCodePoint !== QuestionMark ||
5721 (this.nextCodePoint2 === LessThanSign &&
5722 this.nextCodePoint3 !== EqualsSign &&
5723 this.nextCodePoint3 !== ExclamationMark))) {
5724 count += 1;
5725 }
5726 this.advance();
5727 }
5728 this.rewind(start);
5729 return count;
5730 }
5731 disjunction() {
5732 const start = this.index;
5733 let i = 0;
5734 this.onDisjunctionEnter(start);
5735 this.alternative(i++);
5736 while (this.eat(VerticalLine)) {
5737 this.alternative(i++);
5738 }
5739 if (this.eatQuantifier(true)) {
5740 this.raise("Nothing to repeat");
5741 }
5742 if (this.eat(LeftCurlyBracket)) {
5743 this.raise("Lone quantifier brackets");
5744 }
5745 this.onDisjunctionLeave(start, this.index);
5746 }
5747 alternative(i) {
5748 const start = this.index;
5749 this.onAlternativeEnter(start, i);
5750 while (this.currentCodePoint !== -1 && this.eatTerm()) {
5751 }
5752 this.onAlternativeLeave(start, this.index, i);
5753 }
5754 eatTerm() {
5755 if (this.eatAssertion()) {
5756 if (this._lastAssertionIsQuantifiable) {
5757 this.eatQuantifier();
5758 }
5759 return true;
5760 }
5761 if (this.strict ? this.eatAtom() : this.eatExtendedAtom()) {
5762 this.eatQuantifier();
5763 return true;
5764 }
5765 return false;
5766 }
5767 eatAssertion() {
5768 const start = this.index;
5769 this._lastAssertionIsQuantifiable = false;
5770 if (this.eat(CircumflexAccent)) {
5771 this.onEdgeAssertion(start, this.index, "start");
5772 return true;
5773 }
5774 if (this.eat(DollarSign)) {
5775 this.onEdgeAssertion(start, this.index, "end");
5776 return true;
5777 }
5778 if (this.eat2(ReverseSolidus, LatinCapitalLetterB)) {
5779 this.onWordBoundaryAssertion(start, this.index, "word", true);
5780 return true;
5781 }
5782 if (this.eat2(ReverseSolidus, LatinSmallLetterB)) {
5783 this.onWordBoundaryAssertion(start, this.index, "word", false);
5784 return true;
5785 }
5786 if (this.eat2(LeftParenthesis, QuestionMark)) {
5787 const lookbehind = this.ecmaVersion >= 2018 && this.eat(LessThanSign);
5788 let negate = false;
5789 if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) {
5790 const kind = lookbehind ? "lookbehind" : "lookahead";
5791 this.onLookaroundAssertionEnter(start, kind, negate);
5792 this.disjunction();
5793 if (!this.eat(RightParenthesis)) {
5794 this.raise("Unterminated group");
5795 }
5796 this._lastAssertionIsQuantifiable = !lookbehind && !this.strict;
5797 this.onLookaroundAssertionLeave(start, this.index, kind, negate);
5798 return true;
5799 }
5800 this.rewind(start);
5801 }
5802 return false;
5803 }
5804 eatQuantifier(noError = false) {
5805 const start = this.index;
5806 let min = 0;
5807 let max = 0;
5808 let greedy = false;
5809 if (this.eat(Asterisk)) {
5810 min = 0;
5811 max = Number.POSITIVE_INFINITY;
5812 }
5813 else if (this.eat(PlusSign)) {
5814 min = 1;
5815 max = Number.POSITIVE_INFINITY;
5816 }
5817 else if (this.eat(QuestionMark)) {
5818 min = 0;
5819 max = 1;
5820 }
5821 else if (this.eatBracedQuantifier(noError)) {
5822 min = this._lastMinValue;
5823 max = this._lastMaxValue;
5824 }
5825 else {
5826 return false;
5827 }
5828 greedy = !this.eat(QuestionMark);
5829 if (!noError) {
5830 this.onQuantifier(start, this.index, min, max, greedy);
5831 }
5832 return true;
5833 }
5834 eatBracedQuantifier(noError) {
5835 const start = this.index;
5836 if (this.eat(LeftCurlyBracket)) {
5837 this._lastMinValue = 0;
5838 this._lastMaxValue = Number.POSITIVE_INFINITY;
5839 if (this.eatDecimalDigits()) {
5840 this._lastMinValue = this._lastMaxValue = this._lastIntValue;
5841 if (this.eat(Comma)) {
5842 this._lastMaxValue = this.eatDecimalDigits()
5843 ? this._lastIntValue
5844 : Number.POSITIVE_INFINITY;
5845 }
5846 if (this.eat(RightCurlyBracket)) {
5847 if (!noError && this._lastMaxValue < this._lastMinValue) {
5848 this.raise("numbers out of order in {} quantifier");
5849 }
5850 return true;
5851 }
5852 }
5853 if (!noError && this.strict) {
5854 this.raise("Incomplete quantifier");
5855 }
5856 this.rewind(start);
5857 }
5858 return false;
5859 }
5860 eatAtom() {
5861 return (this.eatPatternCharacter() ||
5862 this.eatDot() ||
5863 this.eatReverseSolidusAtomEscape() ||
5864 this.eatCharacterClass() ||
5865 this.eatUncapturingGroup() ||
5866 this.eatCapturingGroup());
5867 }
5868 eatDot() {
5869 if (this.eat(FullStop)) {
5870 this.onAnyCharacterSet(this.index - 1, this.index, "any");
5871 return true;
5872 }
5873 return false;
5874 }
5875 eatReverseSolidusAtomEscape() {
5876 const start = this.index;
5877 if (this.eat(ReverseSolidus)) {
5878 if (this.eatAtomEscape()) {
5879 return true;
5880 }
5881 this.rewind(start);
5882 }
5883 return false;
5884 }
5885 eatUncapturingGroup() {
5886 const start = this.index;
5887 if (this.eat3(LeftParenthesis, QuestionMark, Colon)) {
5888 this.onGroupEnter(start);
5889 this.disjunction();
5890 if (!this.eat(RightParenthesis)) {
5891 this.raise("Unterminated group");
5892 }
5893 this.onGroupLeave(start, this.index);
5894 return true;
5895 }
5896 return false;
5897 }
5898 eatCapturingGroup() {
5899 const start = this.index;
5900 if (this.eat(LeftParenthesis)) {
5901 this._lastStrValue = "";
5902 if (this.ecmaVersion >= 2018) {
5903 this.groupSpecifier();
5904 }
5905 else if (this.currentCodePoint === QuestionMark) {
5906 this.raise("Invalid group");
5907 }
5908 const name = this._lastStrValue || null;
5909 this.onCapturingGroupEnter(start, name);
5910 this.disjunction();
5911 if (!this.eat(RightParenthesis)) {
5912 this.raise("Unterminated group");
5913 }
5914 this.onCapturingGroupLeave(start, this.index, name);
5915 return true;
5916 }
5917 return false;
5918 }
5919 eatExtendedAtom() {
5920 return (this.eatDot() ||
5921 this.eatReverseSolidusAtomEscape() ||
5922 this.eatReverseSolidusFollowedByC() ||
5923 this.eatCharacterClass() ||
5924 this.eatUncapturingGroup() ||
5925 this.eatCapturingGroup() ||
5926 this.eatInvalidBracedQuantifier() ||
5927 this.eatExtendedPatternCharacter());
5928 }
5929 eatReverseSolidusFollowedByC() {
5930 if (this.currentCodePoint === ReverseSolidus &&
5931 this.nextCodePoint === LatinSmallLetterC) {
5932 this._lastIntValue = this.currentCodePoint;
5933 this.advance();
5934 this.onCharacter(this.index - 1, this.index, ReverseSolidus);
5935 return true;
5936 }
5937 return false;
5938 }
5939 eatInvalidBracedQuantifier() {
5940 if (this.eatBracedQuantifier(true)) {
5941 this.raise("Nothing to repeat");
5942 }
5943 return false;
5944 }
5945 eatSyntaxCharacter() {
5946 if (isSyntaxCharacter(this.currentCodePoint)) {
5947 this._lastIntValue = this.currentCodePoint;
5948 this.advance();
5949 return true;
5950 }
5951 return false;
5952 }
5953 eatPatternCharacter() {
5954 const start = this.index;
5955 const cp = this.currentCodePoint;
5956 if (cp !== -1 && !isSyntaxCharacter(cp)) {
5957 this.advance();
5958 this.onCharacter(start, this.index, cp);
5959 return true;
5960 }
5961 return false;
5962 }
5963 eatExtendedPatternCharacter() {
5964 const start = this.index;
5965 const cp = this.currentCodePoint;
5966 if (cp !== -1 &&
5967 cp !== CircumflexAccent &&
5968 cp !== DollarSign &&
5969 cp !== ReverseSolidus &&
5970 cp !== FullStop &&
5971 cp !== Asterisk &&
5972 cp !== PlusSign &&
5973 cp !== QuestionMark &&
5974 cp !== LeftParenthesis &&
5975 cp !== RightParenthesis &&
5976 cp !== LeftSquareBracket &&
5977 cp !== VerticalLine) {
5978 this.advance();
5979 this.onCharacter(start, this.index, cp);
5980 return true;
5981 }
5982 return false;
5983 }
5984 groupSpecifier() {
5985 this._lastStrValue = "";
5986 if (this.eat(QuestionMark)) {
5987 if (this.eatGroupName()) {
5988 if (!this._groupNames.has(this._lastStrValue)) {
5989 this._groupNames.add(this._lastStrValue);
5990 return;
5991 }
5992 this.raise("Duplicate capture group name");
5993 }
5994 this.raise("Invalid group");
5995 }
5996 }
5997 eatGroupName() {
5998 this._lastStrValue = "";
5999 if (this.eat(LessThanSign)) {
6000 if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) {
6001 return true;
6002 }
6003 this.raise("Invalid capture group name");
6004 }
6005 return false;
6006 }
6007 eatRegExpIdentifierName() {
6008 this._lastStrValue = "";
6009 if (this.eatRegExpIdentifierStart()) {
6010 this._lastStrValue += String.fromCodePoint(this._lastIntValue);
6011 while (this.eatRegExpIdentifierPart()) {
6012 this._lastStrValue += String.fromCodePoint(this._lastIntValue);
6013 }
6014 return true;
6015 }
6016 return false;
6017 }
6018 eatRegExpIdentifierStart() {
6019 const start = this.index;
6020 let cp = this.currentCodePoint;
6021 this.advance();
6022 if (cp === ReverseSolidus && this.eatRegExpUnicodeEscapeSequence()) {
6023 cp = this._lastIntValue;
6024 }
6025 if (isRegExpIdentifierStart(cp)) {
6026 this._lastIntValue = cp;
6027 return true;
6028 }
6029 if (this.index !== start) {
6030 this.rewind(start);
6031 }
6032 return false;
6033 }
6034 eatRegExpIdentifierPart() {
6035 const start = this.index;
6036 let cp = this.currentCodePoint;
6037 this.advance();
6038 if (cp === ReverseSolidus && this.eatRegExpUnicodeEscapeSequence()) {
6039 cp = this._lastIntValue;
6040 }
6041 if (isRegExpIdentifierPart(cp)) {
6042 this._lastIntValue = cp;
6043 return true;
6044 }
6045 if (this.index !== start) {
6046 this.rewind(start);
6047 }
6048 return false;
6049 }
6050 eatAtomEscape() {
6051 if (this.eatBackreference() ||
6052 this.eatCharacterClassEscape() ||
6053 this.eatCharacterEscape() ||
6054 (this._nFlag && this.eatKGroupName())) {
6055 return true;
6056 }
6057 if (this.strict || this._uFlag) {
6058 this.raise("Invalid escape");
6059 }
6060 return false;
6061 }
6062 eatBackreference() {
6063 const start = this.index;
6064 if (this.eatDecimalEscape()) {
6065 const n = this._lastIntValue;
6066 if (n <= this._numCapturingParens) {
6067 this.onBackreference(start - 1, this.index, n);
6068 return true;
6069 }
6070 if (this.strict) {
6071 this.raise("Invalid escape");
6072 }
6073 this.rewind(start);
6074 }
6075 return false;
6076 }
6077 eatKGroupName() {
6078 const start = this.index;
6079 if (this.eat(LatinSmallLetterK)) {
6080 if (this.eatGroupName()) {
6081 const groupName = this._lastStrValue;
6082 this._backreferenceNames.add(groupName);
6083 this.onBackreference(start - 1, this.index, groupName);
6084 return true;
6085 }
6086 this.raise("Invalid named reference");
6087 }
6088 return false;
6089 }
6090 eatCharacterEscape() {
6091 const start = this.index;
6092 if (this.eatControlEscape() ||
6093 this.eatCControlLetter() ||
6094 this.eatZero() ||
6095 this.eatHexEscapeSequence() ||
6096 this.eatRegExpUnicodeEscapeSequence() ||
6097 (!this.strict && this.eatLegacyOctalEscapeSequence()) ||
6098 this.eatIdentityEscape()) {
6099 this.onCharacter(start - 1, this.index, this._lastIntValue);
6100 return true;
6101 }
6102 return false;
6103 }
6104 eatCControlLetter() {
6105 const start = this.index;
6106 if (this.eat(LatinSmallLetterC)) {
6107 if (this.eatControlLetter()) {
6108 return true;
6109 }
6110 this.rewind(start);
6111 }
6112 return false;
6113 }
6114 eatZero() {
6115 if (this.currentCodePoint === DigitZero &&
6116 !isDecimalDigit(this.nextCodePoint)) {
6117 this._lastIntValue = 0;
6118 this.advance();
6119 return true;
6120 }
6121 return false;
6122 }
6123 eatControlEscape() {
6124 if (this.eat(LatinSmallLetterT)) {
6125 this._lastIntValue = CharacterTabulation;
6126 return true;
6127 }
6128 if (this.eat(LatinSmallLetterN)) {
6129 this._lastIntValue = LineFeed;
6130 return true;
6131 }
6132 if (this.eat(LatinSmallLetterV)) {
6133 this._lastIntValue = LineTabulation;
6134 return true;
6135 }
6136 if (this.eat(LatinSmallLetterF)) {
6137 this._lastIntValue = FormFeed;
6138 return true;
6139 }
6140 if (this.eat(LatinSmallLetterR)) {
6141 this._lastIntValue = CarriageReturn;
6142 return true;
6143 }
6144 return false;
6145 }
6146 eatControlLetter() {
6147 const cp = this.currentCodePoint;
6148 if (isLatinLetter(cp)) {
6149 this.advance();
6150 this._lastIntValue = cp % 0x20;
6151 return true;
6152 }
6153 return false;
6154 }
6155 eatRegExpUnicodeEscapeSequence() {
6156 const start = this.index;
6157 if (this.eat(LatinSmallLetterU)) {
6158 if (this.eatFixedHexDigits(4)) {
6159 const lead = this._lastIntValue;
6160 if (this._uFlag && lead >= 0xd800 && lead <= 0xdbff) {
6161 const leadSurrogateEnd = this.index;
6162 if (this.eat(ReverseSolidus) &&
6163 this.eat(LatinSmallLetterU) &&
6164 this.eatFixedHexDigits(4)) {
6165 const trail = this._lastIntValue;
6166 if (trail >= 0xdc00 && trail <= 0xdfff) {
6167 this._lastIntValue =
6168 (lead - 0xd800) * 0x400 +
6169 (trail - 0xdc00) +
6170 0x10000;
6171 return true;
6172 }
6173 }
6174 this.rewind(leadSurrogateEnd);
6175 this._lastIntValue = lead;
6176 }
6177 return true;
6178 }
6179 if (this._uFlag &&
6180 this.eat(LeftCurlyBracket) &&
6181 this.eatHexDigits() &&
6182 this.eat(RightCurlyBracket) &&
6183 isValidUnicode(this._lastIntValue)) {
6184 return true;
6185 }
6186 if (this.strict || this._uFlag) {
6187 this.raise("Invalid unicode escape");
6188 }
6189 this.rewind(start);
6190 }
6191 return false;
6192 }
6193 eatIdentityEscape() {
6194 if (this._uFlag) {
6195 if (this.eatSyntaxCharacter()) {
6196 return true;
6197 }
6198 if (this.eat(Solidus)) {
6199 this._lastIntValue = Solidus;
6200 return true;
6201 }
6202 return false;
6203 }
6204 if (this.isValidIdentityEscape(this.currentCodePoint)) {
6205 this._lastIntValue = this.currentCodePoint;
6206 this.advance();
6207 return true;
6208 }
6209 return false;
6210 }
6211 isValidIdentityEscape(cp) {
6212 if (cp === -1) {
6213 return false;
6214 }
6215 if (this.strict) {
6216 return !isIdContinue(cp);
6217 }
6218 return (cp !== LatinSmallLetterC &&
6219 (!this._nFlag || cp !== LatinSmallLetterK));
6220 }
6221 eatDecimalEscape() {
6222 this._lastIntValue = 0;
6223 let cp = this.currentCodePoint;
6224 if (cp >= DigitOne && cp <= DigitNine) {
6225 do {
6226 this._lastIntValue = 10 * this._lastIntValue + (cp - DigitZero);
6227 this.advance();
6228 } while ((cp = this.currentCodePoint) >= DigitZero &&
6229 cp <= DigitNine);
6230 return true;
6231 }
6232 return false;
6233 }
6234 eatCharacterClassEscape() {
6235 const start = this.index;
6236 if (this.eat(LatinSmallLetterD)) {
6237 this._lastIntValue = -1;
6238 this.onEscapeCharacterSet(start - 1, this.index, "digit", false);
6239 return true;
6240 }
6241 if (this.eat(LatinCapitalLetterD)) {
6242 this._lastIntValue = -1;
6243 this.onEscapeCharacterSet(start - 1, this.index, "digit", true);
6244 return true;
6245 }
6246 if (this.eat(LatinSmallLetterS)) {
6247 this._lastIntValue = -1;
6248 this.onEscapeCharacterSet(start - 1, this.index, "space", false);
6249 return true;
6250 }
6251 if (this.eat(LatinCapitalLetterS)) {
6252 this._lastIntValue = -1;
6253 this.onEscapeCharacterSet(start - 1, this.index, "space", true);
6254 return true;
6255 }
6256 if (this.eat(LatinSmallLetterW)) {
6257 this._lastIntValue = -1;
6258 this.onEscapeCharacterSet(start - 1, this.index, "word", false);
6259 return true;
6260 }
6261 if (this.eat(LatinCapitalLetterW)) {
6262 this._lastIntValue = -1;
6263 this.onEscapeCharacterSet(start - 1, this.index, "word", true);
6264 return true;
6265 }
6266 let negate = false;
6267 if (this._uFlag &&
6268 this.ecmaVersion >= 2018 &&
6269 (this.eat(LatinSmallLetterP) ||
6270 (negate = this.eat(LatinCapitalLetterP)))) {
6271 this._lastIntValue = -1;
6272 if (this.eat(LeftCurlyBracket) &&
6273 this.eatUnicodePropertyValueExpression() &&
6274 this.eat(RightCurlyBracket)) {
6275 this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate);
6276 return true;
6277 }
6278 this.raise("Invalid property name");
6279 }
6280 return false;
6281 }
6282 eatUnicodePropertyValueExpression() {
6283 const start = this.index;
6284 if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) {
6285 this._lastKeyValue = this._lastStrValue;
6286 if (this.eatUnicodePropertyValue()) {
6287 this._lastValValue = this._lastStrValue;
6288 if (isValidUnicodeProperty(this._lastKeyValue, this._lastValValue)) {
6289 return true;
6290 }
6291 this.raise("Invalid property name");
6292 }
6293 }
6294 this.rewind(start);
6295 if (this.eatLoneUnicodePropertyNameOrValue()) {
6296 const nameOrValue = this._lastStrValue;
6297 if (isValidUnicodeProperty("General_Category", nameOrValue)) {
6298 this._lastKeyValue = "General_Category";
6299 this._lastValValue = nameOrValue;
6300 return true;
6301 }
6302 if (isValidUnicodePropertyName(nameOrValue)) {
6303 this._lastKeyValue = nameOrValue;
6304 this._lastValValue = "";
6305 return true;
6306 }
6307 this.raise("Invalid property name");
6308 }
6309 return false;
6310 }
6311 eatUnicodePropertyName() {
6312 this._lastStrValue = "";
6313 while (isUnicodePropertyNameCharacter(this.currentCodePoint)) {
6314 this._lastStrValue += String.fromCodePoint(this.currentCodePoint);
6315 this.advance();
6316 }
6317 return this._lastStrValue !== "";
6318 }
6319 eatUnicodePropertyValue() {
6320 this._lastStrValue = "";
6321 while (isUnicodePropertyValueCharacter(this.currentCodePoint)) {
6322 this._lastStrValue += String.fromCodePoint(this.currentCodePoint);
6323 this.advance();
6324 }
6325 return this._lastStrValue !== "";
6326 }
6327 eatLoneUnicodePropertyNameOrValue() {
6328 return this.eatUnicodePropertyValue();
6329 }
6330 eatCharacterClass() {
6331 const start = this.index;
6332 if (this.eat(LeftSquareBracket)) {
6333 const negate = this.eat(CircumflexAccent);
6334 this.onCharacterClassEnter(start, negate);
6335 this.classRanges();
6336 if (!this.eat(RightSquareBracket)) {
6337 this.raise("Unterminated character class");
6338 }
6339 this.onCharacterClassLeave(start, this.index, negate);
6340 return true;
6341 }
6342 return false;
6343 }
6344 classRanges() {
6345 let start = this.index;
6346 while (this.eatClassAtom()) {
6347 const left = this._lastIntValue;
6348 const hyphenStart = this.index;
6349 if (this.eat(HyphenMinus)) {
6350 this.onCharacter(hyphenStart, this.index, HyphenMinus);
6351 if (this.eatClassAtom()) {
6352 const right = this._lastIntValue;
6353 if (left === -1 || right === -1) {
6354 if (this.strict) {
6355 this.raise("Invalid character class");
6356 }
6357 }
6358 else if (left > right) {
6359 this.raise("Range out of order in character class");
6360 }
6361 else {
6362 this.onCharacterClassRange(start, this.index, left, right);
6363 }
6364 }
6365 }
6366 start = this.index;
6367 }
6368 }
6369 eatClassAtom() {
6370 const start = this.index;
6371 if (this.eat(ReverseSolidus)) {
6372 if (this.eatClassEscape()) {
6373 return true;
6374 }
6375 if (this._uFlag) {
6376 this.raise("Invalid escape");
6377 }
6378 this.rewind(start);
6379 }
6380 const cp = this.currentCodePoint;
6381 if (cp !== -1 && cp !== RightSquareBracket) {
6382 this.advance();
6383 this._lastIntValue = cp;
6384 this.onCharacter(start, this.index, cp);
6385 return true;
6386 }
6387 return false;
6388 }
6389 eatClassEscape() {
6390 const start = this.index;
6391 if (this.eat(LatinSmallLetterB)) {
6392 this._lastIntValue = Backspace;
6393 this.onCharacter(start - 1, this.index, Backspace);
6394 return true;
6395 }
6396 if (this._uFlag && this.eat(HyphenMinus)) {
6397 this._lastIntValue = HyphenMinus;
6398 this.onCharacter(start - 1, this.index, HyphenMinus);
6399 return true;
6400 }
6401 if (!this._uFlag && this.eat(LatinSmallLetterC)) {
6402 if (this.eatClassControlLetter()) {
6403 this.onCharacter(start - 1, this.index, this._lastIntValue);
6404 return true;
6405 }
6406 this.rewind(start);
6407 }
6408 return this.eatCharacterClassEscape() || this.eatCharacterEscape();
6409 }
6410 eatClassControlLetter() {
6411 const cp = this.currentCodePoint;
6412 if (isDecimalDigit(cp) || cp === LowLine) {
6413 this.advance();
6414 this._lastIntValue = cp % 0x20;
6415 return true;
6416 }
6417 return false;
6418 }
6419 eatHexEscapeSequence() {
6420 const start = this.index;
6421 if (this.eat(LatinSmallLetterX)) {
6422 if (this.eatFixedHexDigits(2)) {
6423 return true;
6424 }
6425 if (this._uFlag) {
6426 this.raise("Invalid escape");
6427 }
6428 this.rewind(start);
6429 }
6430 return false;
6431 }
6432 eatDecimalDigits() {
6433 const start = this.index;
6434 this._lastIntValue = 0;
6435 while (isDecimalDigit(this.currentCodePoint)) {
6436 this._lastIntValue =
6437 10 * this._lastIntValue + digitToInt(this.currentCodePoint);
6438 this.advance();
6439 }
6440 return this.index !== start;
6441 }
6442 eatHexDigits() {
6443 const start = this.index;
6444 this._lastIntValue = 0;
6445 while (isHexDigit(this.currentCodePoint)) {
6446 this._lastIntValue =
6447 16 * this._lastIntValue + digitToInt(this.currentCodePoint);
6448 this.advance();
6449 }
6450 return this.index !== start;
6451 }
6452 eatLegacyOctalEscapeSequence() {
6453 if (this.eatOctalDigit()) {
6454 const n1 = this._lastIntValue;
6455 if (this.eatOctalDigit()) {
6456 const n2 = this._lastIntValue;
6457 if (n1 <= 3 && this.eatOctalDigit()) {
6458 this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue;
6459 }
6460 else {
6461 this._lastIntValue = n1 * 8 + n2;
6462 }
6463 }
6464 else {
6465 this._lastIntValue = n1;
6466 }
6467 return true;
6468 }
6469 return false;
6470 }
6471 eatOctalDigit() {
6472 const cp = this.currentCodePoint;
6473 if (isOctalDigit(cp)) {
6474 this.advance();
6475 this._lastIntValue = cp - DigitZero;
6476 return true;
6477 }
6478 this._lastIntValue = 0;
6479 return false;
6480 }
6481 eatFixedHexDigits(length) {
6482 const start = this.index;
6483 this._lastIntValue = 0;
6484 for (let i = 0; i < length; ++i) {
6485 const cp = this.currentCodePoint;
6486 if (!isHexDigit(cp)) {
6487 this.rewind(start);
6488 return false;
6489 }
6490 this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp);
6491 this.advance();
6492 }
6493 return true;
6494 }
6495}
6496
6497const DummyPattern = {};
6498const DummyFlags = {};
6499const DummyCapturingGroup = {};
6500class RegExpParserState {
6501 constructor(options) {
6502 this._node = DummyPattern;
6503 this._flags = DummyFlags;
6504 this._backreferences = [];
6505 this._capturingGroups = [];
6506 this.source = "";
6507 this.strict = Boolean(options && options.strict);
6508 this.ecmaVersion = (options && options.ecmaVersion) || 2018;
6509 }
6510 get pattern() {
6511 if (this._node.type !== "Pattern") {
6512 throw new Error("UnknownError");
6513 }
6514 return this._node;
6515 }
6516 get flags() {
6517 if (this._flags.type !== "Flags") {
6518 throw new Error("UnknownError");
6519 }
6520 return this._flags;
6521 }
6522 onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) {
6523 this._flags = {
6524 type: "Flags",
6525 parent: null,
6526 start,
6527 end,
6528 raw: this.source.slice(start, end),
6529 global,
6530 ignoreCase,
6531 multiline,
6532 unicode,
6533 sticky,
6534 dotAll,
6535 };
6536 }
6537 onPatternEnter(start) {
6538 this._node = {
6539 type: "Pattern",
6540 parent: null,
6541 start,
6542 end: start,
6543 raw: "",
6544 alternatives: [],
6545 };
6546 this._backreferences.length = 0;
6547 this._capturingGroups.length = 0;
6548 }
6549 onPatternLeave(start, end) {
6550 this._node.end = end;
6551 this._node.raw = this.source.slice(start, end);
6552 for (const reference of this._backreferences) {
6553 const ref = reference.ref;
6554 const group = typeof ref === "number"
6555 ? this._capturingGroups[ref - 1]
6556 : this._capturingGroups.find(g => g.name === ref);
6557 reference.resolved = group;
6558 group.references.push(reference);
6559 }
6560 }
6561 onAlternativeEnter(start) {
6562 const parent = this._node;
6563 if (parent.type !== "Assertion" &&
6564 parent.type !== "CapturingGroup" &&
6565 parent.type !== "Group" &&
6566 parent.type !== "Pattern") {
6567 throw new Error("UnknownError");
6568 }
6569 this._node = {
6570 type: "Alternative",
6571 parent,
6572 start,
6573 end: start,
6574 raw: "",
6575 elements: [],
6576 };
6577 parent.alternatives.push(this._node);
6578 }
6579 onAlternativeLeave(start, end) {
6580 const node = this._node;
6581 if (node.type !== "Alternative") {
6582 throw new Error("UnknownError");
6583 }
6584 node.end = end;
6585 node.raw = this.source.slice(start, end);
6586 this._node = node.parent;
6587 }
6588 onGroupEnter(start) {
6589 const parent = this._node;
6590 if (parent.type !== "Alternative") {
6591 throw new Error("UnknownError");
6592 }
6593 this._node = {
6594 type: "Group",
6595 parent,
6596 start,
6597 end: start,
6598 raw: "",
6599 alternatives: [],
6600 };
6601 parent.elements.push(this._node);
6602 }
6603 onGroupLeave(start, end) {
6604 const node = this._node;
6605 if (node.type !== "Group" || node.parent.type !== "Alternative") {
6606 throw new Error("UnknownError");
6607 }
6608 node.end = end;
6609 node.raw = this.source.slice(start, end);
6610 this._node = node.parent;
6611 }
6612 onCapturingGroupEnter(start, name) {
6613 const parent = this._node;
6614 if (parent.type !== "Alternative") {
6615 throw new Error("UnknownError");
6616 }
6617 this._node = {
6618 type: "CapturingGroup",
6619 parent,
6620 start,
6621 end: start,
6622 raw: "",
6623 name,
6624 alternatives: [],
6625 references: [],
6626 };
6627 parent.elements.push(this._node);
6628 this._capturingGroups.push(this._node);
6629 }
6630 onCapturingGroupLeave(start, end) {
6631 const node = this._node;
6632 if (node.type !== "CapturingGroup" ||
6633 node.parent.type !== "Alternative") {
6634 throw new Error("UnknownError");
6635 }
6636 node.end = end;
6637 node.raw = this.source.slice(start, end);
6638 this._node = node.parent;
6639 }
6640 onQuantifier(start, end, min, max, greedy) {
6641 const parent = this._node;
6642 if (parent.type !== "Alternative") {
6643 throw new Error("UnknownError");
6644 }
6645 const element = parent.elements.pop();
6646 if (element == null ||
6647 element.type === "Quantifier" ||
6648 (element.type === "Assertion" && element.kind !== "lookahead")) {
6649 throw new Error("UnknownError");
6650 }
6651 const node = {
6652 type: "Quantifier",
6653 parent,
6654 start: element.start,
6655 end,
6656 raw: this.source.slice(element.start, end),
6657 min,
6658 max,
6659 greedy,
6660 element,
6661 };
6662 parent.elements.push(node);
6663 element.parent = node;
6664 }
6665 onLookaroundAssertionEnter(start, kind, negate) {
6666 const parent = this._node;
6667 if (parent.type !== "Alternative") {
6668 throw new Error("UnknownError");
6669 }
6670 this._node = {
6671 type: "Assertion",
6672 parent,
6673 start,
6674 end: start,
6675 raw: "",
6676 kind,
6677 negate,
6678 alternatives: [],
6679 };
6680 parent.elements.push(this._node);
6681 }
6682 onLookaroundAssertionLeave(start, end) {
6683 const node = this._node;
6684 if (node.type !== "Assertion" || node.parent.type !== "Alternative") {
6685 throw new Error("UnknownError");
6686 }
6687 node.end = end;
6688 node.raw = this.source.slice(start, end);
6689 this._node = node.parent;
6690 }
6691 onEdgeAssertion(start, end, kind) {
6692 const parent = this._node;
6693 if (parent.type !== "Alternative") {
6694 throw new Error("UnknownError");
6695 }
6696 parent.elements.push({
6697 type: "Assertion",
6698 parent,
6699 start,
6700 end,
6701 raw: this.source.slice(start, end),
6702 kind,
6703 });
6704 }
6705 onWordBoundaryAssertion(start, end, kind, negate) {
6706 const parent = this._node;
6707 if (parent.type !== "Alternative") {
6708 throw new Error("UnknownError");
6709 }
6710 parent.elements.push({
6711 type: "Assertion",
6712 parent,
6713 start,
6714 end,
6715 raw: this.source.slice(start, end),
6716 kind,
6717 negate,
6718 });
6719 }
6720 onAnyCharacterSet(start, end, kind) {
6721 const parent = this._node;
6722 if (parent.type !== "Alternative") {
6723 throw new Error("UnknownError");
6724 }
6725 parent.elements.push({
6726 type: "CharacterSet",
6727 parent,
6728 start,
6729 end,
6730 raw: this.source.slice(start, end),
6731 kind,
6732 });
6733 }
6734 onEscapeCharacterSet(start, end, kind, negate) {
6735 const parent = this._node;
6736 if (parent.type !== "Alternative" && parent.type !== "CharacterClass") {
6737 throw new Error("UnknownError");
6738 }
6739 parent.elements.push({
6740 type: "CharacterSet",
6741 parent,
6742 start,
6743 end,
6744 raw: this.source.slice(start, end),
6745 kind,
6746 negate,
6747 });
6748 }
6749 onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) {
6750 const parent = this._node;
6751 if (parent.type !== "Alternative" && parent.type !== "CharacterClass") {
6752 throw new Error("UnknownError");
6753 }
6754 parent.elements.push({
6755 type: "CharacterSet",
6756 parent,
6757 start,
6758 end,
6759 raw: this.source.slice(start, end),
6760 kind,
6761 key,
6762 value,
6763 negate,
6764 });
6765 }
6766 onCharacter(start, end, value) {
6767 const parent = this._node;
6768 if (parent.type !== "Alternative" && parent.type !== "CharacterClass") {
6769 throw new Error("UnknownError");
6770 }
6771 parent.elements.push({
6772 type: "Character",
6773 parent,
6774 start,
6775 end,
6776 raw: this.source.slice(start, end),
6777 value,
6778 });
6779 }
6780 onBackreference(start, end, ref) {
6781 const parent = this._node;
6782 if (parent.type !== "Alternative") {
6783 throw new Error("UnknownError");
6784 }
6785 const node = {
6786 type: "Backreference",
6787 parent,
6788 start,
6789 end,
6790 raw: this.source.slice(start, end),
6791 ref,
6792 resolved: DummyCapturingGroup,
6793 };
6794 parent.elements.push(node);
6795 this._backreferences.push(node);
6796 }
6797 onCharacterClassEnter(start, negate) {
6798 const parent = this._node;
6799 if (parent.type !== "Alternative") {
6800 throw new Error("UnknownError");
6801 }
6802 this._node = {
6803 type: "CharacterClass",
6804 parent,
6805 start,
6806 end: start,
6807 raw: "",
6808 negate,
6809 elements: [],
6810 };
6811 parent.elements.push(this._node);
6812 }
6813 onCharacterClassLeave(start, end) {
6814 const node = this._node;
6815 if (node.type !== "CharacterClass" ||
6816 node.parent.type !== "Alternative") {
6817 throw new Error("UnknownError");
6818 }
6819 node.end = end;
6820 node.raw = this.source.slice(start, end);
6821 this._node = node.parent;
6822 }
6823 onCharacterClassRange(start, end) {
6824 const parent = this._node;
6825 if (parent.type !== "CharacterClass") {
6826 throw new Error("UnknownError");
6827 }
6828 const elements = parent.elements;
6829 const max = elements.pop();
6830 const hyphen = elements.pop();
6831 const min = elements.pop();
6832 if (!min ||
6833 !max ||
6834 !hyphen ||
6835 min.type !== "Character" ||
6836 max.type !== "Character" ||
6837 hyphen.type !== "Character" ||
6838 hyphen.value !== HyphenMinus) {
6839 throw new Error("UnknownError");
6840 }
6841 const node = {
6842 type: "CharacterClassRange",
6843 parent,
6844 start,
6845 end,
6846 raw: this.source.slice(start, end),
6847 min,
6848 max,
6849 };
6850 min.parent = node;
6851 max.parent = node;
6852 elements.push(node);
6853 }
6854}
6855class RegExpParser {
6856 constructor(options) {
6857 this._state = new RegExpParserState(options);
6858 this._validator = new RegExpValidator(this._state);
6859 }
6860 parseLiteral(source, start = 0, end = source.length) {
6861 this._state.source = source;
6862 this._validator.validateLiteral(source, start, end);
6863 const pattern = this._state.pattern;
6864 const flags = this._state.flags;
6865 const literal = {
6866 type: "RegExpLiteral",
6867 parent: null,
6868 start,
6869 end,
6870 raw: source,
6871 pattern,
6872 flags,
6873 };
6874 pattern.parent = literal;
6875 flags.parent = literal;
6876 return literal;
6877 }
6878 parseFlags(source, start = 0, end = source.length) {
6879 this._state.source = source;
6880 this._validator.validateFlags(source, start, end);
6881 return this._state.flags;
6882 }
6883 parsePattern(source, start = 0, end = source.length, uFlag = false) {
6884 this._state.source = source;
6885 this._validator.validatePattern(source, start, end, uFlag);
6886 return this._state.pattern;
6887 }
6888}
6889
6890class RegExpVisitor {
6891 constructor(handlers) {
6892 this._handlers = handlers;
6893 }
6894 visit(node) {
6895 switch (node.type) {
6896 case "Alternative":
6897 this.visitAlternative(node);
6898 break;
6899 case "Assertion":
6900 this.visitAssertion(node);
6901 break;
6902 case "Backreference":
6903 this.visitBackreference(node);
6904 break;
6905 case "CapturingGroup":
6906 this.visitCapturingGroup(node);
6907 break;
6908 case "Character":
6909 this.visitCharacter(node);
6910 break;
6911 case "CharacterClass":
6912 this.visitCharacterClass(node);
6913 break;
6914 case "CharacterClassRange":
6915 this.visitCharacterClassRange(node);
6916 break;
6917 case "CharacterSet":
6918 this.visitCharacterSet(node);
6919 break;
6920 case "Flags":
6921 this.visitFlags(node);
6922 break;
6923 case "Group":
6924 this.visitGroup(node);
6925 break;
6926 case "Pattern":
6927 this.visitPattern(node);
6928 break;
6929 case "Quantifier":
6930 this.visitQuantifier(node);
6931 break;
6932 case "RegExpLiteral":
6933 this.visitRegExpLiteral(node);
6934 break;
6935 default:
6936 throw new Error(`Unknown type: ${node.type}`);
6937 }
6938 }
6939 visitAlternative(node) {
6940 if (this._handlers.onAlternativeEnter) {
6941 this._handlers.onAlternativeEnter(node);
6942 }
6943 node.elements.forEach(this.visit, this);
6944 if (this._handlers.onAlternativeLeave) {
6945 this._handlers.onAlternativeLeave(node);
6946 }
6947 }
6948 visitAssertion(node) {
6949 if (this._handlers.onAssertionEnter) {
6950 this._handlers.onAssertionEnter(node);
6951 }
6952 if (node.kind === "lookahead" || node.kind === "lookbehind") {
6953 node.alternatives.forEach(this.visit, this);
6954 }
6955 if (this._handlers.onAssertionLeave) {
6956 this._handlers.onAssertionLeave(node);
6957 }
6958 }
6959 visitBackreference(node) {
6960 if (this._handlers.onBackreferenceEnter) {
6961 this._handlers.onBackreferenceEnter(node);
6962 }
6963 if (this._handlers.onBackreferenceLeave) {
6964 this._handlers.onBackreferenceLeave(node);
6965 }
6966 }
6967 visitCapturingGroup(node) {
6968 if (this._handlers.onCapturingGroupEnter) {
6969 this._handlers.onCapturingGroupEnter(node);
6970 }
6971 node.alternatives.forEach(this.visit, this);
6972 if (this._handlers.onCapturingGroupLeave) {
6973 this._handlers.onCapturingGroupLeave(node);
6974 }
6975 }
6976 visitCharacter(node) {
6977 if (this._handlers.onCharacterEnter) {
6978 this._handlers.onCharacterEnter(node);
6979 }
6980 if (this._handlers.onCharacterLeave) {
6981 this._handlers.onCharacterLeave(node);
6982 }
6983 }
6984 visitCharacterClass(node) {
6985 if (this._handlers.onCharacterClassEnter) {
6986 this._handlers.onCharacterClassEnter(node);
6987 }
6988 node.elements.forEach(this.visit, this);
6989 if (this._handlers.onCharacterClassLeave) {
6990 this._handlers.onCharacterClassLeave(node);
6991 }
6992 }
6993 visitCharacterClassRange(node) {
6994 if (this._handlers.onCharacterClassRangeEnter) {
6995 this._handlers.onCharacterClassRangeEnter(node);
6996 }
6997 this.visitCharacter(node.min);
6998 this.visitCharacter(node.max);
6999 if (this._handlers.onCharacterClassRangeLeave) {
7000 this._handlers.onCharacterClassRangeLeave(node);
7001 }
7002 }
7003 visitCharacterSet(node) {
7004 if (this._handlers.onCharacterSetEnter) {
7005 this._handlers.onCharacterSetEnter(node);
7006 }
7007 if (this._handlers.onCharacterSetLeave) {
7008 this._handlers.onCharacterSetLeave(node);
7009 }
7010 }
7011 visitFlags(node) {
7012 if (this._handlers.onFlagsEnter) {
7013 this._handlers.onFlagsEnter(node);
7014 }
7015 if (this._handlers.onFlagsLeave) {
7016 this._handlers.onFlagsLeave(node);
7017 }
7018 }
7019 visitGroup(node) {
7020 if (this._handlers.onGroupEnter) {
7021 this._handlers.onGroupEnter(node);
7022 }
7023 node.alternatives.forEach(this.visit, this);
7024 if (this._handlers.onGroupLeave) {
7025 this._handlers.onGroupLeave(node);
7026 }
7027 }
7028 visitPattern(node) {
7029 if (this._handlers.onPatternEnter) {
7030 this._handlers.onPatternEnter(node);
7031 }
7032 node.alternatives.forEach(this.visit, this);
7033 if (this._handlers.onPatternLeave) {
7034 this._handlers.onPatternLeave(node);
7035 }
7036 }
7037 visitQuantifier(node) {
7038 if (this._handlers.onQuantifierEnter) {
7039 this._handlers.onQuantifierEnter(node);
7040 }
7041 this.visit(node.element);
7042 if (this._handlers.onQuantifierLeave) {
7043 this._handlers.onQuantifierLeave(node);
7044 }
7045 }
7046 visitRegExpLiteral(node) {
7047 if (this._handlers.onRegExpLiteralEnter) {
7048 this._handlers.onRegExpLiteralEnter(node);
7049 }
7050 this.visitPattern(node.pattern);
7051 this.visitFlags(node.flags);
7052 if (this._handlers.onRegExpLiteralLeave) {
7053 this._handlers.onRegExpLiteralLeave(node);
7054 }
7055 }
7056}
7057
7058function parseRegExpLiteral(source, options) {
7059 return new RegExpParser(options).parseLiteral(String(source));
7060}
7061function validateRegExpLiteral(source, options) {
7062 return new RegExpValidator(options).validateLiteral(source);
7063}
7064function visitRegExpAST(node, handlers) {
7065 new RegExpVisitor(handlers).visit(node);
7066}
7067
7068export { ast as AST, RegExpParser, RegExpValidator, parseRegExpLiteral, validateRegExpLiteral, visitRegExpAST };
7069//# sourceMappingURL=index.mjs.map