tor-browser

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

Script_-_Cyrillic.js (1895B)


      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=Cyrillic`
      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    0x001D2B,
     19    0x001D78,
     20    0x01E08F
     21  ],
     22  ranges: [
     23    [0x000400, 0x000484],
     24    [0x000487, 0x00052F],
     25    [0x001C80, 0x001C8A],
     26    [0x002DE0, 0x002DFF],
     27    [0x00A640, 0x00A69F],
     28    [0x00FE2E, 0x00FE2F],
     29    [0x01E030, 0x01E06D]
     30  ]
     31 });
     32 testPropertyEscapes(
     33  /^\p{Script=Cyrillic}+$/u,
     34  matchSymbols,
     35  "\\p{Script=Cyrillic}"
     36 );
     37 testPropertyEscapes(
     38  /^\p{Script=Cyrl}+$/u,
     39  matchSymbols,
     40  "\\p{Script=Cyrl}"
     41 );
     42 testPropertyEscapes(
     43  /^\p{sc=Cyrillic}+$/u,
     44  matchSymbols,
     45  "\\p{sc=Cyrillic}"
     46 );
     47 testPropertyEscapes(
     48  /^\p{sc=Cyrl}+$/u,
     49  matchSymbols,
     50  "\\p{sc=Cyrl}"
     51 );
     52 
     53 const nonMatchSymbols = buildString({
     54  loneCodePoints: [],
     55  ranges: [
     56    [0x00DC00, 0x00DFFF],
     57    [0x000000, 0x0003FF],
     58    [0x000485, 0x000486],
     59    [0x000530, 0x001C7F],
     60    [0x001C8B, 0x001D2A],
     61    [0x001D2C, 0x001D77],
     62    [0x001D79, 0x002DDF],
     63    [0x002E00, 0x00A63F],
     64    [0x00A6A0, 0x00DBFF],
     65    [0x00E000, 0x00FE2D],
     66    [0x00FE30, 0x01E02F],
     67    [0x01E06E, 0x01E08E],
     68    [0x01E090, 0x10FFFF]
     69  ]
     70 });
     71 testPropertyEscapes(
     72  /^\P{Script=Cyrillic}+$/u,
     73  nonMatchSymbols,
     74  "\\P{Script=Cyrillic}"
     75 );
     76 testPropertyEscapes(
     77  /^\P{Script=Cyrl}+$/u,
     78  nonMatchSymbols,
     79  "\\P{Script=Cyrl}"
     80 );
     81 testPropertyEscapes(
     82  /^\P{sc=Cyrillic}+$/u,
     83  nonMatchSymbols,
     84  "\\P{sc=Cyrillic}"
     85 );
     86 testPropertyEscapes(
     87  /^\P{sc=Cyrl}+$/u,
     88  nonMatchSymbols,
     89  "\\P{sc=Cyrl}"
     90 );
     91 
     92 reportCompare(0, 0);