Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(269)

Side by Side Diff: src/pkg/unicode/letter.go

Issue 135820043: code review 135820043: unicode: use go generate instead of make to create tables.go (Closed)
Patch Set: diff -r a7e5b76e6e713a07fe03eb51678ee2b89b05d481 https://code.google.com/p/go Created 10 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/unicode/Makefile ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.
10 //go:generate go run maketables.go -tables=all -output tables.go
11
9 const ( 12 const (
10 MaxRune = '\U0010FFFF' // Maximum valid Unicode code point. 13 MaxRune = '\U0010FFFF' // Maximum valid Unicode code point.
11 ReplacementChar = '\uFFFD' // Represents invalid code points. 14 ReplacementChar = '\uFFFD' // Represents invalid code points.
12 MaxASCII = '\u007F' // maximum ASCII value. 15 MaxASCII = '\u007F' // maximum ASCII value.
13 MaxLatin1 = '\u00FF' // maximum Latin-1 value. 16 MaxLatin1 = '\u00FF' // maximum Latin-1 value.
14 ) 17 )
15 18
16 // 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
17 // 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
18 // to save space: a slice of 16-bit ranges and a slice of 32-bit ranges. 21 // to save space: a slice of 16-bit ranges and a slice of 32-bit ranges.
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 } 348 }
346 349
347 // No folding specified. This is a one- or two-element 350 // No folding specified. This is a one- or two-element
348 // equivalence class containing rune and ToLower(rune) 351 // equivalence class containing rune and ToLower(rune)
349 // and ToUpper(rune) if they are different from rune. 352 // and ToUpper(rune) if they are different from rune.
350 if l := ToLower(r); l != r { 353 if l := ToLower(r); l != r {
351 return l 354 return l
352 } 355 }
353 return ToUpper(r) 356 return ToUpper(r)
354 } 357 }
OLDNEW
« no previous file with comments | « src/pkg/unicode/Makefile ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b