mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
commiting a some fixes and debug done yesterday in the London airport.
* xmlregexp.c: commiting a some fixes and debug done yesterday in the London airport. Daniel
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Wed Oct 19 16:53:47 BST 2005 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* xmlregexp.c: commiting a some fixes and debug done yesterday in
|
||||||
|
the London airport.
|
||||||
|
|
||||||
Thu Oct 20 12:54:23 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
|
Thu Oct 20 12:54:23 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
|
||||||
|
|
||||||
* xmlschemas.c: Removed creation of a temporary parser context
|
* xmlschemas.c: Removed creation of a temporary parser context
|
||||||
|
29
xmlregexp.c
29
xmlregexp.c
@ -1464,6 +1464,14 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from,
|
|||||||
* Generate an epsilon transition to link to the target
|
* Generate an epsilon transition to link to the target
|
||||||
*/
|
*/
|
||||||
xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to);
|
xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to);
|
||||||
|
#ifdef DV
|
||||||
|
} else if ((to == NULL) && (atom->quant != XML_REGEXP_QUANT_RANGE) &&
|
||||||
|
(atom->quant != XML_REGEXP_QUANT_ONCE)) {
|
||||||
|
to = xmlRegNewState(ctxt);
|
||||||
|
xmlRegStatePush(ctxt, to);
|
||||||
|
ctxt->state = to;
|
||||||
|
xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
switch (atom->quant) {
|
switch (atom->quant) {
|
||||||
case XML_REGEXP_QUANT_OPT:
|
case XML_REGEXP_QUANT_OPT:
|
||||||
@ -2160,7 +2168,7 @@ xmlFARecurseDeterminism(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state,
|
|||||||
to, atom);
|
to, atom);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
t1->nd = 1;
|
/* t1->nd = 1; */
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -2214,7 +2222,7 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
|
|||||||
* will have to be handled separately
|
* will have to be handled separately
|
||||||
*/
|
*/
|
||||||
if (t1->atom == NULL) {
|
if (t1->atom == NULL) {
|
||||||
t1->nd = 1;
|
/* t1->nd = 1; */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (t1->to == -1) /* eliminated */
|
if (t1->to == -1) /* eliminated */
|
||||||
@ -2278,10 +2286,11 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
|
|||||||
/* don't shortcut the computation so all non deterministic
|
/* don't shortcut the computation so all non deterministic
|
||||||
transition get marked down
|
transition get marked down
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
return(0); */
|
return(0);
|
||||||
|
*/
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
t1->nd = 1;
|
t1->nd = 1;
|
||||||
t2->nd = 1;
|
/* t2->nd = 1; */
|
||||||
last = t1;
|
last = t1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2873,6 +2882,14 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) {
|
|||||||
if ((trans->nd == 1) ||
|
if ((trans->nd == 1) ||
|
||||||
((trans->count >= 0) && (deter == 0) &&
|
((trans->count >= 0) && (deter == 0) &&
|
||||||
(exec->state->nbTrans > exec->transno + 1))) {
|
(exec->state->nbTrans > exec->transno + 1))) {
|
||||||
|
#ifdef DEBUG_REGEXP_EXEC
|
||||||
|
if (trans->nd == 1)
|
||||||
|
printf("Saving on nd transition atom %d for %c at %d\n",
|
||||||
|
trans->atom->no, codepoint, exec->index);
|
||||||
|
else
|
||||||
|
printf("Saving on counted transition count %d for %c at %d\n",
|
||||||
|
trans->count, codepoint, exec->index);
|
||||||
|
#endif
|
||||||
xmlFARegExecSave(exec);
|
xmlFARegExecSave(exec);
|
||||||
}
|
}
|
||||||
if (trans->counter >= 0) {
|
if (trans->counter >= 0) {
|
||||||
@ -2909,6 +2926,10 @@ rollback:
|
|||||||
* Failed to find a way out
|
* Failed to find a way out
|
||||||
*/
|
*/
|
||||||
exec->determinist = 0;
|
exec->determinist = 0;
|
||||||
|
#ifdef DEBUG_REGEXP_EXEC
|
||||||
|
printf("rollback from state %d on %d:%c\n", exec->state->no,
|
||||||
|
codepoint,codepoint);
|
||||||
|
#endif
|
||||||
xmlFARegExecRollBack(exec);
|
xmlFARegExecRollBack(exec);
|
||||||
}
|
}
|
||||||
progress:
|
progress:
|
||||||
|
Reference in New Issue
Block a user