Dash.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Copyright 2019 Mathias Bynens. All rights reserved.
  2. // This code is governed by the BSD license found in the LICENSE file.
  3. /*---
  4. author: Mathias Bynens
  5. description: >
  6. Unicode property escapes for `Dash`
  7. info: |
  8. Generated by https://github.com/mathiasbynens/unicode-property-escapes-tests
  9. Unicode v12.1.0
  10. esid: sec-static-semantics-unicodematchproperty-p
  11. features: [regexp-unicode-property-escapes]
  12. includes: [regExpUtils.js]
  13. ---*/
  14. const matchSymbols = buildString({
  15. loneCodePoints: [
  16. 0x00002D,
  17. 0x00058A,
  18. 0x0005BE,
  19. 0x001400,
  20. 0x001806,
  21. 0x002053,
  22. 0x00207B,
  23. 0x00208B,
  24. 0x002212,
  25. 0x002E17,
  26. 0x002E1A,
  27. 0x002E40,
  28. 0x00301C,
  29. 0x003030,
  30. 0x0030A0,
  31. 0x00FE58,
  32. 0x00FE63,
  33. 0x00FF0D
  34. ],
  35. ranges: [
  36. [0x002010, 0x002015],
  37. [0x002E3A, 0x002E3B],
  38. [0x00FE31, 0x00FE32]
  39. ]
  40. });
  41. testPropertyEscapes(
  42. /^\p{Dash}+$/u,
  43. matchSymbols,
  44. "\\p{Dash}"
  45. );
  46. const nonMatchSymbols = buildString({
  47. loneCodePoints: [],
  48. ranges: [
  49. [0x00DC00, 0x00DFFF],
  50. [0x000000, 0x00002C],
  51. [0x00002E, 0x000589],
  52. [0x00058B, 0x0005BD],
  53. [0x0005BF, 0x0013FF],
  54. [0x001401, 0x001805],
  55. [0x001807, 0x00200F],
  56. [0x002016, 0x002052],
  57. [0x002054, 0x00207A],
  58. [0x00207C, 0x00208A],
  59. [0x00208C, 0x002211],
  60. [0x002213, 0x002E16],
  61. [0x002E18, 0x002E19],
  62. [0x002E1B, 0x002E39],
  63. [0x002E3C, 0x002E3F],
  64. [0x002E41, 0x00301B],
  65. [0x00301D, 0x00302F],
  66. [0x003031, 0x00309F],
  67. [0x0030A1, 0x00DBFF],
  68. [0x00E000, 0x00FE30],
  69. [0x00FE33, 0x00FE57],
  70. [0x00FE59, 0x00FE62],
  71. [0x00FE64, 0x00FF0C],
  72. [0x00FF0E, 0x10FFFF]
  73. ]
  74. });
  75. testPropertyEscapes(
  76. /^\P{Dash}+$/u,
  77. nonMatchSymbols,
  78. "\\P{Dash}"
  79. );