From 621e49bb465f500cc46d47e39e828cf76d6381d7 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 24 Jul 2018 14:35:44 +0200 Subject: update vendor --- vendor/golang.org/x/text/unicode/runenames/bits.go | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 vendor/golang.org/x/text/unicode/runenames/bits.go (limited to 'vendor/golang.org/x/text/unicode/runenames/bits.go') diff --git a/vendor/golang.org/x/text/unicode/runenames/bits.go b/vendor/golang.org/x/text/unicode/runenames/bits.go new file mode 100644 index 0000000..48cc2c0 --- /dev/null +++ b/vendor/golang.org/x/text/unicode/runenames/bits.go @@ -0,0 +1,59 @@ +// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. + +package runenames + +// This file contains code common to gen.go and the package code. + +// The mapping from rune to string (i.e. offset and length in the data string) +// is encoded as a two level table. The first level maps from contiguous rune +// ranges [runeOffset, runeOffset+runeLength) to entries. Entries are either +// direct (for repeated names such as "") or indirect (for runs +// of unique names such as "SPACE", "EXCLAMATION MARK", "QUOTATION MARK", ...). +// +// Each first level table element is 64 bits. The runeOffset (21 bits) and +// runeLength (16 bits) take the 37 high bits. The entry takes the 27 low bits, +// with directness encoded in the least significant bit. +// +// A direct entry encodes a dataOffset (18 bits) and dataLength (8 bits) in the +// data string. 18 bits is too short to encode the entire data string's length, +// but the data string's contents are arranged so that all of the few direct +// entries' offsets come before all of the many indirect entries' offsets. +// +// An indirect entry encodes a dataBase (10 bits) and a table1Offset (16 bits). +// The table1Offset is the start of a range in the second level table. The +// length of that range is the same as the runeLength. +// +// Each second level table element is 16 bits, an index into data, relative to +// a bias equal to (dataBase << dataBaseUnit). That (bias + index) is the +// (dataOffset + dataLength) in the data string. The dataOffset is implied by +// the previous table element (with the same implicit bias). + +const ( + bitsRuneOffset = 21 + bitsRuneLength = 16 + bitsDataOffset = 18 + bitsDataLength = 8 + bitsDirect = 1 + + bitsDataBase = 10 + bitsTable1Offset = 16 + + shiftRuneOffset = 0 + bitsDirect + bitsDataLength + bitsDataOffset + bitsRuneLength + shiftRuneLength = 0 + bitsDirect + bitsDataLength + bitsDataOffset + shiftDataOffset = 0 + bitsDirect + bitsDataLength + shiftDataLength = 0 + bitsDirect + shiftDirect = 0 + + shiftDataBase = 0 + bitsDirect + bitsTable1Offset + shiftTable1Offset = 0 + bitsDirect + + maskRuneLength = 1<