summaryrefslogtreecommitdiff
path: root/libgo/go/regexp/syntax/regexp.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/regexp/syntax/regexp.go')
-rw-r--r--libgo/go/regexp/syntax/regexp.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/libgo/go/regexp/syntax/regexp.go b/libgo/go/regexp/syntax/regexp.go
index 033848df28a..b5ddab1d16b 100644
--- a/libgo/go/regexp/syntax/regexp.go
+++ b/libgo/go/regexp/syntax/regexp.go
@@ -22,8 +22,8 @@ type Regexp struct {
Flags Flags
Sub []*Regexp // subexpressions, if any
Sub0 [1]*Regexp // storage for short Sub
- Rune []int // matched runes, for OpLiteral, OpCharClass
- Rune0 [2]int // storage for short Rune
+ Rune []rune // matched runes, for OpLiteral, OpCharClass
+ Rune0 [2]rune // storage for short Rune
Min, Max int // min, max for OpRepeat
Cap int // capturing index, for OpCapture
Name string // capturing name, for OpCapture
@@ -252,7 +252,7 @@ func (re *Regexp) String() string {
const meta = `\.+*?()|[]{}^$`
-func escape(b *bytes.Buffer, r int, force bool) {
+func escape(b *bytes.Buffer, r rune, force bool) {
if unicode.IsPrint(r) {
if strings.IndexRune(meta, r) >= 0 || force {
b.WriteRune('\\')
@@ -277,7 +277,7 @@ func escape(b *bytes.Buffer, r int, force bool) {
default:
if r < 0x100 {
b.WriteString(`\x`)
- s := strconv.Itob(r, 16)
+ s := strconv.Itob(int(r), 16)
if len(s) == 1 {
b.WriteRune('0')
}
@@ -285,7 +285,7 @@ func escape(b *bytes.Buffer, r int, force bool) {
break
}
b.WriteString(`\x{`)
- b.WriteString(strconv.Itob(r, 16))
+ b.WriteString(strconv.Itob(int(r), 16))
b.WriteString(`}`)
}
}