trieval.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
  2. package bidi
  3. // Class is the Unicode BiDi class. Each rune has a single class.
  4. type Class uint
  5. const (
  6. L Class = iota // LeftToRight
  7. R // RightToLeft
  8. EN // EuropeanNumber
  9. ES // EuropeanSeparator
  10. ET // EuropeanTerminator
  11. AN // ArabicNumber
  12. CS // CommonSeparator
  13. B // ParagraphSeparator
  14. S // SegmentSeparator
  15. WS // WhiteSpace
  16. ON // OtherNeutral
  17. BN // BoundaryNeutral
  18. NSM // NonspacingMark
  19. AL // ArabicLetter
  20. Control // Control LRO - PDI
  21. numClass
  22. LRO // LeftToRightOverride
  23. RLO // RightToLeftOverride
  24. LRE // LeftToRightEmbedding
  25. RLE // RightToLeftEmbedding
  26. PDF // PopDirectionalFormat
  27. LRI // LeftToRightIsolate
  28. RLI // RightToLeftIsolate
  29. FSI // FirstStrongIsolate
  30. PDI // PopDirectionalIsolate
  31. unknownClass = ^Class(0)
  32. )
  33. var controlToClass = map[rune]Class{
  34. 0x202D: LRO, // LeftToRightOverride,
  35. 0x202E: RLO, // RightToLeftOverride,
  36. 0x202A: LRE, // LeftToRightEmbedding,
  37. 0x202B: RLE, // RightToLeftEmbedding,
  38. 0x202C: PDF, // PopDirectionalFormat,
  39. 0x2066: LRI, // LeftToRightIsolate,
  40. 0x2067: RLI, // RightToLeftIsolate,
  41. 0x2068: FSI, // FirstStrongIsolate,
  42. 0x2069: PDI, // PopDirectionalIsolate,
  43. }
  44. // A trie entry has the following bits:
  45. // 7..5 XOR mask for brackets
  46. // 4 1: Bracket open, 0: Bracket close
  47. // 3..0 Class type
  48. const (
  49. openMask = 0x10
  50. xorMaskShift = 5
  51. )