]> Cypherpunks repositories - gostls13.git/commitdiff
regexp: add available godoc link
authorcui fliter <imcusg@gmail.com>
Fri, 3 Nov 2023 11:41:55 +0000 (19:41 +0800)
committerGopher Robot <gobot@golang.org>
Mon, 26 Feb 2024 20:50:01 +0000 (20:50 +0000)
Signed-off-by: cui fliter <imcusg@gmail.com>
Change-Id: I85339293d4cfb691125f991ec7162e9be186efdc
Reviewed-on: https://go-review.googlesource.com/c/go/+/539599
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>

src/regexp/regexp.go
src/regexp/syntax/prog.go

index 462f235b1bb12fea85a2b538474e9217764cd5c7..d1218ad0e872d00211964a7d17e02288d9db90e9 100644 (file)
@@ -1074,7 +1074,7 @@ func (re *Regexp) FindReaderSubmatchIndex(r io.RuneReader) []int {
 
 const startSize = 10 // The size at which to start a slice in the 'All' routines.
 
-// FindAll is the 'All' version of Find; it returns a slice of all successive
+// FindAll is the 'All' version of [Regexp.Find]; it returns a slice of all successive
 // matches of the expression, as defined by the 'All' description in the
 // package comment.
 // A return value of nil indicates no match.
index d69ae1a12d2d0b3cd9f0fe8cd9c5e29e417c3d42..6a3705ec8f9090ac0f68b8773c6293459430bd22 100644 (file)
@@ -191,7 +191,7 @@ Loop:
 const noMatch = -1
 
 // MatchRune reports whether the instruction matches (and consumes) r.
-// It should only be called when i.Op == InstRune.
+// It should only be called when i.Op == [InstRune].
 func (i *Inst) MatchRune(r rune) bool {
        return i.MatchRunePos(r) != noMatch
 }
@@ -200,7 +200,7 @@ func (i *Inst) MatchRune(r rune) bool {
 // If so, MatchRunePos returns the index of the matching rune pair
 // (or, when len(i.Rune) == 1, rune singleton).
 // If not, MatchRunePos returns -1.
-// MatchRunePos should only be called when i.Op == InstRune.
+// MatchRunePos should only be called when i.Op == [InstRune].
 func (i *Inst) MatchRunePos(r rune) int {
        rune := i.Rune
 
@@ -262,7 +262,7 @@ func (i *Inst) MatchRunePos(r rune) int {
 
 // MatchEmptyWidth reports whether the instruction matches
 // an empty string between the runes before and after.
-// It should only be called when i.Op == InstEmptyWidth.
+// It should only be called when i.Op == [InstEmptyWidth].
 func (i *Inst) MatchEmptyWidth(before rune, after rune) bool {
        switch EmptyOp(i.Arg) {
        case EmptyBeginLine: