tDOM

Check-in [1c292a129a]
Login
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Save work.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wip
Files: files | file ages | folders
SHA3-256: 1c292a129a838af96b8c2a5e3e16f363a10feeda6243c1913fbc42d361b07331
User & Date: rolf 2020-03-20 19:27:36
Context
2020-03-22
02:04
wip check-in: 16e44b5f70 user: rolf tags: wip
2020-03-20
19:27
Save work. check-in: 1c292a129a user: rolf tags: wip
02:31
Working on more control over recovering for certain events. check-in: a07b509a44 user: rolf tags: wip
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/schema.c.

1422
1423
1424
1425
1426
1427
1428
1429




1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
....
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
....
1690
1691
1692
1693
1694
1695
1696





1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707





1708


1709
1710
1711
1712
1713
1714
1715
                ac++;
                hm = 0;
                continue;
            }
            if (!mayskip && mustMatch (cp->quants[ac], hm)) {
                if (recover (interp, sdata, MISSING_ELEMENT_MATCH_START, name,
                             namespace, NULL, ac)) {
                    if (!(sdata->recoverFlags & RECOVER_FLAG_IGNORE)) {




                        return 1;
                    }
                    /* This fail throu to skip to the next
                     * candidate. */
                } else {
                    return 0;
                }
            }
            ac++;
            hm = 0;
        }
        if (isName) {
            if (recover (interp, sdata, UNEXPECTED_ELEMENT, name, namespace,
                         NULL, 0)) {
................................................................................
                break;

            }
        }
        if (mayskip) break;
        if (recover (interp, sdata, MISSING_ELEMENT_MATCH_START, name,
                     namespace, NULL, cp->nc)) {
            if (!(sdata->recoverFlags & RECOVER_FLAG_IGNORE)) {
                return 1;
            }
            break;
        }
        return 0;
    }
    return -1;
}

static void *
................................................................................
            return TCL_ERROR;
        }
        pushToStack (sdata, pattern);
        return TCL_OK;
    }

    /* The normal case: we're inside the tree */





    rc = matchElementStart (interp, sdata, (char *) namePtr, namespacePtr);
    while (rc == -1) {
        popStack (sdata);
        rc = matchElementStart (interp, sdata, (char *) namePtr, namespacePtr);
    };
    if (rc) {
        DBG(
            fprintf (stderr, "probeElement: element '%s' match\n", name);
            serializeStack (sdata);
            fprintf (stderr, "\n");
            );





        return TCL_OK;


    }
    DBG(
        fprintf (stderr, "element '%s' DOESN'T match\n", name);
        serializeStack (sdata);
        fprintf (stderr, "\n");
        );
    if (!sdata->evalError) {






|
>
>
>
>
|
|
<
<
<
|
<







 







<
|
<
<







 







>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
|
>
>







1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435



1436

1437
1438
1439
1440
1441
1442
1443
....
1526
1527
1528
1529
1530
1531
1532

1533


1534
1535
1536
1537
1538
1539
1540
....
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
                ac++;
                hm = 0;
                continue;
            }
            if (!mayskip && mustMatch (cp->quants[ac], hm)) {
                if (recover (interp, sdata, MISSING_ELEMENT_MATCH_START, name,
                             namespace, NULL, ac)) {
                    if (sdata->recoverFlags & RECOVER_FLAG_IGNORE) {
                        /* We pretend the ac content particel had
                         * matched. */
                        updateStack (sdata, cp, ac);
                    }
                    return 1;
                }



                return 0;

            }
            ac++;
            hm = 0;
        }
        if (isName) {
            if (recover (interp, sdata, UNEXPECTED_ELEMENT, name, namespace,
                         NULL, 0)) {
................................................................................
                break;

            }
        }
        if (mayskip) break;
        if (recover (interp, sdata, MISSING_ELEMENT_MATCH_START, name,
                     namespace, NULL, cp->nc)) {

            return 1;


        }
        return 0;
    }
    return -1;
}

static void *
................................................................................
            return TCL_ERROR;
        }
        pushToStack (sdata, pattern);
        return TCL_OK;
    }

    /* The normal case: we're inside the tree */
    /* In case of recovering we unwind the call statck to have updated
     * stack elements, to be able to pretend, we have seen a mandatory
     * element. But with the so reached stack the current open element
     * has to probed again. */
    while (1) {
        rc = matchElementStart (interp, sdata, (char *) namePtr, namespacePtr);
        while (rc == -1) {
            popStack (sdata);
            rc = matchElementStart (interp, sdata, (char *) namePtr, namespacePtr);
        };
        if (rc) {
            DBG(
                fprintf (stderr, "probeElement: element '%s' match\n", name);
                serializeStack (sdata);
                fprintf (stderr, "\n");
                );
            if (sdata->recoverFlags & RECOVER_FLAG_IGNORE) {
                fprintf (stderr, "HIER\n");
                sdata->recoverFlags &= ~RECOVER_FLAG_IGNORE;
                continue;
            }
            return TCL_OK;
        }
        break;
    }
    DBG(
        fprintf (stderr, "element '%s' DOESN'T match\n", name);
        serializeStack (sdata);
        fprintf (stderr, "\n");
        );
    if (!sdata->evalError) {