libgo: Update to weekly.2011-11-01.
From-SVN: r181938
This commit is contained in:
parent
bfa9b58039
commit
506cf9aaea
169 changed files with 2252 additions and 1617 deletions
|
@ -5,9 +5,9 @@
|
|||
package syntax_test
|
||||
|
||||
import (
|
||||
. "regexp/syntax"
|
||||
"bytes"
|
||||
"fmt"
|
||||
. "regexp/syntax"
|
||||
"testing"
|
||||
"unicode"
|
||||
)
|
||||
|
@ -372,10 +372,10 @@ func dumpRegexp(b *bytes.Buffer, re *Regexp) {
|
|||
b.WriteByte('}')
|
||||
}
|
||||
|
||||
func mkCharClass(f func(int) bool) string {
|
||||
func mkCharClass(f func(rune) bool) string {
|
||||
re := &Regexp{Op: OpCharClass}
|
||||
lo := -1
|
||||
for i := 0; i <= unicode.MaxRune; i++ {
|
||||
lo := rune(-1)
|
||||
for i := rune(0); i <= unicode.MaxRune; i++ {
|
||||
if f(i) {
|
||||
if lo < 0 {
|
||||
lo = i
|
||||
|
@ -393,12 +393,12 @@ func mkCharClass(f func(int) bool) string {
|
|||
return dump(re)
|
||||
}
|
||||
|
||||
func isUpperFold(rune int) bool {
|
||||
if unicode.IsUpper(rune) {
|
||||
func isUpperFold(r rune) bool {
|
||||
if unicode.IsUpper(r) {
|
||||
return true
|
||||
}
|
||||
c := unicode.SimpleFold(rune)
|
||||
for c != rune {
|
||||
c := unicode.SimpleFold(r)
|
||||
for c != r {
|
||||
if unicode.IsUpper(c) {
|
||||
return true
|
||||
}
|
||||
|
@ -408,8 +408,8 @@ func isUpperFold(rune int) bool {
|
|||
}
|
||||
|
||||
func TestFoldConstants(t *testing.T) {
|
||||
last := -1
|
||||
for i := 0; i <= unicode.MaxRune; i++ {
|
||||
last := rune(-1)
|
||||
for i := rune(0); i <= unicode.MaxRune; i++ {
|
||||
if unicode.SimpleFold(i) == i {
|
||||
continue
|
||||
}
|
||||
|
@ -428,8 +428,8 @@ func TestAppendRangeCollapse(t *testing.T) {
|
|||
// into the earlier ones (it looks back two ranges), so that
|
||||
// the slice never grows very large.
|
||||
// Note that we are not calling cleanClass.
|
||||
var r []int
|
||||
for i := 'A'; i <= 'Z'; i++ {
|
||||
var r []rune
|
||||
for i := rune('A'); i <= 'Z'; i++ {
|
||||
r = AppendRange(r, i, i)
|
||||
r = AppendRange(r, i+'a'-'A', i+'a'-'A')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue