...
1
2
3 package bidi
4
5 import (
6 "unicode"
7
8 "golang.org/x/text/internal/gen"
9 "golang.org/x/text/internal/ucd"
10 "golang.org/x/text/unicode/rangetable"
11 )
12
13
14
15 func visitDefaults(fn func(r rune, c Class)) {
16
17 visitRunes(fn, AL, []rune{
18 0x0600, 0x07BF,
19 0x08A0, 0x08FF,
20 0xFB50, 0xFDCF,
21 0xFDF0, 0xFDFF,
22 0xFE70, 0xFEFF,
23 0x0001EE00, 0x0001EEFF,
24 })
25 visitRunes(fn, R, []rune{
26 0x0590, 0x05FF,
27 0x07C0, 0x089F,
28 0xFB1D, 0xFB4F,
29 0x00010800, 0x00010FFF,
30 0x0001E800, 0x0001EDFF,
31 0x0001EF00, 0x0001EFFF,
32 })
33 visitRunes(fn, ET, []rune{
34 0x20A0, 0x20Cf,
35 })
36 rangetable.Visit(unicode.Noncharacter_Code_Point, func(r rune) {
37 fn(r, BN)
38 })
39 ucd.Parse(gen.OpenUCDFile("DerivedCoreProperties.txt"), func(p *ucd.Parser) {
40 if p.String(1) == "Default_Ignorable_Code_Point" {
41 fn(p.Rune(0), BN)
42 }
43 })
44 }
45
46 func visitRunes(fn func(r rune, c Class), c Class, runes []rune) {
47 for i := 0; i < len(runes); i += 2 {
48 lo, hi := runes[i], runes[i+1]
49 for j := lo; j <= hi; j++ {
50 fn(j, c)
51 }
52 }
53 }
54
View as plain text