Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
e3a77347
Commit
e3a77347
authored
Jul 13, 2011
by
Sam Thorogood
Committed by
Russ Cox
Jul 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exp/regexp/syntax: add Prog.NumCap
R=rsc, r CC=golang-dev
https://golang.org/cl/4662083
parent
4c986d86
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
compile.go
src/pkg/exp/regexp/syntax/compile.go
+4
-0
prog.go
src/pkg/exp/regexp/syntax/prog.go
+1
-0
No files found.
src/pkg/exp/regexp/syntax/compile.go
View file @
e3a77347
...
...
@@ -185,6 +185,10 @@ func (c *compiler) cap(arg uint32) frag {
f
:=
c
.
inst
(
InstCapture
)
f
.
out
=
patchList
(
f
.
i
<<
1
)
c
.
p
.
Inst
[
f
.
i
]
.
Arg
=
arg
if
c
.
p
.
NumCap
<
int
(
arg
)
+
1
{
c
.
p
.
NumCap
=
int
(
arg
)
+
1
}
return
f
}
...
...
src/pkg/exp/regexp/syntax/prog.go
View file @
e3a77347
...
...
@@ -12,6 +12,7 @@ import (
type
Prog
struct
{
Inst
[]
Inst
Start
int
// index of start instruction
NumCap
int
// number of InstCapture insts in re
}
// An InstOp is an instruction opcode.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment