]> Cypherpunks.ru repositories - gostls13.git/commitdiff
regexp/syntax: rename ErrInvalidDepth to ErrNestingDepth
authorIan Lance Taylor <iant@golang.org>
Fri, 22 Apr 2022 21:41:57 +0000 (14:41 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 22 Apr 2022 22:35:03 +0000 (22:35 +0000)
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>
api/next/51684.txt
src/regexp/syntax/parse.go

index f35d13f088ad8610217f9e64f8f9b5f49f4f9ad4..b8a0645256c816f7def8ee32b9b458e5319f907c 100644 (file)
@@ -1,2 +1,2 @@
-pkg regexp/syntax, const ErrInvalidDepth = "expression nests too deeply" #51684
-pkg regexp/syntax, const ErrInvalidDepth ErrorCode #51684
+pkg regexp/syntax, const ErrNestingDepth = "expression nests too deeply" #51684
+pkg regexp/syntax, const ErrNestingDepth ErrorCode #51684
index 1462f4c082987d7ce20255ed04c185d42f8cde03..350f297e5b328bad66961a882d0df2ddd272ffb2 100644 (file)
@@ -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}
                }
        }()