aboutsummaryrefslogtreecommitdiff
path: root/src/unicode
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-06-14 20:29:42 -0400
committerBrad Fitzpatrick <bradfitz@golang.org>2017-06-15 01:05:31 +0000
commit82abd4152da01cf2fc62ac7ce0988e7925043061 (patch)
tree211ebaebbc775770cc9693a546128b376541bd4a /src/unicode
parent90a8b7361cf0d4f117af49fb9c72ec77c345298b (diff)
downloadgo-82abd4152da01cf2fc62ac7ce0988e7925043061.tar.gz
go-82abd4152da01cf2fc62ac7ce0988e7925043061.zip
unicode: move scripts from FoldCategories to FoldScripts
Copy-and-paste bug was putting scripts in the categories map. Fixes #18186. Change-Id: Ife9d9bdd346fe24e578dbb2a0aac7ef6e889ae68 Reviewed-on: https://go-review.googlesource.com/45830 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/unicode')
-rw-r--r--src/unicode/maketables.go2
-rw-r--r--src/unicode/tables.go59
2 files changed, 31 insertions, 30 deletions
diff --git a/src/unicode/maketables.go b/src/unicode/maketables.go
index e52d9c2472..42864b4a8e 100644
--- a/src/unicode/maketables.go
+++ b/src/unicode/maketables.go
@@ -1201,7 +1201,7 @@ func printCasefold() {
scr := make(map[string]map[rune]bool)
for name := range scripts {
if x := foldExceptions(inScript(name)); len(x) > 0 {
- cat[name] = x
+ scr[name] = x
}
}
diff --git a/src/unicode/tables.go b/src/unicode/tables.go
index 548a7d594b..90323367d5 100644
--- a/src/unicode/tables.go
+++ b/src/unicode/tables.go
@@ -7311,34 +7311,12 @@ var caseOrbit = []foldPair{
// simple case folding to code points inside the category.
// If there is no entry for a category name, there are no such points.
var FoldCategory = map[string]*RangeTable{
- "Common": foldCommon,
- "Greek": foldGreek,
- "Inherited": foldInherited,
- "L": foldL,
- "Ll": foldLl,
- "Lt": foldLt,
- "Lu": foldLu,
- "M": foldM,
- "Mn": foldMn,
-}
-
-var foldCommon = &RangeTable{
- R16: []Range16{
- {0x039c, 0x03bc, 32},
- },
-}
-
-var foldGreek = &RangeTable{
- R16: []Range16{
- {0x00b5, 0x0345, 656},
- },
-}
-
-var foldInherited = &RangeTable{
- R16: []Range16{
- {0x0399, 0x03b9, 32},
- {0x1fbe, 0x1fbe, 1},
- },
+ "L": foldL,
+ "Ll": foldLl,
+ "Lt": foldLt,
+ "Lu": foldLu,
+ "M": foldM,
+ "Mn": foldMn,
}
var foldL = &RangeTable{
@@ -7609,7 +7587,30 @@ var foldMn = &RangeTable{
// code points outside the script that are equivalent under
// simple case folding to code points inside the script.
// If there is no entry for a script name, there are no such points.
-var FoldScript = map[string]*RangeTable{}
+var FoldScript = map[string]*RangeTable{
+ "Common": foldCommon,
+ "Greek": foldGreek,
+ "Inherited": foldInherited,
+}
+
+var foldCommon = &RangeTable{
+ R16: []Range16{
+ {0x039c, 0x03bc, 32},
+ },
+}
+
+var foldGreek = &RangeTable{
+ R16: []Range16{
+ {0x00b5, 0x0345, 656},
+ },
+}
+
+var foldInherited = &RangeTable{
+ R16: []Range16{
+ {0x0399, 0x03b9, 32},
+ {0x1fbe, 0x1fbe, 1},
+ },
+}
// Range entries: 3576 16-bit, 1454 32-bit, 5030 total.
// Range bytes: 21456 16-bit, 17448 32-bit, 38904 total.