From 49b4e44b7d540fa846d353b10237848a67789cbf Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 16 Sep 2011 15:47:21 +0000 Subject: Update Go library to r60. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178910 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgo/go/regexp/all_test.go | 2 +- libgo/go/regexp/regexp.go | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'libgo/go/regexp') diff --git a/libgo/go/regexp/all_test.go b/libgo/go/regexp/all_test.go index c7ee4c87970..71edc4d18d3 100644 --- a/libgo/go/regexp/all_test.go +++ b/libgo/go/regexp/all_test.go @@ -356,7 +356,7 @@ func BenchmarkMatchClass(b *testing.B) { func BenchmarkMatchClass_InRange(b *testing.B) { b.StopTimer() - // 'b' is betwen 'a' and 'c', so the charclass + // 'b' is between 'a' and 'c', so the charclass // range checking is no help here. x := strings.Repeat("bbbb", 20) + "c" re := MustCompile("[ac]") diff --git a/libgo/go/regexp/regexp.go b/libgo/go/regexp/regexp.go index e3221ac9d68..e8d4c087cf8 100644 --- a/libgo/go/regexp/regexp.go +++ b/libgo/go/regexp/regexp.go @@ -87,16 +87,16 @@ func (e Error) String() string { // Error codes returned by failures to parse an expression. var ( - ErrInternal = Error("internal error") - ErrUnmatchedLpar = Error("unmatched '('") - ErrUnmatchedRpar = Error("unmatched ')'") - ErrUnmatchedLbkt = Error("unmatched '['") - ErrUnmatchedRbkt = Error("unmatched ']'") - ErrBadRange = Error("bad range in character class") - ErrExtraneousBackslash = Error("extraneous backslash") - ErrBadClosure = Error("repeated closure (**, ++, etc.)") - ErrBareClosure = Error("closure applies to nothing") - ErrBadBackslash = Error("illegal backslash escape") + ErrInternal = Error("regexp: internal error") + ErrUnmatchedLpar = Error("regexp: unmatched '('") + ErrUnmatchedRpar = Error("regexp: unmatched ')'") + ErrUnmatchedLbkt = Error("regexp: unmatched '['") + ErrUnmatchedRbkt = Error("regexp: unmatched ']'") + ErrBadRange = Error("regexp: bad range in character class") + ErrExtraneousBackslash = Error("regexp: extraneous backslash") + ErrBadClosure = Error("regexp: repeated closure (**, ++, etc.)") + ErrBareClosure = Error("regexp: closure applies to nothing") + ErrBadBackslash = Error("regexp: illegal backslash escape") ) const ( @@ -158,6 +158,7 @@ func (i *instr) print() { // Regexp is the representation of a compiled regular expression. // The public interface is entirely through methods. +// A Regexp is safe for concurrent use by multiple goroutines. type Regexp struct { expr string // the original expression prefix string // initial plain text string -- cgit v1.2.1