Grammalecte  Diff

Differences From Artifact [bb46156b4b]:

To Artifact [cba83b3853]:


1
2
3
4
5


6
7
8
9
10
11
12
1
2
3


4
5
6
7
8
9
10
11
12



-
-
+
+








// regex

if (RegExp.prototype.__grammalecte__ === undefined) {
    RegExp.prototype._exec2 = function (sText, aGroupsPos, aNegLookBefore=null) {
if (RegExp.prototype.grammalecte === undefined) {
    RegExp.prototype.gl_exec2 = function (sText, aGroupsPos, aNegLookBefore=null) {
        let m;
        while ((m = this.exec(sText)) !== null) {
            // we have to iterate over sText here too
            // because first match doesn’t imply it’s a valid match according to negative lookbefore assertions,
            // and even if first match is finally invalid, it doesn’t mean the following eligible matchs would be invalid too.
            if (aNegLookBefore !== null) {
                // check negative look before assertions
72
73
74
75
76
77
78
79

80
72
73
74
75
76
77
78

79
80







-
+

                    m.end.push(iPos + subm.length);
                }
            }
        }
        return m;
    }

    RegExp.prototype.__grammalecte__ = true;
    RegExp.prototype.grammalecte = true;
}