forked from v8/v8
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunicode.cc
More file actions
3192 lines (3156 loc) · 157 KB
/
unicode.cc
File metadata and controls
3192 lines (3156 loc) · 157 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2012 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// This file was generated at 2014-10-08 15:25:47.940335
#include "src/strings/unicode.h"
#include <stdio.h>
#include <stdlib.h>
#include "src/strings/unicode-inl.h"
#ifdef V8_INTL_SUPPORT
#include "unicode/uchar.h"
#endif
namespace unibrow {
#ifndef V8_INTL_SUPPORT
static const int kStartBit = (1 << 30);
static const int kChunkBits = (1 << 13);
#endif // !V8_INTL_SUPPORT
static const uchar kSentinel = static_cast<uchar>(-1);
/**
* \file
* Implementations of functions for working with Unicode.
*/
using int16_t = signed short; // NOLINT
using uint16_t = unsigned short; // NOLINT
using int32_t = int; // NOLINT
#ifndef V8_INTL_SUPPORT
// All access to the character table should go through this function.
template <int D>
static inline uchar TableGet(const int32_t* table, int index) {
return table[D * index];
}
static inline uchar GetEntry(int32_t entry) { return entry & (kStartBit - 1); }
static inline bool IsStart(int32_t entry) { return (entry & kStartBit) != 0; }
/**
* Look up a character in the Unicode table using a mix of binary and
* interpolation search. For a uniformly distributed array
* interpolation search beats binary search by a wide margin. However,
* in this case interpolation search degenerates because of some very
* high values in the lower end of the table so this function uses a
* combination. The average number of steps to look up the information
* about a character is around 10, slightly higher if there is no
* information available about the character.
*/
static bool LookupPredicate(const int32_t* table, uint16_t size, uchar chr) {
static const int kEntryDist = 1;
uint16_t value = chr & (kChunkBits - 1);
unsigned int low = 0;
unsigned int high = size - 1;
while (high != low) {
unsigned int mid = low + ((high - low) >> 1);
uchar current_value = GetEntry(TableGet<kEntryDist>(table, mid));
// If we've found an entry less than or equal to this one, and the
// next one is not also less than this one, we've arrived.
if ((current_value <= value) &&
(mid + 1 == size ||
GetEntry(TableGet<kEntryDist>(table, mid + 1)) > value)) {
low = mid;
break;
} else if (current_value < value) {
low = mid + 1;
} else if (current_value > value) {
// If we've just checked the bottom-most value and it's not
// the one we're looking for, we're done.
if (mid == 0) break;
high = mid - 1;
}
}
int32_t field = TableGet<kEntryDist>(table, low);
uchar entry = GetEntry(field);
bool is_start = IsStart(field);
return (entry == value) || (entry < value && is_start);
}
#endif // !V8_INTL_SUPPORT
template <int kW>
struct MultiCharacterSpecialCase {
static const uchar kEndOfEncoding = kSentinel;
uchar chars[kW];
};
#ifndef V8_INTL_SUPPORT
// Look up the mapping for the given character in the specified table,
// which is of the specified length and uses the specified special case
// mapping for multi-char mappings. The next parameter is the character
// following the one to map. The result will be written in to the result
// buffer and the number of characters written will be returned. Finally,
// if the allow_caching_ptr is non-null then false will be stored in
// it if the result contains multiple characters or depends on the
// context.
// If ranges are linear, a match between a start and end point is
// offset by the distance between the match and the start. Otherwise
// the result is the same as for the start point on the entire range.
template <bool ranges_are_linear, int kW>
static int LookupMapping(const int32_t* table, uint16_t size,
const MultiCharacterSpecialCase<kW>* multi_chars,
uchar chr, uchar next, uchar* result,
bool* allow_caching_ptr) {
static const int kEntryDist = 2;
uint16_t key = chr & (kChunkBits - 1);
uint16_t chunk_start = chr - key;
unsigned int low = 0;
unsigned int high = size - 1;
while (high != low) {
unsigned int mid = low + ((high - low) >> 1);
uchar current_value = GetEntry(TableGet<kEntryDist>(table, mid));
// If we've found an entry less than or equal to this one, and the next one
// is not also less than this one, we've arrived.
if ((current_value <= key) &&
(mid + 1 == size ||
GetEntry(TableGet<kEntryDist>(table, mid + 1)) > key)) {
low = mid;
break;
} else if (current_value < key) {
low = mid + 1;
} else if (current_value > key) {
// If we've just checked the bottom-most value and it's not
// the one we're looking for, we're done.
if (mid == 0) break;
high = mid - 1;
}
}
int32_t field = TableGet<kEntryDist>(table, low);
uchar entry = GetEntry(field);
bool is_start = IsStart(field);
bool found = (entry == key) || (entry < key && is_start);
if (found) {
int32_t value = table[2 * low + 1];
if (value == 0) {
// 0 means not present
return 0;
} else if ((value & 3) == 0) {
// Low bits 0 means a constant offset from the given character.
if (ranges_are_linear) {
result[0] = chr + (value >> 2);
} else {
result[0] = entry + chunk_start + (value >> 2);
}
return 1;
} else if ((value & 3) == 1) {
// Low bits 1 means a special case mapping
if (allow_caching_ptr) *allow_caching_ptr = false;
const MultiCharacterSpecialCase<kW>& mapping = multi_chars[value >> 2];
int length = 0;
for (length = 0; length < kW; length++) {
uchar mapped = mapping.chars[length];
if (mapped == MultiCharacterSpecialCase<kW>::kEndOfEncoding) break;
if (ranges_are_linear) {
result[length] = mapped + (key - entry);
} else {
result[length] = mapped;
}
}
return length;
} else {
// Low bits 2 means a really really special case
if (allow_caching_ptr) *allow_caching_ptr = false;
// The cases of this switch are defined in unicode.py in the
// really_special_cases mapping.
switch (value >> 2) {
case 1:
// Really special case 1: upper case sigma. This letter
// converts to two different lower case sigmas depending on
// whether or not it occurs at the end of a word.
if (next != 0 && Letter::Is(next)) {
result[0] = 0x03C3;
} else {
result[0] = 0x03C2;
}
return 1;
default:
return 0;
}
return -1;
}
} else {
return 0;
}
}
#endif // !V8_INTL_SUPPORT
// This method decodes an UTF-8 value according to RFC 3629 and
// https://encoding.spec.whatwg.org/#utf-8-decoder .
uchar Utf8::CalculateValue(const byte* str, size_t max_length, size_t* cursor) {
DCHECK_GT(max_length, 0);
DCHECK_GT(str[0], kMaxOneByteChar);
State state = State::kAccept;
Utf8IncrementalBuffer buffer = 0;
uchar t;
const byte* start = str;
const byte* end = str + max_length;
do {
t = ValueOfIncremental(&str, &state, &buffer);
} while (str < end && t == kIncomplete);
*cursor += str - start;
return (state == State::kAccept) ? t : kBadChar;
}
// Finishes the incremental decoding, ensuring that if an unfinished sequence
// is left that it is replaced by a replacement char.
uchar Utf8::ValueOfIncrementalFinish(State* state) {
if (*state == State::kAccept) {
return kBufferEmpty;
} else {
DCHECK_GT(*state, State::kAccept);
*state = State::kAccept;
return kBadChar;
}
}
bool Utf8::ValidateEncoding(const byte* bytes, size_t length) {
State state = State::kAccept;
Utf8IncrementalBuffer throw_away = 0;
for (size_t i = 0; i < length && state != State::kReject; i++) {
Utf8DfaDecoder::Decode(bytes[i], &state, &throw_away);
}
return state == State::kAccept;
}
// Uppercase: point.category == 'Lu'
// TODO(jshin): Check if it's ok to exclude Other_Uppercase characters.
#ifdef V8_INTL_SUPPORT
bool Uppercase::Is(uchar c) { return static_cast<bool>(u_isupper(c)); }
#else
static const uint16_t kUppercaseTable0Size = 455;
static const int32_t kUppercaseTable0[455] = {
1073741889, 90, 1073742016, 214,
1073742040, 222, 256, 258, // NOLINT
260, 262, 264, 266,
268, 270, 272, 274, // NOLINT
276, 278, 280, 282,
284, 286, 288, 290, // NOLINT
292, 294, 296, 298,
300, 302, 304, 306, // NOLINT
308, 310, 313, 315,
317, 319, 321, 323, // NOLINT
325, 327, 330, 332,
334, 336, 338, 340, // NOLINT
342, 344, 346, 348,
350, 352, 354, 356, // NOLINT
358, 360, 362, 364,
366, 368, 370, 372, // NOLINT
374, 1073742200, 377, 379,
381, 1073742209, 386, 388, // NOLINT
1073742214, 391, 1073742217, 395,
1073742222, 401, 1073742227, 404, // NOLINT
1073742230, 408, 1073742236, 413,
1073742239, 416, 418, 420, // NOLINT
1073742246, 423, 425, 428,
1073742254, 431, 1073742257, 435, // NOLINT
437, 1073742263, 440, 444,
452, 455, 458, 461, // NOLINT
463, 465, 467, 469,
471, 473, 475, 478, // NOLINT
480, 482, 484, 486,
488, 490, 492, 494, // NOLINT
497, 500, 1073742326, 504,
506, 508, 510, 512, // NOLINT
514, 516, 518, 520,
522, 524, 526, 528, // NOLINT
530, 532, 534, 536,
538, 540, 542, 544, // NOLINT
546, 548, 550, 552,
554, 556, 558, 560, // NOLINT
562, 1073742394, 571, 1073742397,
574, 577, 1073742403, 582, // NOLINT
584, 586, 588, 590,
880, 882, 886, 895, // NOLINT
902, 1073742728, 906, 908,
1073742734, 911, 1073742737, 929, // NOLINT
1073742755, 939, 975, 1073742802,
980, 984, 986, 988, // NOLINT
990, 992, 994, 996,
998, 1000, 1002, 1004, // NOLINT
1006, 1012, 1015, 1073742841,
1018, 1073742845, 1071, 1120, // NOLINT
1122, 1124, 1126, 1128,
1130, 1132, 1134, 1136, // NOLINT
1138, 1140, 1142, 1144,
1146, 1148, 1150, 1152, // NOLINT
1162, 1164, 1166, 1168,
1170, 1172, 1174, 1176, // NOLINT
1178, 1180, 1182, 1184,
1186, 1188, 1190, 1192, // NOLINT
1194, 1196, 1198, 1200,
1202, 1204, 1206, 1208, // NOLINT
1210, 1212, 1214, 1073743040,
1217, 1219, 1221, 1223, // NOLINT
1225, 1227, 1229, 1232,
1234, 1236, 1238, 1240, // NOLINT
1242, 1244, 1246, 1248,
1250, 1252, 1254, 1256, // NOLINT
1258, 1260, 1262, 1264,
1266, 1268, 1270, 1272, // NOLINT
1274, 1276, 1278, 1280,
1282, 1284, 1286, 1288, // NOLINT
1290, 1292, 1294, 1296,
1298, 1300, 1302, 1304, // NOLINT
1306, 1308, 1310, 1312,
1314, 1316, 1318, 1320, // NOLINT
1322, 1324, 1326, 1073743153,
1366, 1073746080, 4293, 4295, // NOLINT
4301, 7680, 7682, 7684,
7686, 7688, 7690, 7692, // NOLINT
7694, 7696, 7698, 7700,
7702, 7704, 7706, 7708, // NOLINT
7710, 7712, 7714, 7716,
7718, 7720, 7722, 7724, // NOLINT
7726, 7728, 7730, 7732,
7734, 7736, 7738, 7740, // NOLINT
7742, 7744, 7746, 7748,
7750, 7752, 7754, 7756, // NOLINT
7758, 7760, 7762, 7764,
7766, 7768, 7770, 7772, // NOLINT
7774, 7776, 7778, 7780,
7782, 7784, 7786, 7788, // NOLINT
7790, 7792, 7794, 7796,
7798, 7800, 7802, 7804, // NOLINT
7806, 7808, 7810, 7812,
7814, 7816, 7818, 7820, // NOLINT
7822, 7824, 7826, 7828,
7838, 7840, 7842, 7844, // NOLINT
7846, 7848, 7850, 7852,
7854, 7856, 7858, 7860, // NOLINT
7862, 7864, 7866, 7868,
7870, 7872, 7874, 7876, // NOLINT
7878, 7880, 7882, 7884,
7886, 7888, 7890, 7892, // NOLINT
7894, 7896, 7898, 7900,
7902, 7904, 7906, 7908, // NOLINT
7910, 7912, 7914, 7916,
7918, 7920, 7922, 7924, // NOLINT
7926, 7928, 7930, 7932,
7934, 1073749768, 7951, 1073749784, // NOLINT
7965, 1073749800, 7983, 1073749816,
7999, 1073749832, 8013, 8025, // NOLINT
8027, 8029, 8031, 1073749864,
8047, 1073749944, 8123, 1073749960, // NOLINT
8139, 1073749976, 8155, 1073749992,
8172, 1073750008, 8187}; // NOLINT
static const uint16_t kUppercaseTable1Size = 86;
static const int32_t kUppercaseTable1[86] = {
258, 263, 1073742091, 269, 1073742096, 274,
277, 1073742105, // NOLINT
285, 292, 294, 296, 1073742122, 301,
1073742128, 307, // NOLINT
1073742142, 319, 325, 387, 1073744896, 3118,
3168, 1073744994, // NOLINT
3172, 3175, 3177, 3179, 1073745005, 3184,
3186, 3189, // NOLINT
1073745022, 3200, 3202, 3204, 3206, 3208,
3210, 3212, // NOLINT
3214, 3216, 3218, 3220, 3222, 3224,
3226, 3228, // NOLINT
3230, 3232, 3234, 3236, 3238, 3240,
3242, 3244, // NOLINT
3246, 3248, 3250, 3252, 3254, 3256,
3258, 3260, // NOLINT
3262, 3264, 3266, 3268, 3270, 3272,
3274, 3276, // NOLINT
3278, 3280, 3282, 3284, 3286, 3288,
3290, 3292, // NOLINT
3294, 3296, 3298, 3307, 3309, 3314}; // NOLINT
static const uint16_t kUppercaseTable5Size = 101;
static const int32_t kUppercaseTable5[101] = {
1600, 1602, 1604, 1606, 1608, 1610, 1612, 1614, // NOLINT
1616, 1618, 1620, 1622, 1624, 1626, 1628, 1630, // NOLINT
1632, 1634, 1636, 1638, 1640, 1642, 1644, 1664, // NOLINT
1666, 1668, 1670, 1672, 1674, 1676, 1678, 1680, // NOLINT
1682, 1684, 1686, 1688, 1690, 1826, 1828, 1830, // NOLINT
1832, 1834, 1836, 1838, 1842, 1844, 1846, 1848, // NOLINT
1850, 1852, 1854, 1856, 1858, 1860, 1862, 1864, // NOLINT
1866, 1868, 1870, 1872, 1874, 1876, 1878, 1880, // NOLINT
1882, 1884, 1886, 1888, 1890, 1892, 1894, 1896, // NOLINT
1898, 1900, 1902, 1913, 1915, 1073743741, 1918, 1920, // NOLINT
1922, 1924, 1926, 1931, 1933, 1936, 1938, 1942, // NOLINT
1944, 1946, 1948, 1950, 1952, 1954, 1956, 1958, // NOLINT
1960, 1073743786, 1965, 1073743792, 1969}; // NOLINT
static const uint16_t kUppercaseTable7Size = 2;
static const int32_t kUppercaseTable7[2] = {1073749793, 7994}; // NOLINT
bool Uppercase::Is(uchar c) {
int chunk_index = c >> 13;
switch (chunk_index) {
case 0:
return LookupPredicate(kUppercaseTable0, kUppercaseTable0Size, c);
case 1:
return LookupPredicate(kUppercaseTable1, kUppercaseTable1Size, c);
case 5:
return LookupPredicate(kUppercaseTable5, kUppercaseTable5Size, c);
case 7:
return LookupPredicate(kUppercaseTable7, kUppercaseTable7Size, c);
default:
return false;
}
}
#endif // V8_INTL_SUPPORT
// Letter: point.category in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl']
#ifdef V8_INTL_SUPPORT
bool Letter::Is(uchar c) { return static_cast<bool>(u_isalpha(c)); }
#else
static const uint16_t kLetterTable0Size = 431;
static const int32_t kLetterTable0[431] = {
1073741889, 90, 1073741921, 122,
170, 181, 186, 1073742016, // NOLINT
214, 1073742040, 246, 1073742072,
705, 1073742534, 721, 1073742560, // NOLINT
740, 748, 750, 1073742704,
884, 1073742710, 887, 1073742714, // NOLINT
893, 895, 902, 1073742728,
906, 908, 1073742734, 929, // NOLINT
1073742755, 1013, 1073742839, 1153,
1073742986, 1327, 1073743153, 1366, // NOLINT
1369, 1073743201, 1415, 1073743312,
1514, 1073743344, 1522, 1073743392, // NOLINT
1610, 1073743470, 1647, 1073743473,
1747, 1749, 1073743589, 1766, // NOLINT
1073743598, 1775, 1073743610, 1788,
1791, 1808, 1073743634, 1839, // NOLINT
1073743693, 1957, 1969, 1073743818,
2026, 1073743860, 2037, 2042, // NOLINT
1073743872, 2069, 2074, 2084,
2088, 1073743936, 2136, 1073744032, // NOLINT
2226, 1073744132, 2361, 2365,
2384, 1073744216, 2401, 1073744241, // NOLINT
2432, 1073744261, 2444, 1073744271,
2448, 1073744275, 2472, 1073744298, // NOLINT
2480, 2482, 1073744310, 2489,
2493, 2510, 1073744348, 2525, // NOLINT
1073744351, 2529, 1073744368, 2545,
1073744389, 2570, 1073744399, 2576, // NOLINT
1073744403, 2600, 1073744426, 2608,
1073744434, 2611, 1073744437, 2614, // NOLINT
1073744440, 2617, 1073744473, 2652,
2654, 1073744498, 2676, 1073744517, // NOLINT
2701, 1073744527, 2705, 1073744531,
2728, 1073744554, 2736, 1073744562, // NOLINT
2739, 1073744565, 2745, 2749,
2768, 1073744608, 2785, 1073744645, // NOLINT
2828, 1073744655, 2832, 1073744659,
2856, 1073744682, 2864, 1073744690, // NOLINT
2867, 1073744693, 2873, 2877,
1073744732, 2909, 1073744735, 2913, // NOLINT
2929, 2947, 1073744773, 2954,
1073744782, 2960, 1073744786, 2965, // NOLINT
1073744793, 2970, 2972, 1073744798,
2975, 1073744803, 2980, 1073744808, // NOLINT
2986, 1073744814, 3001, 3024,
1073744901, 3084, 1073744910, 3088, // NOLINT
1073744914, 3112, 1073744938, 3129,
3133, 1073744984, 3161, 1073744992, // NOLINT
3169, 1073745029, 3212, 1073745038,
3216, 1073745042, 3240, 1073745066, // NOLINT
3251, 1073745077, 3257, 3261,
3294, 1073745120, 3297, 1073745137, // NOLINT
3314, 1073745157, 3340, 1073745166,
3344, 1073745170, 3386, 3389, // NOLINT
3406, 1073745248, 3425, 1073745274,
3455, 1073745285, 3478, 1073745306, // NOLINT
3505, 1073745331, 3515, 3517,
1073745344, 3526, 1073745409, 3632, // NOLINT
1073745458, 3635, 1073745472, 3654,
1073745537, 3714, 3716, 1073745543, // NOLINT
3720, 3722, 3725, 1073745556,
3735, 1073745561, 3743, 1073745569, // NOLINT
3747, 3749, 3751, 1073745578,
3755, 1073745581, 3760, 1073745586, // NOLINT
3763, 3773, 1073745600, 3780,
3782, 1073745628, 3807, 3840, // NOLINT
1073745728, 3911, 1073745737, 3948,
1073745800, 3980, 1073745920, 4138, // NOLINT
4159, 1073746000, 4181, 1073746010,
4189, 4193, 1073746021, 4198, // NOLINT
1073746030, 4208, 1073746037, 4225,
4238, 1073746080, 4293, 4295, // NOLINT
4301, 1073746128, 4346, 1073746172,
4680, 1073746506, 4685, 1073746512, // NOLINT
4694, 4696, 1073746522, 4701,
1073746528, 4744, 1073746570, 4749, // NOLINT
1073746576, 4784, 1073746610, 4789,
1073746616, 4798, 4800, 1073746626, // NOLINT
4805, 1073746632, 4822, 1073746648,
4880, 1073746706, 4885, 1073746712, // NOLINT
4954, 1073746816, 5007, 1073746848,
5108, 1073746945, 5740, 1073747567, // NOLINT
5759, 1073747585, 5786, 1073747616,
5866, 1073747694, 5880, 1073747712, // NOLINT
5900, 1073747726, 5905, 1073747744,
5937, 1073747776, 5969, 1073747808, // NOLINT
5996, 1073747822, 6000, 1073747840,
6067, 6103, 6108, 1073748000, // NOLINT
6263, 1073748096, 6312, 6314,
1073748144, 6389, 1073748224, 6430, // NOLINT
1073748304, 6509, 1073748336, 6516,
1073748352, 6571, 1073748417, 6599, // NOLINT
1073748480, 6678, 1073748512, 6740,
6823, 1073748741, 6963, 1073748805, // NOLINT
6987, 1073748867, 7072, 1073748910,
7087, 1073748922, 7141, 1073748992, // NOLINT
7203, 1073749069, 7247, 1073749082,
7293, 1073749225, 7404, 1073749230, // NOLINT
7409, 1073749237, 7414, 1073749248,
7615, 1073749504, 7957, 1073749784, // NOLINT
7965, 1073749792, 8005, 1073749832,
8013, 1073749840, 8023, 8025, // NOLINT
8027, 8029, 1073749855, 8061,
1073749888, 8116, 1073749942, 8124, // NOLINT
8126, 1073749954, 8132, 1073749958,
8140, 1073749968, 8147, 1073749974, // NOLINT
8155, 1073749984, 8172, 1073750002,
8180, 1073750006, 8188}; // NOLINT
static const uint16_t kLetterTable1Size = 87;
static const int32_t kLetterTable1[87] = {
113, 127, 1073741968, 156,
258, 263, 1073742090, 275, // NOLINT
277, 1073742105, 285, 292,
294, 296, 1073742122, 301, // NOLINT
1073742127, 313, 1073742140, 319,
1073742149, 329, 334, 1073742176, // NOLINT
392, 1073744896, 3118, 1073744944,
3166, 1073744992, 3300, 1073745131, // NOLINT
3310, 1073745138, 3315, 1073745152,
3365, 3367, 3373, 1073745200, // NOLINT
3431, 3439, 1073745280, 3478,
1073745312, 3494, 1073745320, 3502, // NOLINT
1073745328, 3510, 1073745336, 3518,
1073745344, 3526, 1073745352, 3534, // NOLINT
1073745360, 3542, 1073745368, 3550,
3631, 1073745925, 4103, 1073745953, // NOLINT
4137, 1073745969, 4149, 1073745976,
4156, 1073745985, 4246, 1073746077, // NOLINT
4255, 1073746081, 4346, 1073746172,
4351, 1073746181, 4397, 1073746225, // NOLINT
4494, 1073746336, 4538, 1073746416,
4607, 1073746944, 8191}; // NOLINT
static const uint16_t kLetterTable2Size = 4;
static const int32_t kLetterTable2[4] = {1073741824, 3509, 1073745408,
8191}; // NOLINT
static const uint16_t kLetterTable3Size = 2;
static const int32_t kLetterTable3[2] = {1073741824, 8191}; // NOLINT
static const uint16_t kLetterTable4Size = 2;
static const int32_t kLetterTable4[2] = {1073741824, 8140}; // NOLINT
static const uint16_t kLetterTable5Size = 100;
static const int32_t kLetterTable5[100] = {
1073741824, 1164, 1073743056, 1277,
1073743104, 1548, 1073743376, 1567, // NOLINT
1073743402, 1579, 1073743424, 1646,
1073743487, 1693, 1073743520, 1775, // NOLINT
1073743639, 1823, 1073743650, 1928,
1073743755, 1934, 1073743760, 1965, // NOLINT
1073743792, 1969, 1073743863, 2049,
1073743875, 2053, 1073743879, 2058, // NOLINT
1073743884, 2082, 1073743936, 2163,
1073744002, 2227, 1073744114, 2295, // NOLINT
2299, 1073744138, 2341, 1073744176,
2374, 1073744224, 2428, 1073744260, // NOLINT
2482, 2511, 1073744352, 2532,
1073744358, 2543, 1073744378, 2558, // NOLINT
1073744384, 2600, 1073744448, 2626,
1073744452, 2635, 1073744480, 2678, // NOLINT
2682, 1073744510, 2735, 2737,
1073744565, 2742, 1073744569, 2749, // NOLINT
2752, 2754, 1073744603, 2781,
1073744608, 2794, 1073744626, 2804, // NOLINT
1073744641, 2822, 1073744649, 2830,
1073744657, 2838, 1073744672, 2854, // NOLINT
1073744680, 2862, 1073744688, 2906,
1073744732, 2911, 1073744740, 2917, // NOLINT
1073744832, 3042, 1073744896, 8191}; // NOLINT
static const uint16_t kLetterTable6Size = 6;
static const int32_t kLetterTable6[6] = {1073741824, 6051, 1073747888, 6086,
1073747915, 6139}; // NOLINT
static const uint16_t kLetterTable7Size = 48;
static const int32_t kLetterTable7[48] = {
1073748224, 6765, 1073748592, 6873,
1073748736, 6918, 1073748755, 6935, // NOLINT
6941, 1073748767, 6952, 1073748778,
6966, 1073748792, 6972, 6974, // NOLINT
1073748800, 6977, 1073748803, 6980,
1073748806, 7089, 1073748947, 7485, // NOLINT
1073749328, 7567, 1073749394, 7623,
1073749488, 7675, 1073749616, 7796, // NOLINT
1073749622, 7932, 1073749793, 7994,
1073749825, 8026, 1073749862, 8126, // NOLINT
1073749954, 8135, 1073749962, 8143,
1073749970, 8151, 1073749978, 8156}; // NOLINT
bool Letter::Is(uchar c) {
int chunk_index = c >> 13;
switch (chunk_index) {
case 0:
return LookupPredicate(kLetterTable0, kLetterTable0Size, c);
case 1:
return LookupPredicate(kLetterTable1, kLetterTable1Size, c);
case 2:
return LookupPredicate(kLetterTable2, kLetterTable2Size, c);
case 3:
return LookupPredicate(kLetterTable3, kLetterTable3Size, c);
case 4:
return LookupPredicate(kLetterTable4, kLetterTable4Size, c);
case 5:
return LookupPredicate(kLetterTable5, kLetterTable5Size, c);
case 6:
return LookupPredicate(kLetterTable6, kLetterTable6Size, c);
case 7:
return LookupPredicate(kLetterTable7, kLetterTable7Size, c);
default:
return false;
}
}
#endif
#ifndef V8_INTL_SUPPORT
// ID_Start: ((point.category in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo',
// 'Nl'] or 'Other_ID_Start' in point.properties) and ('Pattern_Syntax' not in
// point.properties) and ('Pattern_White_Space' not in point.properties)) or
// ('JS_ID_Start' in point.properties)
static const uint16_t kID_StartTable0Size = 434;
static const int32_t kID_StartTable0[434] = {
36, 1073741889, 90, 92,
95, 1073741921, 122, 170, // NOLINT
181, 186, 1073742016, 214,
1073742040, 246, 1073742072, 705, // NOLINT
1073742534, 721, 1073742560, 740,
748, 750, 1073742704, 884, // NOLINT
1073742710, 887, 1073742714, 893,
895, 902, 1073742728, 906, // NOLINT
908, 1073742734, 929, 1073742755,
1013, 1073742839, 1153, 1073742986, // NOLINT
1327, 1073743153, 1366, 1369,
1073743201, 1415, 1073743312, 1514, // NOLINT
1073743344, 1522, 1073743392, 1610,
1073743470, 1647, 1073743473, 1747, // NOLINT
1749, 1073743589, 1766, 1073743598,
1775, 1073743610, 1788, 1791, // NOLINT
1808, 1073743634, 1839, 1073743693,
1957, 1969, 1073743818, 2026, // NOLINT
1073743860, 2037, 2042, 1073743872,
2069, 2074, 2084, 2088, // NOLINT
1073743936, 2136, 1073744032, 2226,
1073744132, 2361, 2365, 2384, // NOLINT
1073744216, 2401, 1073744241, 2432,
1073744261, 2444, 1073744271, 2448, // NOLINT
1073744275, 2472, 1073744298, 2480,
2482, 1073744310, 2489, 2493, // NOLINT
2510, 1073744348, 2525, 1073744351,
2529, 1073744368, 2545, 1073744389, // NOLINT
2570, 1073744399, 2576, 1073744403,
2600, 1073744426, 2608, 1073744434, // NOLINT
2611, 1073744437, 2614, 1073744440,
2617, 1073744473, 2652, 2654, // NOLINT
1073744498, 2676, 1073744517, 2701,
1073744527, 2705, 1073744531, 2728, // NOLINT
1073744554, 2736, 1073744562, 2739,
1073744565, 2745, 2749, 2768, // NOLINT
1073744608, 2785, 1073744645, 2828,
1073744655, 2832, 1073744659, 2856, // NOLINT
1073744682, 2864, 1073744690, 2867,
1073744693, 2873, 2877, 1073744732, // NOLINT
2909, 1073744735, 2913, 2929,
2947, 1073744773, 2954, 1073744782, // NOLINT
2960, 1073744786, 2965, 1073744793,
2970, 2972, 1073744798, 2975, // NOLINT
1073744803, 2980, 1073744808, 2986,
1073744814, 3001, 3024, 1073744901, // NOLINT
3084, 1073744910, 3088, 1073744914,
3112, 1073744938, 3129, 3133, // NOLINT
1073744984, 3161, 1073744992, 3169,
1073745029, 3212, 1073745038, 3216, // NOLINT
1073745042, 3240, 1073745066, 3251,
1073745077, 3257, 3261, 3294, // NOLINT
1073745120, 3297, 1073745137, 3314,
1073745157, 3340, 1073745166, 3344, // NOLINT
1073745170, 3386, 3389, 3406,
1073745248, 3425, 1073745274, 3455, // NOLINT
1073745285, 3478, 1073745306, 3505,
1073745331, 3515, 3517, 1073745344, // NOLINT
3526, 1073745409, 3632, 1073745458,
3635, 1073745472, 3654, 1073745537, // NOLINT
3714, 3716, 1073745543, 3720,
3722, 3725, 1073745556, 3735, // NOLINT
1073745561, 3743, 1073745569, 3747,
3749, 3751, 1073745578, 3755, // NOLINT
1073745581, 3760, 1073745586, 3763,
3773, 1073745600, 3780, 3782, // NOLINT
1073745628, 3807, 3840, 1073745728,
3911, 1073745737, 3948, 1073745800, // NOLINT
3980, 1073745920, 4138, 4159,
1073746000, 4181, 1073746010, 4189, // NOLINT
4193, 1073746021, 4198, 1073746030,
4208, 1073746037, 4225, 4238, // NOLINT
1073746080, 4293, 4295, 4301,
1073746128, 4346, 1073746172, 4680, // NOLINT
1073746506, 4685, 1073746512, 4694,
4696, 1073746522, 4701, 1073746528, // NOLINT
4744, 1073746570, 4749, 1073746576,
4784, 1073746610, 4789, 1073746616, // NOLINT
4798, 4800, 1073746626, 4805,
1073746632, 4822, 1073746648, 4880, // NOLINT
1073746706, 4885, 1073746712, 4954,
1073746816, 5007, 1073746848, 5108, // NOLINT
1073746945, 5740, 1073747567, 5759,
1073747585, 5786, 1073747616, 5866, // NOLINT
1073747694, 5880, 1073747712, 5900,
1073747726, 5905, 1073747744, 5937, // NOLINT
1073747776, 5969, 1073747808, 5996,
1073747822, 6000, 1073747840, 6067, // NOLINT
6103, 6108, 1073748000, 6263,
1073748096, 6312, 6314, 1073748144, // NOLINT
6389, 1073748224, 6430, 1073748304,
6509, 1073748336, 6516, 1073748352, // NOLINT
6571, 1073748417, 6599, 1073748480,
6678, 1073748512, 6740, 6823, // NOLINT
1073748741, 6963, 1073748805, 6987,
1073748867, 7072, 1073748910, 7087, // NOLINT
1073748922, 7141, 1073748992, 7203,
1073749069, 7247, 1073749082, 7293, // NOLINT
1073749225, 7404, 1073749230, 7409,
1073749237, 7414, 1073749248, 7615, // NOLINT
1073749504, 7957, 1073749784, 7965,
1073749792, 8005, 1073749832, 8013, // NOLINT
1073749840, 8023, 8025, 8027,
8029, 1073749855, 8061, 1073749888, // NOLINT
8116, 1073749942, 8124, 8126,
1073749954, 8132, 1073749958, 8140, // NOLINT
1073749968, 8147, 1073749974, 8155,
1073749984, 8172, 1073750002, 8180, // NOLINT
1073750006, 8188}; // NOLINT
static const uint16_t kID_StartTable1Size = 84;
static const int32_t kID_StartTable1[84] = {
113, 127, 1073741968, 156,
258, 263, 1073742090, 275, // NOLINT
277, 1073742104, 285, 292,
294, 296, 1073742122, 313, // NOLINT
1073742140, 319, 1073742149, 329,
334, 1073742176, 392, 1073744896, // NOLINT
3118, 1073744944, 3166, 1073744992,
3300, 1073745131, 3310, 1073745138, // NOLINT
3315, 1073745152, 3365, 3367,
3373, 1073745200, 3431, 3439, // NOLINT
1073745280, 3478, 1073745312, 3494,
1073745320, 3502, 1073745328, 3510, // NOLINT
1073745336, 3518, 1073745344, 3526,
1073745352, 3534, 1073745360, 3542, // NOLINT
1073745368, 3550, 1073745925, 4103,
1073745953, 4137, 1073745969, 4149, // NOLINT
1073745976, 4156, 1073745985, 4246,
1073746075, 4255, 1073746081, 4346, // NOLINT
1073746172, 4351, 1073746181, 4397,
1073746225, 4494, 1073746336, 4538, // NOLINT
1073746416, 4607, 1073746944, 8191}; // NOLINT
static const uint16_t kID_StartTable2Size = 4;
static const int32_t kID_StartTable2[4] = {1073741824, 3509, 1073745408,
8191}; // NOLINT
static const uint16_t kID_StartTable3Size = 2;
static const int32_t kID_StartTable3[2] = {1073741824, 8191}; // NOLINT
static const uint16_t kID_StartTable4Size = 2;
static const int32_t kID_StartTable4[2] = {1073741824, 8140}; // NOLINT
static const uint16_t kID_StartTable5Size = 100;
static const int32_t kID_StartTable5[100] = {
1073741824, 1164, 1073743056, 1277,
1073743104, 1548, 1073743376, 1567, // NOLINT
1073743402, 1579, 1073743424, 1646,
1073743487, 1693, 1073743520, 1775, // NOLINT
1073743639, 1823, 1073743650, 1928,
1073743755, 1934, 1073743760, 1965, // NOLINT
1073743792, 1969, 1073743863, 2049,
1073743875, 2053, 1073743879, 2058, // NOLINT
1073743884, 2082, 1073743936, 2163,
1073744002, 2227, 1073744114, 2295, // NOLINT
2299, 1073744138, 2341, 1073744176,
2374, 1073744224, 2428, 1073744260, // NOLINT
2482, 2511, 1073744352, 2532,
1073744358, 2543, 1073744378, 2558, // NOLINT
1073744384, 2600, 1073744448, 2626,
1073744452, 2635, 1073744480, 2678, // NOLINT
2682, 1073744510, 2735, 2737,
1073744565, 2742, 1073744569, 2749, // NOLINT
2752, 2754, 1073744603, 2781,
1073744608, 2794, 1073744626, 2804, // NOLINT
1073744641, 2822, 1073744649, 2830,
1073744657, 2838, 1073744672, 2854, // NOLINT
1073744680, 2862, 1073744688, 2906,
1073744732, 2911, 1073744740, 2917, // NOLINT
1073744832, 3042, 1073744896, 8191}; // NOLINT
static const uint16_t kID_StartTable6Size = 6;
static const int32_t kID_StartTable6[6] = {1073741824, 6051, 1073747888, 6086,
1073747915, 6139}; // NOLINT
static const uint16_t kID_StartTable7Size = 48;
static const int32_t kID_StartTable7[48] = {
1073748224, 6765, 1073748592, 6873,
1073748736, 6918, 1073748755, 6935, // NOLINT
6941, 1073748767, 6952, 1073748778,
6966, 1073748792, 6972, 6974, // NOLINT
1073748800, 6977, 1073748803, 6980,
1073748806, 7089, 1073748947, 7485, // NOLINT
1073749328, 7567, 1073749394, 7623,
1073749488, 7675, 1073749616, 7796, // NOLINT
1073749622, 7932, 1073749793, 7994,
1073749825, 8026, 1073749862, 8126, // NOLINT
1073749954, 8135, 1073749962, 8143,
1073749970, 8151, 1073749978, 8156}; // NOLINT
bool ID_Start::Is(uchar c) {
int chunk_index = c >> 13;
switch (chunk_index) {
case 0:
return LookupPredicate(kID_StartTable0, kID_StartTable0Size, c);
case 1:
return LookupPredicate(kID_StartTable1, kID_StartTable1Size, c);
case 2:
return LookupPredicate(kID_StartTable2, kID_StartTable2Size, c);
case 3:
return LookupPredicate(kID_StartTable3, kID_StartTable3Size, c);
case 4:
return LookupPredicate(kID_StartTable4, kID_StartTable4Size, c);
case 5:
return LookupPredicate(kID_StartTable5, kID_StartTable5Size, c);
case 6:
return LookupPredicate(kID_StartTable6, kID_StartTable6Size, c);
case 7:
return LookupPredicate(kID_StartTable7, kID_StartTable7Size, c);
default:
return false;
}
}
// ID_Continue: point.category in ['Nd', 'Mn', 'Mc', 'Pc'] or
// 'Other_ID_Continue' in point.properties or 'JS_ID_Continue' in
// point.properties
static const uint16_t kID_ContinueTable0Size = 315;
static const int32_t kID_ContinueTable0[315] = {
1073741872, 57, 95, 183,
1073742592, 879, 903, 1073742979, // NOLINT
1159, 1073743249, 1469, 1471,
1073743297, 1474, 1073743300, 1477, // NOLINT
1479, 1073743376, 1562, 1073743435,
1641, 1648, 1073743574, 1756, // NOLINT
1073743583, 1764, 1073743591, 1768,
1073743594, 1773, 1073743600, 1785, // NOLINT
1809, 1073743664, 1866, 1073743782,
1968, 1073743808, 1993, 1073743851, // NOLINT
2035, 1073743894, 2073, 1073743899,
2083, 1073743909, 2087, 1073743913, // NOLINT
2093, 1073743961, 2139, 1073744100,
2307, 1073744186, 2364, 1073744190, // NOLINT
2383, 1073744209, 2391, 1073744226,
2403, 1073744230, 2415, 1073744257, // NOLINT
2435, 2492, 1073744318, 2500,
1073744327, 2504, 1073744331, 2509, // NOLINT
2519, 1073744354, 2531, 1073744358,
2543, 1073744385, 2563, 2620, // NOLINT
1073744446, 2626, 1073744455, 2632,
1073744459, 2637, 2641, 1073744486, // NOLINT
2673, 2677, 1073744513, 2691,
2748, 1073744574, 2757, 1073744583, // NOLINT
2761, 1073744587, 2765, 1073744610,
2787, 1073744614, 2799, 1073744641, // NOLINT
2819, 2876, 1073744702, 2884,
1073744711, 2888, 1073744715, 2893, // NOLINT
1073744726, 2903, 1073744738, 2915,
1073744742, 2927, 2946, 1073744830, // NOLINT
3010, 1073744838, 3016, 1073744842,
3021, 3031, 1073744870, 3055, // NOLINT
1073744896, 3075, 1073744958, 3140,
1073744966, 3144, 1073744970, 3149, // NOLINT
1073744981, 3158, 1073744994, 3171,
1073744998, 3183, 1073745025, 3203, // NOLINT
3260, 1073745086, 3268, 1073745094,
3272, 1073745098, 3277, 1073745109, // NOLINT
3286, 1073745122, 3299, 1073745126,
3311, 1073745153, 3331, 1073745214, // NOLINT
3396, 1073745222, 3400, 1073745226,
3405, 3415, 1073745250, 3427, // NOLINT
1073745254, 3439, 1073745282, 3459,
3530, 1073745359, 3540, 3542, // NOLINT
1073745368, 3551, 1073745382, 3567,
1073745394, 3571, 3633, 1073745460, // NOLINT
3642, 1073745479, 3662, 1073745488,
3673, 3761, 1073745588, 3769, // NOLINT
1073745595, 3772, 1073745608, 3789,
1073745616, 3801, 1073745688, 3865, // NOLINT
1073745696, 3881, 3893, 3895,
3897, 1073745726, 3903, 1073745777, // NOLINT
3972, 1073745798, 3975, 1073745805,
3991, 1073745817, 4028, 4038, // NOLINT
1073745963, 4158, 1073745984, 4169,
1073746006, 4185, 1073746014, 4192, // NOLINT
1073746018, 4196, 1073746023, 4205,
1073746033, 4212, 1073746050, 4237, // NOLINT
1073746063, 4253, 1073746781, 4959,
1073746793, 4977, 1073747730, 5908, // NOLINT
1073747762, 5940, 1073747794, 5971,
1073747826, 6003, 1073747892, 6099, // NOLINT
6109, 1073747936, 6121, 1073747979,
6157, 1073747984, 6169, 6313, // NOLINT
1073748256, 6443, 1073748272, 6459,
1073748294, 6479, 1073748400, 6592, // NOLINT
1073748424, 6601, 1073748432, 6618,
1073748503, 6683, 1073748565, 6750, // NOLINT
1073748576, 6780, 1073748607, 6793,
1073748624, 6809, 1073748656, 6845, // NOLINT
1073748736, 6916, 1073748788, 6980,
1073748816, 7001, 1073748843, 7027, // NOLINT
1073748864, 7042, 1073748897, 7085,
1073748912, 7097, 1073748966, 7155, // NOLINT
1073749028, 7223, 1073749056, 7241,
1073749072, 7257, 1073749200, 7378, // NOLINT
1073749204, 7400, 7405, 1073749234,
7412, 1073749240, 7417, 1073749440, // NOLINT
7669, 1073749500, 7679}; // NOLINT
static const uint16_t kID_ContinueTable1Size = 19;
static const int32_t kID_ContinueTable1[19] = {
1073741836, 13, 1073741887, 64,
84, 1073742032, 220, 225, // NOLINT
1073742053, 240, 1073745135, 3313,
3455, 1073745376, 3583, 1073745962, // NOLINT
4143, 1073746073, 4250}; // NOLINT
static const uint16_t kID_ContinueTable5Size = 63;
static const int32_t kID_ContinueTable5[63] = {
1073743392, 1577, 1647, 1073743476,
1661, 1695, 1073743600, 1777, // NOLINT
2050, 2054, 2059, 1073743907,
2087, 1073744000, 2177, 1073744052, // NOLINT
2244, 1073744080, 2265, 1073744096,
2289, 1073744128, 2313, 1073744166, // NOLINT
2349, 1073744199, 2387, 1073744256,
2435, 1073744307, 2496, 1073744336, // NOLINT
2521, 2533, 1073744368, 2553,
1073744425, 2614, 2627, 1073744460, // NOLINT
2637, 1073744464, 2649, 1073744507,
2685, 2736, 1073744562, 2740, // NOLINT
1073744567, 2744, 1073744574, 2751,
2753, 1073744619, 2799, 1073744629, // NOLINT
2806, 1073744867, 3050, 1073744876,
3053, 1073744880, 3065}; // NOLINT
static const uint16_t kID_ContinueTable7Size = 12;
static const int32_t kID_ContinueTable7[12] = {
6942, 1073749504, 7695, 1073749536,
7725, 1073749555, 7732, 1073749581, // NOLINT
7759, 1073749776, 7961, 7999}; // NOLINT
bool ID_Continue::Is(uchar c) {
int chunk_index = c >> 13;
switch (chunk_index) {
case 0:
return LookupPredicate(kID_ContinueTable0, kID_ContinueTable0Size, c);
case 1:
return LookupPredicate(kID_ContinueTable1, kID_ContinueTable1Size, c);
case 5:
return LookupPredicate(kID_ContinueTable5, kID_ContinueTable5Size, c);
case 7:
return LookupPredicate(kID_ContinueTable7, kID_ContinueTable7Size, c);
default:
return false;
}
}
// WhiteSpace: (point.category == 'Zs') or ('JS_White_Space' in
// point.properties)
static const uint16_t kWhiteSpaceTable0Size = 6;
static const int32_t kWhiteSpaceTable0[6] = {9, 1073741835, 12,
32, 160, 5760}; // NOLINT
static const uint16_t kWhiteSpaceTable1Size = 5;
static const int32_t kWhiteSpaceTable1[5] = {1073741824, 10, 47, 95,
4096}; // NOLINT
static const uint16_t kWhiteSpaceTable7Size = 1;
static const int32_t kWhiteSpaceTable7[1] = {7935}; // NOLINT
bool WhiteSpace::Is(uchar c) {
int chunk_index = c >> 13;
switch (chunk_index) {
case 0:
return LookupPredicate(kWhiteSpaceTable0, kWhiteSpaceTable0Size, c);
case 1:
return LookupPredicate(kWhiteSpaceTable1, kWhiteSpaceTable1Size, c);
case 7:
return LookupPredicate(kWhiteSpaceTable7, kWhiteSpaceTable7Size, c);
default:
return false;
}
}
#endif // !V8_INTL_SUPPORT
#ifndef V8_INTL_SUPPORT
static const MultiCharacterSpecialCase<2> kToLowercaseMultiStrings0[2] =
{ // NOLINT