Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08fd6ff

Browse files
committed
Sync regex code with Tcl 8.5.11.
Sync our regex code with upstream changes since last time we did this,which was Tcl 8.5.0 (see commitdf1e965).There are no functional changes here; the main point is just to lay downa commit-log marker that somebody has looked at this recently, and to dowhat we can to keep the two codebases comparable.
1 parent06d9afa commit08fd6ff

File tree

3 files changed

+20
-35
lines changed

3 files changed

+20
-35
lines changed

‎src/backend/regex/regc_locale.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,15 +499,15 @@ cclass(struct vars * v,/* context */
499499
{
500500
size_tlen;
501501
structcvec*cv=NULL;
502-
constchar**namePtr;
502+
constchar*const*namePtr;
503503
inti,
504504
index;
505505

506506
/*
507507
* The following arrays define the valid character class names.
508508
*/
509509

510-
staticconstchar*classNames[]= {
510+
staticconstchar*constclassNames[]= {
511511
"alnum","alpha","ascii","blank","cntrl","digit","graph",
512512
"lower","print","punct","space","upper","xdigit",NULL
513513
};

‎src/backend/regex/rege_dfa.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -272,36 +272,35 @@ static struct dfa *
272272
newdfa(structvars*v,
273273
structcnfa*cnfa,
274274
structcolormap*cm,
275-
structsmalldfa*small)/* preallocated space, may be NULL */
275+
structsmalldfa*sml)/* preallocated space, may be NULL */
276276
{
277277
structdfa*d;
278278
size_tnss=cnfa->nstates*2;
279279
intwordsper= (cnfa->nstates+UBITS-1) /UBITS;
280-
structsmalldfa*smallwas=small;
280+
structsmalldfa*smallwas=sml;
281281

282282
assert(cnfa!=NULL&&cnfa->nstates!=0);
283283

284284
if (nss <=FEWSTATES&&cnfa->ncolors <=FEWCOLORS)
285285
{
286286
assert(wordsper==1);
287-
if (small==NULL)
287+
if (sml==NULL)
288288
{
289-
small= (structsmalldfa*)MALLOC(
290-
sizeof(structsmalldfa));
291-
if (small==NULL)
289+
sml= (structsmalldfa*)MALLOC(sizeof(structsmalldfa));
290+
if (sml==NULL)
292291
{
293292
ERR(REG_ESPACE);
294293
returnNULL;
295294
}
296295
}
297-
d=&small->dfa;
298-
d->ssets=small->ssets;
299-
d->statesarea=small->statesarea;
296+
d=&sml->dfa;
297+
d->ssets=sml->ssets;
298+
d->statesarea=sml->statesarea;
300299
d->work=&d->statesarea[nss];
301-
d->outsarea=small->outsarea;
302-
d->incarea=small->incarea;
300+
d->outsarea=sml->outsarea;
301+
d->incarea=sml->incarea;
303302
d->cptsmalloced=0;
304-
d->mallocarea= (smallwas==NULL) ? (char*)small :NULL;
303+
d->mallocarea= (smallwas==NULL) ? (char*)sml :NULL;
305304
}
306305
else
307306
{

‎src/backend/regex/regexec.c

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ static intdissect(struct vars *, struct subre *, chr *, chr *);
141141
staticintcondissect(structvars*,structsubre*,chr*,chr*);
142142
staticintaltdissect(structvars*,structsubre*,chr*,chr*);
143143
staticintcdissect(structvars*,structsubre*,chr*,chr*);
144-
staticintccaptdissect(structvars*,structsubre*,chr*,chr*);
145144
staticintccondissect(structvars*,structsubre*,chr*,chr*);
146145
staticintcrevdissect(structvars*,structsubre*,chr*,chr*);
147146
staticintcbrdissect(structvars*,structsubre*,chr*,chr*);
@@ -708,6 +707,8 @@ cdissect(struct vars * v,
708707
chr*begin,/* beginning of relevant substring */
709708
chr*end)/* end of same */
710709
{
710+
inter;
711+
711712
assert(t!=NULL);
712713
MDEBUG(("cdissect %ld-%ld %c\n",LOFF(begin),LOFF(end),t->op));
713714

@@ -727,31 +728,16 @@ cdissect(struct vars * v,
727728
returnccondissect(v,t,begin,end);
728729
case'(':/* capturing */
729730
assert(t->left!=NULL&&t->right==NULL);
730-
returnccaptdissect(v,t,begin,end);
731+
assert(t->subno>0);
732+
er=cdissect(v,t->left,begin,end);
733+
if (er==REG_OKAY)
734+
subset(v,t,begin,end);
735+
returner;
731736
default:
732737
returnREG_ASSERT;
733738
}
734739
}
735740

736-
/*
737-
* ccaptdissect - capture subexpression matches (with complications)
738-
*/
739-
staticint/* regexec return code */
740-
ccaptdissect(structvars*v,
741-
structsubre*t,
742-
chr*begin,/* beginning of relevant substring */
743-
chr*end)/* end of same */
744-
{
745-
inter;
746-
747-
assert(t->subno>0);
748-
749-
er=cdissect(v,t->left,begin,end);
750-
if (er==REG_OKAY)
751-
subset(v,t,begin,end);
752-
returner;
753-
}
754-
755741
/*
756742
* ccondissect - concatenation subexpression matches (with complications)
757743
* The retry memory stores the offset of the trial midpoint from begin,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp