1 // Copyright 2016 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build ignore 6 7 package main 8 9 import ( 10 "unicode/utf8" 11 12 "golang.org/x/text/internal/language/compact" 13 ) 14 15 // A system identifies a CLDR numbering system. 16 type system byte 17 18 type systemData struct { 19 id system 20 digitSize byte // number of UTF-8 bytes per digit 21 zero [utf8.UTFMax]byte // UTF-8 sequence of zero digit. 22 } 23 24 // A SymbolType identifies a symbol of a specific kind. 25 type SymbolType int 26 27 const ( 28 SymDecimal SymbolType = iota 29 SymGroup 30 SymList 31 SymPercentSign 32 SymPlusSign 33 SymMinusSign 34 SymExponential 35 SymSuperscriptingExponent 36 SymPerMille 37 SymInfinity 38 SymNan 39 SymTimeSeparator 40 41 NumSymbolTypes 42 ) 43 44 const hasNonLatnMask = 0x8000 45 46 // symOffset is an offset into altSymData if the bit indicated by hasNonLatnMask 47 // is not 0 (with this bit masked out), and an offset into symIndex otherwise. 48 // 49 // TODO: this type can be a byte again if we use an indirection into altsymData 50 // and introduce an alt -> offset slice (the length of this will be number of 51 // alternatives plus 1). This also allows getting rid of the compactTag field 52 // in altSymData. In total this will save about 1K. 53 type symOffset uint16 54 55 type altSymData struct { 56 compactTag compact.ID 57 symIndex symOffset 58 system system 59 } 60