diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-16 15:47:21 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-16 15:47:21 +0000 |
commit | 49b4e44b7d540fa846d353b10237848a67789cbf (patch) | |
tree | ea2b52e3c258d6b6d9356977c683c7f72a4a5fd5 /libgo/go/regexp | |
parent | 82ceb8f6a88a0193971f53e0571e017f2764f7d7 (diff) | |
download | gcc-49b4e44b7d540fa846d353b10237848a67789cbf.tar.gz |
Update Go library to r60.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178910 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/regexp')
-rw-r--r-- | libgo/go/regexp/all_test.go | 2 | ||||
-rw-r--r-- | libgo/go/regexp/regexp.go | 21 |
2 files changed, 12 insertions, 11 deletions
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 |