aboutsummaryrefslogtreecommitdiffstats
path: root/xmlregexp.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2005-10-20 15:55:25 +0000
committerDaniel Veillard <veillard@src.gnome.org>2005-10-20 15:55:25 +0000
commitaa62201290b6f3f3305f0fff504faf89c286a360 (patch)
tree853f3fe229f0aa72ba32de8534443cd94b2be276 /xmlregexp.c
parentf326e77cb1d61f73208b0b62b5c51e31ed3f126b (diff)
downloadandroid_external_libxml2-aa62201290b6f3f3305f0fff504faf89c286a360.tar.gz
android_external_libxml2-aa62201290b6f3f3305f0fff504faf89c286a360.tar.bz2
android_external_libxml2-aa62201290b6f3f3305f0fff504faf89c286a360.zip
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
Diffstat (limited to 'xmlregexp.c')
-rw-r--r--xmlregexp.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/xmlregexp.c b/xmlregexp.c
index 9c76ef60..dea09771 100644
--- a/xmlregexp.c
+++ b/xmlregexp.c
@@ -1464,6 +1464,14 @@ xmlFAGenerateTransitions(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr from,
* Generate an epsilon transition to link to the target
*/
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) {
case XML_REGEXP_QUANT_OPT:
@@ -2160,7 +2168,7 @@ xmlFARecurseDeterminism(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state,
to, atom);
if (res == 0) {
ret = 0;
- t1->nd = 1;
+ /* t1->nd = 1; */
}
continue;
}
@@ -2214,7 +2222,7 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
* will have to be handled separately
*/
if (t1->atom == NULL) {
- t1->nd = 1;
+ /* t1->nd = 1; */
continue;
}
if (t1->to == -1) /* eliminated */
@@ -2278,10 +2286,11 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
/* don't shortcut the computation so all non deterministic
transition get marked down
if (ret == 0)
- return(0); */
+ return(0);
+ */
if (ret == 0) {
t1->nd = 1;
- t2->nd = 1;
+ /* t2->nd = 1; */
last = t1;
}
}
@@ -2873,6 +2882,14 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) {
if ((trans->nd == 1) ||
((trans->count >= 0) && (deter == 0) &&
(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);
}
if (trans->counter >= 0) {
@@ -2909,6 +2926,10 @@ rollback:
* Failed to find a way out
*/
exec->determinist = 0;
+#ifdef DEBUG_REGEXP_EXEC
+ printf("rollback from state %d on %d:%c\n", exec->state->no,
+ codepoint,codepoint);
+#endif
xmlFARegExecRollBack(exec);
}
progress: