LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // Package unicode provides data and functions to test some properties of | 5 // Package unicode provides data and functions to test some properties of |
6 // Unicode code points. | 6 // Unicode code points. |
7 package unicode | 7 package unicode |
8 | 8 |
9 // Tables are regenerated each time we update the Unicode version. | 9 // Tables are regenerated each time we update the Unicode version. |
10 //go:generate go build maketables.go | 10 //go:generate go run maketables.go -tables=all -output tables.go |
11 //go:generate ./maketables --tables=all -output tables.go | |
12 | 11 |
13 const ( | 12 const ( |
14 MaxRune = '\U0010FFFF' // Maximum valid Unicode code point. | 13 MaxRune = '\U0010FFFF' // Maximum valid Unicode code point. |
15 ReplacementChar = '\uFFFD' // Represents invalid code points. | 14 ReplacementChar = '\uFFFD' // Represents invalid code points. |
16 MaxASCII = '\u007F' // maximum ASCII value. | 15 MaxASCII = '\u007F' // maximum ASCII value. |
17 MaxLatin1 = '\u00FF' // maximum Latin-1 value. | 16 MaxLatin1 = '\u00FF' // maximum Latin-1 value. |
18 ) | 17 ) |
19 | 18 |
20 // RangeTable defines a set of Unicode code points by listing the ranges of | 19 // RangeTable defines a set of Unicode code points by listing the ranges of |
21 // code points within the set. The ranges are listed in two slices | 20 // code points within the set. The ranges are listed in two slices |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 } | 348 } |
350 | 349 |
351 // No folding specified. This is a one- or two-element | 350 // No folding specified. This is a one- or two-element |
352 // equivalence class containing rune and ToLower(rune) | 351 // equivalence class containing rune and ToLower(rune) |
353 // and ToUpper(rune) if they are different from rune. | 352 // and ToUpper(rune) if they are different from rune. |
354 if l := ToLower(r); l != r { | 353 if l := ToLower(r); l != r { |
355 return l | 354 return l |
356 } | 355 } |
357 return ToUpper(r) | 356 return ToUpper(r) |
358 } | 357 } |
LEFT | RIGHT |