aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/regexp
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-09-16 15:47:21 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-09-16 15:47:21 +0000
commitadb0401dac41c81571722312d4586b2693f95aa6 (patch)
treeea2b52e3c258d6b6d9356977c683c7f72a4a5fd5 /libgo/go/regexp
parent5548ca3540bccbc908a45942896d635ea5f1c23f (diff)
downloadgcc-adb0401dac41c81571722312d4586b2693f95aa6.zip
gcc-adb0401dac41c81571722312d4586b2693f95aa6.tar.gz
gcc-adb0401dac41c81571722312d4586b2693f95aa6.tar.bz2
Update Go library to r60.
From-SVN: r178910
Diffstat (limited to 'libgo/go/regexp')
-rw-r--r--libgo/go/regexp/all_test.go2
-rw-r--r--libgo/go/regexp/regexp.go21
2 files changed, 12 insertions, 11 deletions
diff --git a/libgo/go/regexp/all_test.go b/libgo/go/regexp/all_test.go
index c7ee4c8..71edc4d 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 e3221ac..e8d4c08 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