tor-browser

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

Script_-_Devanagari.js (1687B)


      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=Devanagari`
      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  ranges: [
     19    [0x000900, 0x000950],
     20    [0x000955, 0x000963],
     21    [0x000966, 0x00097F],
     22    [0x00A8E0, 0x00A8FF],
     23    [0x011B00, 0x011B09]
     24  ]
     25 });
     26 testPropertyEscapes(
     27  /^\p{Script=Devanagari}+$/u,
     28  matchSymbols,
     29  "\\p{Script=Devanagari}"
     30 );
     31 testPropertyEscapes(
     32  /^\p{Script=Deva}+$/u,
     33  matchSymbols,
     34  "\\p{Script=Deva}"
     35 );
     36 testPropertyEscapes(
     37  /^\p{sc=Devanagari}+$/u,
     38  matchSymbols,
     39  "\\p{sc=Devanagari}"
     40 );
     41 testPropertyEscapes(
     42  /^\p{sc=Deva}+$/u,
     43  matchSymbols,
     44  "\\p{sc=Deva}"
     45 );
     46 
     47 const nonMatchSymbols = buildString({
     48  loneCodePoints: [],
     49  ranges: [
     50    [0x00DC00, 0x00DFFF],
     51    [0x000000, 0x0008FF],
     52    [0x000951, 0x000954],
     53    [0x000964, 0x000965],
     54    [0x000980, 0x00A8DF],
     55    [0x00A900, 0x00DBFF],
     56    [0x00E000, 0x011AFF],
     57    [0x011B0A, 0x10FFFF]
     58  ]
     59 });
     60 testPropertyEscapes(
     61  /^\P{Script=Devanagari}+$/u,
     62  nonMatchSymbols,
     63  "\\P{Script=Devanagari}"
     64 );
     65 testPropertyEscapes(
     66  /^\P{Script=Deva}+$/u,
     67  nonMatchSymbols,
     68  "\\P{Script=Deva}"
     69 );
     70 testPropertyEscapes(
     71  /^\P{sc=Devanagari}+$/u,
     72  nonMatchSymbols,
     73  "\\P{sc=Devanagari}"
     74 );
     75 testPropertyEscapes(
     76  /^\P{sc=Deva}+$/u,
     77  nonMatchSymbols,
     78  "\\P{sc=Deva}"
     79 );
     80 
     81 reportCompare(0, 0);