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

Delta Between Two Patch Sets: src/pkg/unicode/letter.go

Issue 135820043: code review 135820043: unicode: use go generate instead of make to create tables.go (Closed)
Left Patch Set: Created 10 years, 6 months ago
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/unicode/Makefile ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
mpvl 2014/08/26 19:13:16 Any reason not to make it `go run maketables.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
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 }
LEFTRIGHT

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