aboutsummaryrefslogtreecommitdiff
path: root/src/regexp
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-04-22 14:41:57 -0700
committerGopher Robot <gobot@golang.org>2022-04-22 22:35:03 +0000
commit0bf545e51f5303ddedb0ea60f02ff221ac088fc7 (patch)
tree8056302ac5b4e744e86ea9b4a14b0ee6064f5405 /src/regexp
parent8e1a9c34ab7ae73f6c7d6fad10a37f1738a1e86a (diff)
downloadgo-0bf545e51f5303ddedb0ea60f02ff221ac088fc7.tar.gz
go-0bf545e51f5303ddedb0ea60f02ff221ac088fc7.zip
regexp/syntax: rename ErrInvalidDepth to ErrNestingDepth
The proposal accepted the name ErrNestingDepth. For #51684 Change-Id: I702365f19e5e1889dbcc3c971eecff68e0b08727 Reviewed-on: https://go-review.googlesource.com/c/go/+/401854 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'src/regexp')
-rw-r--r--src/regexp/syntax/parse.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/regexp/syntax/parse.go b/src/regexp/syntax/parse.go
index 1462f4c082..350f297e5b 100644
--- a/src/regexp/syntax/parse.go
+++ b/src/regexp/syntax/parse.go
@@ -43,7 +43,7 @@ const (
ErrMissingRepeatArgument ErrorCode = "missing argument to repetition operator"
ErrTrailingBackslash ErrorCode = "trailing backslash at end of expression"
ErrUnexpectedParen ErrorCode = "unexpected )"
- ErrInvalidDepth ErrorCode = "expression nests too deeply"
+ ErrNestingDepth ErrorCode = "expression nests too deeply"
)
func (e ErrorCode) String() string {
@@ -134,7 +134,7 @@ func (p *parser) checkHeight(re *Regexp) {
}
}
if p.calcHeight(re, true) > maxHeight {
- panic(ErrInvalidDepth)
+ panic(ErrNestingDepth)
}
}
@@ -762,8 +762,8 @@ func parse(s string, flags Flags) (_ *Regexp, err error) {
panic(r)
case nil:
// ok
- case ErrInvalidDepth:
- err = &Error{Code: ErrInvalidDepth, Expr: s}
+ case ErrNestingDepth:
+ err = &Error{Code: ErrNestingDepth, Expr: s}
}
}()