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