tor-browser

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

Script_-_Latin.js (3102B)


      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=Latin`
      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    0x0000AA,
     19    0x0000BA,
     20    0x002071,
     21    0x00207F,
     22    0x002132,
     23    0x00214E
     24  ],
     25  ranges: [
     26    [0x000041, 0x00005A],
     27    [0x000061, 0x00007A],
     28    [0x0000C0, 0x0000D6],
     29    [0x0000D8, 0x0000F6],
     30    [0x0000F8, 0x0002B8],
     31    [0x0002E0, 0x0002E4],
     32    [0x001D00, 0x001D25],
     33    [0x001D2C, 0x001D5C],
     34    [0x001D62, 0x001D65],
     35    [0x001D6B, 0x001D77],
     36    [0x001D79, 0x001DBE],
     37    [0x001E00, 0x001EFF],
     38    [0x002090, 0x00209C],
     39    [0x00212A, 0x00212B],
     40    [0x002160, 0x002188],
     41    [0x002C60, 0x002C7F],
     42    [0x00A722, 0x00A787],
     43    [0x00A78B, 0x00A7DC],
     44    [0x00A7F1, 0x00A7FF],
     45    [0x00AB30, 0x00AB5A],
     46    [0x00AB5C, 0x00AB64],
     47    [0x00AB66, 0x00AB69],
     48    [0x00FB00, 0x00FB06],
     49    [0x00FF21, 0x00FF3A],
     50    [0x00FF41, 0x00FF5A],
     51    [0x010780, 0x010785],
     52    [0x010787, 0x0107B0],
     53    [0x0107B2, 0x0107BA],
     54    [0x01DF00, 0x01DF1E],
     55    [0x01DF25, 0x01DF2A]
     56  ]
     57 });
     58 testPropertyEscapes(
     59  /^\p{Script=Latin}+$/u,
     60  matchSymbols,
     61  "\\p{Script=Latin}"
     62 );
     63 testPropertyEscapes(
     64  /^\p{Script=Latn}+$/u,
     65  matchSymbols,
     66  "\\p{Script=Latn}"
     67 );
     68 testPropertyEscapes(
     69  /^\p{sc=Latin}+$/u,
     70  matchSymbols,
     71  "\\p{sc=Latin}"
     72 );
     73 testPropertyEscapes(
     74  /^\p{sc=Latn}+$/u,
     75  matchSymbols,
     76  "\\p{sc=Latn}"
     77 );
     78 
     79 const nonMatchSymbols = buildString({
     80  loneCodePoints: [
     81    0x0000D7,
     82    0x0000F7,
     83    0x001D78,
     84    0x00AB5B,
     85    0x00AB65,
     86    0x010786,
     87    0x0107B1
     88  ],
     89  ranges: [
     90    [0x00DC00, 0x00DFFF],
     91    [0x000000, 0x000040],
     92    [0x00005B, 0x000060],
     93    [0x00007B, 0x0000A9],
     94    [0x0000AB, 0x0000B9],
     95    [0x0000BB, 0x0000BF],
     96    [0x0002B9, 0x0002DF],
     97    [0x0002E5, 0x001CFF],
     98    [0x001D26, 0x001D2B],
     99    [0x001D5D, 0x001D61],
    100    [0x001D66, 0x001D6A],
    101    [0x001DBF, 0x001DFF],
    102    [0x001F00, 0x002070],
    103    [0x002072, 0x00207E],
    104    [0x002080, 0x00208F],
    105    [0x00209D, 0x002129],
    106    [0x00212C, 0x002131],
    107    [0x002133, 0x00214D],
    108    [0x00214F, 0x00215F],
    109    [0x002189, 0x002C5F],
    110    [0x002C80, 0x00A721],
    111    [0x00A788, 0x00A78A],
    112    [0x00A7DD, 0x00A7F0],
    113    [0x00A800, 0x00AB2F],
    114    [0x00AB6A, 0x00DBFF],
    115    [0x00E000, 0x00FAFF],
    116    [0x00FB07, 0x00FF20],
    117    [0x00FF3B, 0x00FF40],
    118    [0x00FF5B, 0x01077F],
    119    [0x0107BB, 0x01DEFF],
    120    [0x01DF1F, 0x01DF24],
    121    [0x01DF2B, 0x10FFFF]
    122  ]
    123 });
    124 testPropertyEscapes(
    125  /^\P{Script=Latin}+$/u,
    126  nonMatchSymbols,
    127  "\\P{Script=Latin}"
    128 );
    129 testPropertyEscapes(
    130  /^\P{Script=Latn}+$/u,
    131  nonMatchSymbols,
    132  "\\P{Script=Latn}"
    133 );
    134 testPropertyEscapes(
    135  /^\P{sc=Latin}+$/u,
    136  nonMatchSymbols,
    137  "\\P{sc=Latin}"
    138 );
    139 testPropertyEscapes(
    140  /^\P{sc=Latn}+$/u,
    141  nonMatchSymbols,
    142  "\\P{sc=Latn}"
    143 );
    144 
    145 reportCompare(0, 0);