2
0

ASCII_Hex_Digit.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 `ASCII_Hex_Digit`
  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. ranges: [
  17. [0x000030, 0x000039],
  18. [0x000041, 0x000046],
  19. [0x000061, 0x000066]
  20. ]
  21. });
  22. testPropertyEscapes(
  23. /^\p{ASCII_Hex_Digit}+$/u,
  24. matchSymbols,
  25. "\\p{ASCII_Hex_Digit}"
  26. );
  27. testPropertyEscapes(
  28. /^\p{AHex}+$/u,
  29. matchSymbols,
  30. "\\p{AHex}"
  31. );
  32. const nonMatchSymbols = buildString({
  33. loneCodePoints: [],
  34. ranges: [
  35. [0x00DC00, 0x00DFFF],
  36. [0x000000, 0x00002F],
  37. [0x00003A, 0x000040],
  38. [0x000047, 0x000060],
  39. [0x000067, 0x00DBFF],
  40. [0x00E000, 0x10FFFF]
  41. ]
  42. });
  43. testPropertyEscapes(
  44. /^\P{ASCII_Hex_Digit}+$/u,
  45. nonMatchSymbols,
  46. "\\P{ASCII_Hex_Digit}"
  47. );
  48. testPropertyEscapes(
  49. /^\P{AHex}+$/u,
  50. nonMatchSymbols,
  51. "\\P{AHex}"
  52. );