Extender.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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 `Extender`
  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. 0x0000B7,
  17. 0x000640,
  18. 0x0007FA,
  19. 0x000E46,
  20. 0x000EC6,
  21. 0x00180A,
  22. 0x001843,
  23. 0x001AA7,
  24. 0x001C36,
  25. 0x001C7B,
  26. 0x003005,
  27. 0x00A015,
  28. 0x00A60C,
  29. 0x00A9CF,
  30. 0x00A9E6,
  31. 0x00AA70,
  32. 0x00AADD,
  33. 0x00FF70,
  34. 0x01135D,
  35. 0x011A98,
  36. 0x016FE3
  37. ],
  38. ranges: [
  39. [0x0002D0, 0x0002D1],
  40. [0x003031, 0x003035],
  41. [0x00309D, 0x00309E],
  42. [0x0030FC, 0x0030FE],
  43. [0x00AAF3, 0x00AAF4],
  44. [0x0115C6, 0x0115C8],
  45. [0x016B42, 0x016B43],
  46. [0x016FE0, 0x016FE1],
  47. [0x01E13C, 0x01E13D],
  48. [0x01E944, 0x01E946]
  49. ]
  50. });
  51. testPropertyEscapes(
  52. /^\p{Extender}+$/u,
  53. matchSymbols,
  54. "\\p{Extender}"
  55. );
  56. testPropertyEscapes(
  57. /^\p{Ext}+$/u,
  58. matchSymbols,
  59. "\\p{Ext}"
  60. );
  61. const nonMatchSymbols = buildString({
  62. loneCodePoints: [
  63. 0x016FE2
  64. ],
  65. ranges: [
  66. [0x00DC00, 0x00DFFF],
  67. [0x000000, 0x0000B6],
  68. [0x0000B8, 0x0002CF],
  69. [0x0002D2, 0x00063F],
  70. [0x000641, 0x0007F9],
  71. [0x0007FB, 0x000E45],
  72. [0x000E47, 0x000EC5],
  73. [0x000EC7, 0x001809],
  74. [0x00180B, 0x001842],
  75. [0x001844, 0x001AA6],
  76. [0x001AA8, 0x001C35],
  77. [0x001C37, 0x001C7A],
  78. [0x001C7C, 0x003004],
  79. [0x003006, 0x003030],
  80. [0x003036, 0x00309C],
  81. [0x00309F, 0x0030FB],
  82. [0x0030FF, 0x00A014],
  83. [0x00A016, 0x00A60B],
  84. [0x00A60D, 0x00A9CE],
  85. [0x00A9D0, 0x00A9E5],
  86. [0x00A9E7, 0x00AA6F],
  87. [0x00AA71, 0x00AADC],
  88. [0x00AADE, 0x00AAF2],
  89. [0x00AAF5, 0x00DBFF],
  90. [0x00E000, 0x00FF6F],
  91. [0x00FF71, 0x01135C],
  92. [0x01135E, 0x0115C5],
  93. [0x0115C9, 0x011A97],
  94. [0x011A99, 0x016B41],
  95. [0x016B44, 0x016FDF],
  96. [0x016FE4, 0x01E13B],
  97. [0x01E13E, 0x01E943],
  98. [0x01E947, 0x10FFFF]
  99. ]
  100. });
  101. testPropertyEscapes(
  102. /^\P{Extender}+$/u,
  103. nonMatchSymbols,
  104. "\\P{Extender}"
  105. );
  106. testPropertyEscapes(
  107. /^\P{Ext}+$/u,
  108. nonMatchSymbols,
  109. "\\P{Ext}"
  110. );