Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
3e51ae49
Commit
3e51ae49
authored
Jan 30, 2010
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some comments that got mangled by pgindent.
parent
85d67ccd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
src/backend/regex/regcomp.c
src/backend/regex/regcomp.c
+21
-11
No files found.
src/backend/regex/regcomp.c
View file @
3e51ae49
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* $PostgreSQL: pgsql/src/backend/regex/regcomp.c,v 1.4
6 2008/02/14 17:33:37
tgl Exp $
* $PostgreSQL: pgsql/src/backend/regex/regcomp.c,v 1.4
7 2010/01/30 04:18:00
tgl Exp $
*
*
*/
*/
...
@@ -1012,8 +1012,10 @@ parseqatom(struct vars * v,
...
@@ -1012,8 +1012,10 @@ parseqatom(struct vars * v,
}
}
/*
/*
* hard part: something messy That is, capturing parens, back reference,
* hard part: something messy
* short/long clash, or an atom with substructure containing one of those.
*
* That is, capturing parens, back reference, short/long clash, or an atom
* with substructure containing one of those.
*/
*/
/* now we'll need a subre for the contents even if they're boring */
/* now we'll need a subre for the contents even if they're boring */
...
@@ -1023,13 +1025,15 @@ parseqatom(struct vars * v,
...
@@ -1023,13 +1025,15 @@ parseqatom(struct vars * v,
NOERR
();
NOERR
();
}
}
/*
/*
----------
*
prepare a general-purpose state skeleton
*
Prepare a general-purpose state skeleton.
*
*
* ---> [s] ---prefix---> [begin] ---atom---> [end] ----rest---> [rp] / /
* ---> [s] ---prefix---> [begin] ---atom---> [end] ----rest---> [rp]
* / /
* [lp] ----> [s2] ----bypass---------------------
* [lp] ----> [s2] ----bypass---------------------
*
*
* where bypass is an empty, and prefix is some repetitions of atom
* where bypass is an empty, and prefix is some repetitions of atom
*----------
*/
*/
s
=
newstate
(
v
->
nfa
);
/* first, new endpoints for the atom */
s
=
newstate
(
v
->
nfa
);
/* first, new endpoints for the atom */
s2
=
newstate
(
v
->
nfa
);
s2
=
newstate
(
v
->
nfa
);
...
@@ -1050,6 +1054,7 @@ parseqatom(struct vars * v,
...
@@ -1050,6 +1054,7 @@ parseqatom(struct vars * v,
t
=
subre
(
v
,
'.'
,
COMBINE
(
qprefer
,
atom
->
flags
),
lp
,
rp
);
t
=
subre
(
v
,
'.'
,
COMBINE
(
qprefer
,
atom
->
flags
),
lp
,
rp
);
t
->
left
=
atom
;
t
->
left
=
atom
;
atomp
=
&
t
->
left
;
atomp
=
&
t
->
left
;
/* here we should recurse... but we must postpone that to the end */
/* here we should recurse... but we must postpone that to the end */
/* split top into prefix and remaining */
/* split top into prefix and remaining */
...
@@ -1064,9 +1069,12 @@ parseqatom(struct vars * v,
...
@@ -1064,9 +1069,12 @@ parseqatom(struct vars * v,
assert
(
atom
->
begin
->
nouts
==
1
);
/* just the EMPTY */
assert
(
atom
->
begin
->
nouts
==
1
);
/* just the EMPTY */
delsub
(
v
->
nfa
,
atom
->
begin
,
atom
->
end
);
delsub
(
v
->
nfa
,
atom
->
begin
,
atom
->
end
);
assert
(
v
->
subs
[
subno
]
!=
NULL
);
assert
(
v
->
subs
[
subno
]
!=
NULL
);
/* and here's why the recursion got postponed: it must */
/* wait until the skeleton is filled in, because it may */
/*
/* hit a backref that wants to copy the filled-in skeleton */
* And here's why the recursion got postponed: it must wait until the
* skeleton is filled in, because it may hit a backref that wants to
* copy the filled-in skeleton.
*/
dupnfa
(
v
->
nfa
,
v
->
subs
[
subno
]
->
begin
,
v
->
subs
[
subno
]
->
end
,
dupnfa
(
v
->
nfa
,
v
->
subs
[
subno
]
->
begin
,
v
->
subs
[
subno
]
->
end
,
atom
->
begin
,
atom
->
end
);
atom
->
begin
,
atom
->
end
);
NOERR
();
NOERR
();
...
@@ -1108,8 +1116,10 @@ parseqatom(struct vars * v,
...
@@ -1108,8 +1116,10 @@ parseqatom(struct vars * v,
}
}
else
else
{
{
/* turn x{m,n} into x{m-1,n-1}x, with capturing */
/*
/* parens in only second x */
* Turn x{m,n} into x{m-1,n-1}x, with capturing parens in only the
* second x
*/
dupnfa
(
v
->
nfa
,
atom
->
begin
,
atom
->
end
,
s
,
atom
->
begin
);
dupnfa
(
v
->
nfa
,
atom
->
begin
,
atom
->
end
,
s
,
atom
->
begin
);
assert
(
m
>=
1
&&
m
!=
INFINITY
&&
n
>=
1
);
assert
(
m
>=
1
&&
m
!=
INFINITY
&&
n
>=
1
);
repeat
(
v
,
s
,
atom
->
begin
,
m
-
1
,
(
n
==
INFINITY
)
?
n
:
n
-
1
);
repeat
(
v
,
s
,
atom
->
begin
,
m
-
1
,
(
n
==
INFINITY
)
?
n
:
n
-
1
);
...
...
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