Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / libgo / go / unicode / graphic.go
index 0de90eb..5b995fc 100644 (file)
@@ -6,15 +6,17 @@ package unicode
 
 // Bit masks for each code point under U+0100, for fast lookup.
 const (
-       pC  = 1 << iota // a control character.
-       pP              // a punctuation character.
-       pN              // a numeral.
-       pS              // a symbolic character.
-       pZ              // a spacing character.
-       pLu             // an upper-case letter.
-       pLl             // a lower-case letter.
-       pp              // a printable character according to Go's definition.
-       pg  = pp | pZ   // a graphical character according to the Unicode definition.
+       pC     = 1 << iota // a control character.
+       pP                 // a punctuation character.
+       pN                 // a numeral.
+       pS                 // a symbolic character.
+       pZ                 // a spacing character.
+       pLu                // an upper-case letter.
+       pLl                // a lower-case letter.
+       pp                 // a printable character according to Go's definition.
+       pg     = pp | pZ   // a graphical character according to the Unicode definition.
+       pLo    = pLl | pLu // a letter that is neither upper nor lower case.
+       pLmask = pLo
 )
 
 // GraphicRanges defines the set of graphic characters according to Unicode.
@@ -76,15 +78,15 @@ func IsControl(r rune) bool {
 // IsLetter reports whether the rune is a letter (category L).
 func IsLetter(r rune) bool {
        if uint32(r) <= MaxLatin1 {
-               return properties[uint8(r)]&(pLu|pLl) != 0
+               return properties[uint8(r)]&(pLmask) != 0
        }
-       return Is(Letter, r)
+       return isExcludingLatin(Letter, r)
 }
 
 // IsMark reports whether the rune is a mark character (category M).
 func IsMark(r rune) bool {
        // There are no mark characters in Latin-1.
-       return Is(Mark, r)
+       return isExcludingLatin(Mark, r)
 }
 
 // IsNumber reports whether the rune is a number (category N).
@@ -92,7 +94,7 @@ func IsNumber(r rune) bool {
        if uint32(r) <= MaxLatin1 {
                return properties[uint8(r)]&pN != 0
        }
-       return Is(Number, r)
+       return isExcludingLatin(Number, r)
 }
 
 // IsPunct reports whether the rune is a Unicode punctuation character
@@ -119,7 +121,7 @@ func IsSpace(r rune) bool {
                }
                return false
        }
-       return Is(White_Space, r)
+       return isExcludingLatin(White_Space, r)
 }
 
 // IsSymbol reports whether the rune is a symbolic character.
@@ -127,5 +129,5 @@ func IsSymbol(r rune) bool {
        if uint32(r) <= MaxLatin1 {
                return properties[uint8(r)]&pS != 0
        }
-       return Is(Symbol, r)
+       return isExcludingLatin(Symbol, r)
 }