| 1 |
// Copyright 2017 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 `Pattern_Syntax` |
| 8 |
info: | |
| 9 |
Generated by https://github.com/mathiasbynens/unicode-property-escapes-tests |
| 10 |
Unicode v10.0.0 |
| 11 |
Emoji v5.0 (UTR51) |
| 12 |
esid: sec-static-semantics-unicodematchproperty-p |
| 13 |
features: [regexp-unicode-property-escapes] |
| 14 |
includes: [regExpUtils.js] |
| 15 |
---*/ |
| 16 |
|
| 17 |
const matchSymbols = buildString({ |
| 18 |
loneCodePoints: [ |
| 19 |
0x000060, |
| 20 |
0x0000A9, |
| 21 |
0x0000AE, |
| 22 |
0x0000B6, |
| 23 |
0x0000BB, |
| 24 |
0x0000BF, |
| 25 |
0x0000D7, |
| 26 |
0x0000F7, |
| 27 |
0x003030 |
| 28 |
], |
| 29 |
ranges: [ |
| 30 |
[0x000021, 0x00002F], |
| 31 |
[0x00003A, 0x000040], |
| 32 |
[0x00005B, 0x00005E], |
| 33 |
[0x00007B, 0x00007E], |
| 34 |
[0x0000A1, 0x0000A7], |
| 35 |
[0x0000AB, 0x0000AC], |
| 36 |
[0x0000B0, 0x0000B1], |
| 37 |
[0x002010, 0x002027], |
| 38 |
[0x002030, 0x00203E], |
| 39 |
[0x002041, 0x002053], |
| 40 |
[0x002055, 0x00205E], |
| 41 |
[0x002190, 0x00245F], |
| 42 |
[0x002500, 0x002775], |
| 43 |
[0x002794, 0x002BFF], |
| 44 |
[0x002E00, 0x002E7F], |
| 45 |
[0x003001, 0x003003], |
| 46 |
[0x003008, 0x003020], |
| 47 |
[0x00FD3E, 0x00FD3F], |
| 48 |
[0x00FE45, 0x00FE46] |
| 49 |
] |
| 50 |
}); |
| 51 |
testPropertyEscapes( |
| 52 |
/^\p{Pattern_Syntax}+$/u, |
| 53 |
matchSymbols, |
| 54 |
"\\p{Pattern_Syntax}" |
| 55 |
); |
| 56 |
testPropertyEscapes( |
| 57 |
/^\p{Pat_Syn}+$/u, |
| 58 |
matchSymbols, |
| 59 |
"\\p{Pat_Syn}" |
| 60 |
); |
| 61 |
|
| 62 |
const nonMatchSymbols = buildString({ |
| 63 |
loneCodePoints: [ |
| 64 |
0x00005F, |
| 65 |
0x0000A8, |
| 66 |
0x0000AA, |
| 67 |
0x0000AD, |
| 68 |
0x0000AF, |
| 69 |
0x002054 |
| 70 |
], |
| 71 |
ranges: [ |
| 72 |
[0x00DC00, 0x00DFFF], |
| 73 |
[0x000000, 0x000020], |
| 74 |
[0x000030, 0x000039], |
| 75 |
[0x000041, 0x00005A], |
| 76 |
[0x000061, 0x00007A], |
| 77 |
[0x00007F, 0x0000A0], |
| 78 |
[0x0000B2, 0x0000B5], |
| 79 |
[0x0000B7, 0x0000BA], |
| 80 |
[0x0000BC, 0x0000BE], |
| 81 |
[0x0000C0, 0x0000D6], |
| 82 |
[0x0000D8, 0x0000F6], |
| 83 |
[0x0000F8, 0x00200F], |
| 84 |
[0x002028, 0x00202F], |
| 85 |
[0x00203F, 0x002040], |
| 86 |
[0x00205F, 0x00218F], |
| 87 |
[0x002460, 0x0024FF], |
| 88 |
[0x002776, 0x002793], |
| 89 |
[0x002C00, 0x002DFF], |
| 90 |
[0x002E80, 0x003000], |
| 91 |
[0x003004, 0x003007], |
| 92 |
[0x003021, 0x00302F], |
| 93 |
[0x003031, 0x00DBFF], |
| 94 |
[0x00E000, 0x00FD3D], |
| 95 |
[0x00FD40, 0x00FE44], |
| 96 |
[0x00FE47, 0x10FFFF] |
| 97 |
] |
| 98 |
}); |
| 99 |
testPropertyEscapes( |
| 100 |
/^\P{Pattern_Syntax}+$/u, |
| 101 |
nonMatchSymbols, |
| 102 |
"\\P{Pattern_Syntax}" |
| 103 |
); |
| 104 |
testPropertyEscapes( |
| 105 |
/^\P{Pat_Syn}+$/u, |
| 106 |
nonMatchSymbols, |
| 107 |
"\\P{Pat_Syn}" |
| 108 |
); |