github.com/go-xe2/third@v1.0.3/golang.org/x/text/unicode/bidi/ranges_test.go (about)

     1  // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
     2  
     3  package bidi
     4  
     5  import (
     6  	"unicode"
     7  
     8  	"github.com/go-xe2/third/golang.org/x/text/internal/gen"
     9  	"github.com/go-xe2/third/golang.org/x/text/internal/ucd"
    10  	"github.com/go-xe2/third/golang.org/x/text/unicode/rangetable"
    11  )
    12  
    13  // These tables are hand-extracted from:
    14  // http://www.unicode.org/Public/8.0.0/ucd/extracted/DerivedBidiClass.txt
    15  func visitDefaults(fn func(r rune, c Class)) {
    16  	// first write default values for ranges listed above.
    17  	visitRunes(fn, AL, []rune{
    18  		0x0600, 0x07BF, // Arabic
    19  		0x08A0, 0x08FF, // Arabic Extended-A
    20  		0xFB50, 0xFDCF, // Arabic Presentation Forms
    21  		0xFDF0, 0xFDFF,
    22  		0xFE70, 0xFEFF,
    23  		0x0001EE00, 0x0001EEFF, // Arabic Mathematical Alpha Symbols
    24  	})
    25  	visitRunes(fn, R, []rune{
    26  		0x0590, 0x05FF, // Hebrew
    27  		0x07C0, 0x089F, // Nko et al.
    28  		0xFB1D, 0xFB4F,
    29  		0x00010800, 0x00010FFF, // Cypriot Syllabary et. al.
    30  		0x0001E800, 0x0001EDFF,
    31  		0x0001EF00, 0x0001EFFF,
    32  	})
    33  	visitRunes(fn, ET, []rune{ // European Terminator
    34  		0x20A0, 0x20Cf, // Currency symbols
    35  	})
    36  	rangetable.Visit(unicode.Noncharacter_Code_Point, func(r rune) {
    37  		fn(r, BN) // Boundary Neutral
    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) // Boundary Neutral
    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  }