tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Script_-_Inherited.js (3220B)


      1 // Copyright 2025 Mathias Bynens. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 author: Mathias Bynens
      6 description: >
      7  Unicode property escapes for `Script=Inherited`
      8 info: |
      9  Generated by https://github.com/mathiasbynens/unicode-property-escapes-tests
     10  Unicode v17.0.0
     11 esid: sec-static-semantics-unicodematchproperty-p
     12 features: [regexp-unicode-property-escapes]
     13 includes: [regExpUtils.js]
     14 ---*/
     15 
     16 const matchSymbols = buildString({
     17  loneCodePoints: [
     18    0x000670,
     19    0x001CED,
     20    0x001CF4,
     21    0x0101FD,
     22    0x0102E0,
     23    0x01133B
     24  ],
     25  ranges: [
     26    [0x000300, 0x00036F],
     27    [0x000485, 0x000486],
     28    [0x00064B, 0x000655],
     29    [0x000951, 0x000954],
     30    [0x001AB0, 0x001ADD],
     31    [0x001AE0, 0x001AEB],
     32    [0x001CD0, 0x001CD2],
     33    [0x001CD4, 0x001CE0],
     34    [0x001CE2, 0x001CE8],
     35    [0x001CF8, 0x001CF9],
     36    [0x001DC0, 0x001DFF],
     37    [0x00200C, 0x00200D],
     38    [0x0020D0, 0x0020F0],
     39    [0x00302A, 0x00302D],
     40    [0x003099, 0x00309A],
     41    [0x00FE00, 0x00FE0F],
     42    [0x00FE20, 0x00FE2D],
     43    [0x01CF00, 0x01CF2D],
     44    [0x01CF30, 0x01CF46],
     45    [0x01D167, 0x01D169],
     46    [0x01D17B, 0x01D182],
     47    [0x01D185, 0x01D18B],
     48    [0x01D1AA, 0x01D1AD],
     49    [0x0E0100, 0x0E01EF]
     50  ]
     51 });
     52 testPropertyEscapes(
     53  /^\p{Script=Inherited}+$/u,
     54  matchSymbols,
     55  "\\p{Script=Inherited}"
     56 );
     57 testPropertyEscapes(
     58  /^\p{Script=Zinh}+$/u,
     59  matchSymbols,
     60  "\\p{Script=Zinh}"
     61 );
     62 testPropertyEscapes(
     63  /^\p{Script=Qaai}+$/u,
     64  matchSymbols,
     65  "\\p{Script=Qaai}"
     66 );
     67 testPropertyEscapes(
     68  /^\p{sc=Inherited}+$/u,
     69  matchSymbols,
     70  "\\p{sc=Inherited}"
     71 );
     72 testPropertyEscapes(
     73  /^\p{sc=Zinh}+$/u,
     74  matchSymbols,
     75  "\\p{sc=Zinh}"
     76 );
     77 testPropertyEscapes(
     78  /^\p{sc=Qaai}+$/u,
     79  matchSymbols,
     80  "\\p{sc=Qaai}"
     81 );
     82 
     83 const nonMatchSymbols = buildString({
     84  loneCodePoints: [
     85    0x001CD3,
     86    0x001CE1
     87  ],
     88  ranges: [
     89    [0x00DC00, 0x00DFFF],
     90    [0x000000, 0x0002FF],
     91    [0x000370, 0x000484],
     92    [0x000487, 0x00064A],
     93    [0x000656, 0x00066F],
     94    [0x000671, 0x000950],
     95    [0x000955, 0x001AAF],
     96    [0x001ADE, 0x001ADF],
     97    [0x001AEC, 0x001CCF],
     98    [0x001CE9, 0x001CEC],
     99    [0x001CEE, 0x001CF3],
    100    [0x001CF5, 0x001CF7],
    101    [0x001CFA, 0x001DBF],
    102    [0x001E00, 0x00200B],
    103    [0x00200E, 0x0020CF],
    104    [0x0020F1, 0x003029],
    105    [0x00302E, 0x003098],
    106    [0x00309B, 0x00DBFF],
    107    [0x00E000, 0x00FDFF],
    108    [0x00FE10, 0x00FE1F],
    109    [0x00FE2E, 0x0101FC],
    110    [0x0101FE, 0x0102DF],
    111    [0x0102E1, 0x01133A],
    112    [0x01133C, 0x01CEFF],
    113    [0x01CF2E, 0x01CF2F],
    114    [0x01CF47, 0x01D166],
    115    [0x01D16A, 0x01D17A],
    116    [0x01D183, 0x01D184],
    117    [0x01D18C, 0x01D1A9],
    118    [0x01D1AE, 0x0E00FF],
    119    [0x0E01F0, 0x10FFFF]
    120  ]
    121 });
    122 testPropertyEscapes(
    123  /^\P{Script=Inherited}+$/u,
    124  nonMatchSymbols,
    125  "\\P{Script=Inherited}"
    126 );
    127 testPropertyEscapes(
    128  /^\P{Script=Zinh}+$/u,
    129  nonMatchSymbols,
    130  "\\P{Script=Zinh}"
    131 );
    132 testPropertyEscapes(
    133  /^\P{Script=Qaai}+$/u,
    134  nonMatchSymbols,
    135  "\\P{Script=Qaai}"
    136 );
    137 testPropertyEscapes(
    138  /^\P{sc=Inherited}+$/u,
    139  nonMatchSymbols,
    140  "\\P{sc=Inherited}"
    141 );
    142 testPropertyEscapes(
    143  /^\P{sc=Zinh}+$/u,
    144  nonMatchSymbols,
    145  "\\P{sc=Zinh}"
    146 );
    147 testPropertyEscapes(
    148  /^\P{sc=Qaai}+$/u,
    149  nonMatchSymbols,
    150  "\\P{sc=Qaai}"
    151 );
    152 
    153 reportCompare(0, 0);