mirror of
https://git.checksum.fail/alec/mujs.git
synced 2026-06-16 19:09:40 +03:00
Bump VERSION to commit e892c9f
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
commit 0b4ed7e4ba37030fdd00f6a17b6de75cd7d7954b
|
commit e892c9fdbbddba94e52f656ccb378ed4885e30cc
|
||||||
|
|||||||
+4
-2
@@ -67,7 +67,8 @@ void js_RegExp_prototype_exec(js_State *J, js_Regexp *re, const char *text)
|
|||||||
}
|
}
|
||||||
if (re->last > 0) {
|
if (re->last > 0) {
|
||||||
haystack = text + re->last;
|
haystack = text + re->last;
|
||||||
opts |= REG_NOTBOL;
|
if (!(re->flags & JS_REGEXP_M) || haystack[-1] != '\n')
|
||||||
|
opts |= REG_NOTBOL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +116,8 @@ static void Rp_test(js_State *J)
|
|||||||
}
|
}
|
||||||
if (re->last > 0) {
|
if (re->last > 0) {
|
||||||
text += re->last;
|
text += re->last;
|
||||||
opts |= REG_NOTBOL;
|
if (!(re->flags & JS_REGEXP_M) || text[-1] != '\n')
|
||||||
|
opts |= REG_NOTBOL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-3
@@ -417,6 +417,11 @@ static void Sp_toUpperCase(js_State *J)
|
|||||||
js_free(J, dst);
|
js_free(J, dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int isbol(js_Regexp *re, const char *text, const char *a)
|
||||||
|
{
|
||||||
|
return a == text || ((re->flags & JS_REGEXP_M) && a[-1] == '\n');
|
||||||
|
}
|
||||||
|
|
||||||
static int istrim(int c)
|
static int istrim(int c)
|
||||||
{
|
{
|
||||||
return c == 0x9 || c == 0xB || c == 0xC || c == 0x20 || c == 0xA0 || c == 0xFEFF ||
|
return c == 0x9 || c == 0xB || c == 0xC || c == 0x20 || c == 0xA0 || c == 0xFEFF ||
|
||||||
@@ -492,7 +497,7 @@ static void Sp_match(js_State *J)
|
|||||||
a = text;
|
a = text;
|
||||||
e = text + strlen(text);
|
e = text + strlen(text);
|
||||||
while (a <= e) {
|
while (a <= e) {
|
||||||
if (js_doregexec(J, re->prog, a, &m, a > text ? REG_NOTBOL : 0))
|
if (js_doregexec(J, re->prog, a, &m, isbol(re, text, a) ? 0 : REG_NOTBOL))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
b = m.sub[0].sp;
|
b = m.sub[0].sp;
|
||||||
@@ -625,7 +630,7 @@ loop:
|
|||||||
else
|
else
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (!js_doregexec(J, re->prog, source, &m, REG_NOTBOL))
|
if (!js_doregexec(J, re->prog, source, &m, isbol(re, source0, source) ? 0 : REG_NOTBOL))
|
||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -740,7 +745,7 @@ static void Sp_split_regexp(js_State *J)
|
|||||||
|
|
||||||
p = a = text;
|
p = a = text;
|
||||||
while (a < e) {
|
while (a < e) {
|
||||||
if (js_doregexec(J, re->prog, a, &m, a > text ? REG_NOTBOL : 0))
|
if (js_doregexec(J, re->prog, a, &m, isbol(re, text, a) ? 0 : REG_NOTBOL))
|
||||||
break; /* no match */
|
break; /* no match */
|
||||||
|
|
||||||
b = m.sub[0].sp;
|
b = m.sub[0].sp;
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
#define REG_MAXPROG (32 << 10)
|
#define REG_MAXPROG (32 << 10)
|
||||||
#endif
|
#endif
|
||||||
#ifndef REG_MAXREC
|
#ifndef REG_MAXREC
|
||||||
#define REG_MAXREC 1024
|
#define REG_MAXREC 4096
|
||||||
#endif
|
#endif
|
||||||
#ifndef REG_MAXSPAN
|
#ifndef REG_MAXSPAN
|
||||||
#define REG_MAXSPAN 64
|
#define REG_MAXSPAN 64
|
||||||
|
|||||||
Reference in New Issue
Block a user