summaryrefslogtreecommitdiffstats
path: root/libgo/go/unicode
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-02 16:38:43 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-02 16:38:43 +0000
commit2d2d80b8bd963f59534897b3d51ef8bd546cb4bc (patch)
treeefa0c55763b34cbc633bc494c2743d1b5d9aaff3 /libgo/go/unicode
parent2ad2700dbf70b2e49575f3f2307839a45cf2f71c (diff)
downloadppe42-gcc-2d2d80b8bd963f59534897b3d51ef8bd546cb4bc.tar.gz
ppe42-gcc-2d2d80b8bd963f59534897b3d51ef8bd546cb4bc.zip
libgo: Update to weekly.2012-02-14 release.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184798 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/unicode')
-rw-r--r--libgo/go/unicode/graphic.go3
-rw-r--r--libgo/go/unicode/letter.go6
-rw-r--r--libgo/go/unicode/tables.go2
-rw-r--r--libgo/go/unicode/utf8/utf8.go9
4 files changed, 11 insertions, 9 deletions
diff --git a/libgo/go/unicode/graphic.go b/libgo/go/unicode/graphic.go
index 2904da6c6d9..0de90ebd80c 100644
--- a/libgo/go/unicode/graphic.go
+++ b/libgo/go/unicode/graphic.go
@@ -53,7 +53,6 @@ func IsPrint(r rune) bool {
}
// IsOneOf reports whether the rune is a member of one of the ranges.
-// The rune is known to be above Latin-1.
func IsOneOf(set []*RangeTable, r rune) bool {
for _, inside := range set {
if Is(inside, r) {
@@ -65,7 +64,7 @@ func IsOneOf(set []*RangeTable, r rune) bool {
// IsControl reports whether the rune is a control character.
// The C (Other) Unicode category includes more code points
-// such as surrogates; use Is(C, rune) to test for them.
+// such as surrogates; use Is(C, r) to test for them.
func IsControl(r rune) bool {
if uint32(r) <= MaxLatin1 {
return properties[uint8(r)]&pC != 0
diff --git a/libgo/go/unicode/letter.go b/libgo/go/unicode/letter.go
index dcc160a5b7d..be484553dc4 100644
--- a/libgo/go/unicode/letter.go
+++ b/libgo/go/unicode/letter.go
@@ -60,8 +60,8 @@ type CaseRange struct {
// Methods of SpecialCase customize (by overriding) the standard mappings.
type SpecialCase []CaseRange
-//BUG(r): Provide a mechanism for full case folding (those that involve
-// multiple runes in the input or output).
+// BUG(r): There is no mechanism for full case folding, that is, for
+// characters that involve multiple runes in the input or output.
// Indices into the Delta arrays inside CaseRanges for case mapping.
const (
@@ -288,7 +288,7 @@ type foldPair struct {
// SimpleFold iterates over Unicode code points equivalent under
// the Unicode-defined simple case folding. Among the code points
// equivalent to rune (including rune itself), SimpleFold returns the
-// smallest r >= rune if one exists, or else the smallest r >= 0.
+// smallest rune >= r if one exists, or else the smallest rune >= 0.
//
// For example:
// SimpleFold('A') = 'a'
diff --git a/libgo/go/unicode/tables.go b/libgo/go/unicode/tables.go
index 978c48ae43e..5009e6b98c8 100644
--- a/libgo/go/unicode/tables.go
+++ b/libgo/go/unicode/tables.go
@@ -7,7 +7,7 @@ package unicode
// Version is the Unicode edition from which the tables are derived.
const Version = "6.0.0"
-// Categories is the set of Unicode data tables.
+// Categories is the set of Unicode category tables.
var Categories = map[string]*RangeTable{
"C": C,
"Cc": Cc,
diff --git a/libgo/go/unicode/utf8/utf8.go b/libgo/go/unicode/utf8/utf8.go
index a5f9983b332..631533a5a35 100644
--- a/libgo/go/unicode/utf8/utf8.go
+++ b/libgo/go/unicode/utf8/utf8.go
@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
// Package utf8 implements functions and constants to support text encoded in
-// UTF-8. This package calls a Unicode character a rune for brevity.
+// UTF-8. It includes functions to translate between runes and UTF-8 byte sequences.
package utf8
import "unicode" // only needed for a couple of constants
@@ -198,19 +198,21 @@ func FullRuneInString(s string) bool {
}
// DecodeRune unpacks the first UTF-8 encoding in p and returns the rune and its width in bytes.
+// If the encoding is invalid, it returns (RuneError, 1), an impossible result for correct UTF-8.
func DecodeRune(p []byte) (r rune, size int) {
r, size, _ = decodeRuneInternal(p)
return
}
// DecodeRuneInString is like DecodeRune but its input is a string.
+// If the encoding is invalid, it returns (RuneError, 1), an impossible result for correct UTF-8.
func DecodeRuneInString(s string) (r rune, size int) {
r, size, _ = decodeRuneInStringInternal(s)
return
}
-// DecodeLastRune unpacks the last UTF-8 encoding in p
-// and returns the rune and its width in bytes.
+// DecodeLastRune unpacks the last UTF-8 encoding in p and returns the rune and its width in bytes.
+// If the encoding is invalid, it returns (RuneError, 1), an impossible result for correct UTF-8.
func DecodeLastRune(p []byte) (r rune, size int) {
end := len(p)
if end == 0 {
@@ -244,6 +246,7 @@ func DecodeLastRune(p []byte) (r rune, size int) {
}
// DecodeLastRuneInString is like DecodeLastRune but its input is a string.
+// If the encoding is invalid, it returns (RuneError, 1), an impossible result for correct UTF-8.
func DecodeLastRuneInString(s string) (r rune, size int) {
end := len(s)
if end == 0 {
OpenPOWER on IntegriCloud