From 54d3d47daf9190275bbdaf8703b84969a4593451 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Fri, 24 Mar 2017 23:31:34 -0700 Subject: PLT-6076 Adding viper libs for config file changes (#5871) * Adding viper libs for config file changes * Removing the old fsnotify lib * updating some missing libs --- vendor/golang.org/x/text/unicode/runenames/gen.go | 195 ++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 vendor/golang.org/x/text/unicode/runenames/gen.go (limited to 'vendor/golang.org/x/text/unicode/runenames/gen.go') diff --git a/vendor/golang.org/x/text/unicode/runenames/gen.go b/vendor/golang.org/x/text/unicode/runenames/gen.go new file mode 100644 index 000000000..7e373a54c --- /dev/null +++ b/vendor/golang.org/x/text/unicode/runenames/gen.go @@ -0,0 +1,195 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +package main + +import ( + "log" + "strings" + "unicode" + + "golang.org/x/text/internal/gen" + "golang.org/x/text/internal/ucd" +) + +// snippet is a slice of data; data is the concatenation of all of the names. +type snippet struct { + offset int + length int + s string +} + +func makeTable0EntryDirect(rOffset, rLength, dOffset, dLength int) uint64 { + if rOffset >= 1<= 1<= 1<= 1<= 1<= 1<= 1<= 1<= 0 { + s = s[:i] + ">" + } + } + names[r] = s + counts[s]++ + }) + return names, counts +} + +func appendRepeatNames(names []string, counts map[string]int) { + alreadySeen := map[string]snippet{} + for r, s := range names { + if s == "" || counts[s] == 1 { + continue + } + if s[0] != '<' { + log.Fatalf("Repeated name %q does not start with a '<'", s) + } + + if z, ok := alreadySeen[s]; ok { + snippets[r] = z + continue + } + + z := snippet{ + offset: len(data), + length: len(s), + s: s, + } + data = append(data, s...) + snippets[r] = z + alreadySeen[s] = z + } +} + +func appendUniqueNames(names []string, counts map[string]int) { + for r, s := range names { + if s == "" || counts[s] != 1 { + continue + } + if s[0] == '<' { + log.Fatalf("Unique name %q starts with a '<'", s) + } + + z := snippet{ + offset: len(data), + length: len(s), + s: s, + } + data = append(data, s...) + snippets[r] = z + } +} + +func makeTables() (table0 []uint64, table1 []uint16) { + for i := 0; i < len(snippets); { + zi := snippets[i] + if zi == (snippet{}) { + i++ + continue + } + + // Look for repeat names. If we have one, we only need a table0 entry. + j := i + 1 + for ; j < len(snippets) && zi == snippets[j]; j++ { + } + if j > i+1 { + table0 = append(table0, makeTable0EntryDirect(i, j-i, zi.offset, zi.length)) + i = j + continue + } + + // Otherwise, we have a run of unique names. We need one table0 entry + // and two or more table1 entries. + base := zi.offset &^ (1<>dataBaseUnit, t1Offset)) + i = j + } + return table0, table1 +} -- cgit v1.2.3-1-g7c22