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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
compile.go
src/pkg/exp/regexp/syntax/compile.go
+4
-0
prog.go
src/pkg/exp/regexp/syntax/prog.go
+3
-2
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
...
...
@@ -10,8 +10,9 @@ import (
// A Prog is a compiled regular expression program.
type
Prog
struct
{
Inst
[]
Inst
Start
int
// index of start instruction
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