1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:24:45 -07:00

exp/norm: generate trie struct in triegen.go for better encapsulation.

R=r, r
CC=golang-dev
https://golang.org/cl/4837071
This commit is contained in:
Marcel van Lohuizen 2011-08-12 17:44:14 +02:00
parent 8d19d6bb39
commit 58a92bd1ef
4 changed files with 464 additions and 455 deletions

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ import (
)
// Test data is located in triedata_test.go, generated by maketesttables.
var testdata = &trie{testdataLookup[:], testdataValues[:]}
var testdata = testdataTrie
// Test cases for illegal runes.
type trietest struct {

View File

@ -59,3 +59,5 @@ var testdataLookup = [640]uint8{
// Block 0x9, offset 0x240
0x24f: 0x08,
}
var testdataTrie = trie{testdataLookup[:], testdataValues[:]}

View File

@ -206,5 +206,6 @@ func (t *trieNode) printTables(name string) int {
printLookupBlock(i, index.lookupBlocks[i], 0x80)
}
fmt.Print("\n}\n\n")
fmt.Printf("var %sTrie = trie{ %sLookup[:], %sValues[:] }\n\n", name, name, name)
return nv*2 + ni
}