|
Karsten Hopp |
9be36a |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
9be36a |
Subject: Patch 7.3.1022
|
|
Karsten Hopp |
9be36a |
Fcc: outbox
|
|
Karsten Hopp |
9be36a |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
9be36a |
Mime-Version: 1.0
|
|
Karsten Hopp |
9be36a |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
9be36a |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
9be36a |
------------
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
Patch 7.3.1022
|
|
Karsten Hopp |
9be36a |
Problem: Compiler warning for shadowed variable. (John Little)
|
|
Karsten Hopp |
9be36a |
Solution: Move declaration, rename variables.
|
|
Karsten Hopp |
9be36a |
Files: src/regexp_nfa.c
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
*** ../vim-7.3.1021/src/regexp_nfa.c 2013-05-26 14:32:01.000000000 +0200
|
|
Karsten Hopp |
9be36a |
--- src/regexp_nfa.c 2013-05-26 14:50:27.000000000 +0200
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 604,610 ****
|
|
Karsten Hopp |
9be36a |
char_u *endp;
|
|
Karsten Hopp |
9be36a |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
9be36a |
char_u *old_regparse = regparse;
|
|
Karsten Hopp |
9be36a |
- int i;
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
int extra = 0;
|
|
Karsten Hopp |
9be36a |
int first;
|
|
Karsten Hopp |
9be36a |
--- 604,609 ----
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 827,850 ****
|
|
Karsten Hopp |
9be36a |
case 'u': /* %uabcd hex 4 */
|
|
Karsten Hopp |
9be36a |
case 'U': /* %U1234abcd hex 8 */
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
! int i;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
switch (c)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
! case 'd': i = getdecchrs(); break;
|
|
Karsten Hopp |
9be36a |
! case 'o': i = getoctchrs(); break;
|
|
Karsten Hopp |
9be36a |
! case 'x': i = gethexchrs(2); break;
|
|
Karsten Hopp |
9be36a |
! case 'u': i = gethexchrs(4); break;
|
|
Karsten Hopp |
9be36a |
! case 'U': i = gethexchrs(8); break;
|
|
Karsten Hopp |
9be36a |
! default: i = -1; break;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
! if (i < 0)
|
|
Karsten Hopp |
9be36a |
EMSG2_RET_FAIL(
|
|
Karsten Hopp |
9be36a |
_("E678: Invalid character after %s%%[dxouU]"),
|
|
Karsten Hopp |
9be36a |
reg_magic == MAGIC_ALL);
|
|
Karsten Hopp |
9be36a |
/* TODO: what if a composing character follows? */
|
|
Karsten Hopp |
9be36a |
! EMIT(i);
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
--- 826,849 ----
|
|
Karsten Hopp |
9be36a |
case 'u': /* %uabcd hex 4 */
|
|
Karsten Hopp |
9be36a |
case 'U': /* %U1234abcd hex 8 */
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
! int nr;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
switch (c)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
! case 'd': nr = getdecchrs(); break;
|
|
Karsten Hopp |
9be36a |
! case 'o': nr = getoctchrs(); break;
|
|
Karsten Hopp |
9be36a |
! case 'x': nr = gethexchrs(2); break;
|
|
Karsten Hopp |
9be36a |
! case 'u': nr = gethexchrs(4); break;
|
|
Karsten Hopp |
9be36a |
! case 'U': nr = gethexchrs(8); break;
|
|
Karsten Hopp |
9be36a |
! default: nr = -1; break;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
! if (nr < 0)
|
|
Karsten Hopp |
9be36a |
EMSG2_RET_FAIL(
|
|
Karsten Hopp |
9be36a |
_("E678: Invalid character after %s%%[dxouU]"),
|
|
Karsten Hopp |
9be36a |
reg_magic == MAGIC_ALL);
|
|
Karsten Hopp |
9be36a |
/* TODO: what if a composing character follows? */
|
|
Karsten Hopp |
9be36a |
! EMIT(nr);
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 1229,1234 ****
|
|
Karsten Hopp |
9be36a |
--- 1228,1235 ----
|
|
Karsten Hopp |
9be36a |
!= (plen = (*mb_ptr2len)(old_regparse))
|
|
Karsten Hopp |
9be36a |
|| utf_iscomposing(c)))
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
+ int i = 0;
|
|
Karsten Hopp |
9be36a |
+
|
|
Karsten Hopp |
9be36a |
/* A base character plus composing characters, or just one
|
|
Karsten Hopp |
9be36a |
* or more composing characters.
|
|
Karsten Hopp |
9be36a |
* This requires creating a separate atom as if enclosing
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 1237,1243 ****
|
|
Karsten Hopp |
9be36a |
* building the postfix form, not the NFA itself;
|
|
Karsten Hopp |
9be36a |
* a composing char could be: a, b, c, NFA_COMPOSING
|
|
Karsten Hopp |
9be36a |
* where 'b' and 'c' are chars with codes > 256. */
|
|
Karsten Hopp |
9be36a |
- i = 0;
|
|
Karsten Hopp |
9be36a |
for (;;)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
EMIT(c);
|
|
Karsten Hopp |
9be36a |
--- 1238,1243 ----
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 2923,2931 ****
|
|
Karsten Hopp |
9be36a |
regsub_T *submatch;
|
|
Karsten Hopp |
9be36a |
regsub_T *m;
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
- int c;
|
|
Karsten Hopp |
9be36a |
- int n;
|
|
Karsten Hopp |
9be36a |
- int i = 0;
|
|
Karsten Hopp |
9be36a |
int result;
|
|
Karsten Hopp |
9be36a |
int size = 0;
|
|
Karsten Hopp |
9be36a |
int match = FALSE;
|
|
Karsten Hopp |
9be36a |
--- 2923,2928 ----
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 2939,2944 ****
|
|
Karsten Hopp |
9be36a |
--- 2936,2942 ----
|
|
Karsten Hopp |
9be36a |
nfa_list_T *listtbl[2][2];
|
|
Karsten Hopp |
9be36a |
nfa_list_T *ll;
|
|
Karsten Hopp |
9be36a |
int listid = 1;
|
|
Karsten Hopp |
9be36a |
+ int listidx;
|
|
Karsten Hopp |
9be36a |
nfa_list_T *thislist;
|
|
Karsten Hopp |
9be36a |
nfa_list_T *nextlist;
|
|
Karsten Hopp |
9be36a |
nfa_list_T *neglist;
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3004,3010 ****
|
|
Karsten Hopp |
9be36a |
#define ADD_POS_NEG_STATE(node) \
|
|
Karsten Hopp |
9be36a |
ll = listtbl[result ? 1 : 0][node->negated]; \
|
|
Karsten Hopp |
9be36a |
if (ll != NULL) \
|
|
Karsten Hopp |
9be36a |
! addstate(ll, node->out , &t->sub, n, listid + 1, &match);
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
/*
|
|
Karsten Hopp |
9be36a |
--- 3002,3008 ----
|
|
Karsten Hopp |
9be36a |
#define ADD_POS_NEG_STATE(node) \
|
|
Karsten Hopp |
9be36a |
ll = listtbl[result ? 1 : 0][node->negated]; \
|
|
Karsten Hopp |
9be36a |
if (ll != NULL) \
|
|
Karsten Hopp |
9be36a |
! addstate(ll, node->out , &t->sub, clen, listid + 1, &match);
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
/*
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3012,3032 ****
|
|
Karsten Hopp |
9be36a |
*/
|
|
Karsten Hopp |
9be36a |
for (;;)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
9be36a |
if (has_mbyte)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
! c = (*mb_ptr2char)(reginput);
|
|
Karsten Hopp |
9be36a |
! n = (*mb_ptr2len)(reginput);
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
else
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
! c = *reginput;
|
|
Karsten Hopp |
9be36a |
! n = 1;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
! if (c == NUL)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
! n = 0;
|
|
Karsten Hopp |
9be36a |
go_to_nextline = FALSE;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
--- 3010,3033 ----
|
|
Karsten Hopp |
9be36a |
*/
|
|
Karsten Hopp |
9be36a |
for (;;)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
+ int curc;
|
|
Karsten Hopp |
9be36a |
+ int clen;
|
|
Karsten Hopp |
9be36a |
+
|
|
Karsten Hopp |
9be36a |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
9be36a |
if (has_mbyte)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
! curc = (*mb_ptr2char)(reginput);
|
|
Karsten Hopp |
9be36a |
! clen = (*mb_ptr2len)(reginput);
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
else
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
! curc = *reginput;
|
|
Karsten Hopp |
9be36a |
! clen = 1;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
! if (curc == NUL)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
! clen = 0;
|
|
Karsten Hopp |
9be36a |
go_to_nextline = FALSE;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3040,3049 ****
|
|
Karsten Hopp |
9be36a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, "------------------------------------------\n");
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput);
|
|
Karsten Hopp |
9be36a |
! fprintf(log_fd, ">>> Advanced one character ... Current char is %c (code %d) \n", c, (int)c);
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, ">>> Thislist has %d states available: ", thislist->n);
|
|
Karsten Hopp |
9be36a |
! for (i = 0; i < thislist->n; i++)
|
|
Karsten Hopp |
9be36a |
! fprintf(log_fd, "%d ", abs(thislist->t[i].state->id));
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, "\n");
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
--- 3041,3054 ----
|
|
Karsten Hopp |
9be36a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, "------------------------------------------\n");
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput);
|
|
Karsten Hopp |
9be36a |
! fprintf(log_fd, ">>> Advanced one character ... Current char is %c (code %d) \n", curc, (int)curc);
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, ">>> Thislist has %d states available: ", thislist->n);
|
|
Karsten Hopp |
9be36a |
! {
|
|
Karsten Hopp |
9be36a |
! int i;
|
|
Karsten Hopp |
9be36a |
!
|
|
Karsten Hopp |
9be36a |
! for (i = 0; i < thislist->n; i++)
|
|
Karsten Hopp |
9be36a |
! fprintf(log_fd, "%d ", abs(thislist->t[i].state->id));
|
|
Karsten Hopp |
9be36a |
! }
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, "\n");
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3057,3072 ****
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
/* compute nextlist */
|
|
Karsten Hopp |
9be36a |
! for (i = 0; i < thislist->n || neglist->n > 0; ++i)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
if (neglist->n > 0)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
t = &neglist->t[0];
|
|
Karsten Hopp |
9be36a |
neglist->n--;
|
|
Karsten Hopp |
9be36a |
! i--;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
else
|
|
Karsten Hopp |
9be36a |
! t = &thislist->t[i];
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
#ifdef NFA_REGEXP_DEBUG_LOG
|
|
Karsten Hopp |
9be36a |
nfa_set_code(t->state->c);
|
|
Karsten Hopp |
9be36a |
--- 3062,3077 ----
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
/* compute nextlist */
|
|
Karsten Hopp |
9be36a |
! for (listidx = 0; listidx < thislist->n || neglist->n > 0; ++listidx)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
if (neglist->n > 0)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
t = &neglist->t[0];
|
|
Karsten Hopp |
9be36a |
neglist->n--;
|
|
Karsten Hopp |
9be36a |
! listidx--;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
else
|
|
Karsten Hopp |
9be36a |
! t = &thislist->t[listidx];
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
#ifdef NFA_REGEXP_DEBUG_LOG
|
|
Karsten Hopp |
9be36a |
nfa_set_code(t->state->c);
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3116,3122 ****
|
|
Karsten Hopp |
9be36a |
* the parent call. */
|
|
Karsten Hopp |
9be36a |
if (start->c == NFA_MOPEN + 0)
|
|
Karsten Hopp |
9be36a |
addstate_here(thislist, t->state->out, &t->sub, listid,
|
|
Karsten Hopp |
9be36a |
! &match, &i);
|
|
Karsten Hopp |
9be36a |
else
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
*m = t->sub;
|
|
Karsten Hopp |
9be36a |
--- 3121,3127 ----
|
|
Karsten Hopp |
9be36a |
* the parent call. */
|
|
Karsten Hopp |
9be36a |
if (start->c == NFA_MOPEN + 0)
|
|
Karsten Hopp |
9be36a |
addstate_here(thislist, t->state->out, &t->sub, listid,
|
|
Karsten Hopp |
9be36a |
! &match, &listidx);
|
|
Karsten Hopp |
9be36a |
else
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
*m = t->sub;
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3190,3196 ****
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
/* t->state->out1 is the corresponding END_INVISIBLE node */
|
|
Karsten Hopp |
9be36a |
addstate_here(thislist, t->state->out1->out, &t->sub,
|
|
Karsten Hopp |
9be36a |
! listid, &match, &i);
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
else
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
--- 3195,3201 ----
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
/* t->state->out1 is the corresponding END_INVISIBLE node */
|
|
Karsten Hopp |
9be36a |
addstate_here(thislist, t->state->out1->out, &t->sub,
|
|
Karsten Hopp |
9be36a |
! listid, &match, &listidx);
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
else
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3202,3221 ****
|
|
Karsten Hopp |
9be36a |
case NFA_BOL:
|
|
Karsten Hopp |
9be36a |
if (reginput == regline)
|
|
Karsten Hopp |
9be36a |
addstate_here(thislist, t->state->out, &t->sub, listid,
|
|
Karsten Hopp |
9be36a |
! &match, &i);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_EOL:
|
|
Karsten Hopp |
9be36a |
! if (c == NUL)
|
|
Karsten Hopp |
9be36a |
addstate_here(thislist, t->state->out, &t->sub, listid,
|
|
Karsten Hopp |
9be36a |
! &match, &i);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_BOW:
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
int bow = TRUE;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
! if (c == NUL)
|
|
Karsten Hopp |
9be36a |
bow = FALSE;
|
|
Karsten Hopp |
9be36a |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
9be36a |
else if (has_mbyte)
|
|
Karsten Hopp |
9be36a |
--- 3207,3226 ----
|
|
Karsten Hopp |
9be36a |
case NFA_BOL:
|
|
Karsten Hopp |
9be36a |
if (reginput == regline)
|
|
Karsten Hopp |
9be36a |
addstate_here(thislist, t->state->out, &t->sub, listid,
|
|
Karsten Hopp |
9be36a |
! &match, &listidx);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_EOL:
|
|
Karsten Hopp |
9be36a |
! if (curc == NUL)
|
|
Karsten Hopp |
9be36a |
addstate_here(thislist, t->state->out, &t->sub, listid,
|
|
Karsten Hopp |
9be36a |
! &match, &listidx);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_BOW:
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
int bow = TRUE;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
! if (curc == NUL)
|
|
Karsten Hopp |
9be36a |
bow = FALSE;
|
|
Karsten Hopp |
9be36a |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
9be36a |
else if (has_mbyte)
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3230,3242 ****
|
|
Karsten Hopp |
9be36a |
bow = FALSE;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
! else if (!vim_iswordc_buf(c, reg_buf)
|
|
Karsten Hopp |
9be36a |
|| (reginput > regline
|
|
Karsten Hopp |
9be36a |
&& vim_iswordc_buf(reginput[-1], reg_buf)))
|
|
Karsten Hopp |
9be36a |
bow = FALSE;
|
|
Karsten Hopp |
9be36a |
if (bow)
|
|
Karsten Hopp |
9be36a |
addstate_here(thislist, t->state->out, &t->sub, listid,
|
|
Karsten Hopp |
9be36a |
! &match, &i);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
--- 3235,3247 ----
|
|
Karsten Hopp |
9be36a |
bow = FALSE;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
! else if (!vim_iswordc_buf(curc, reg_buf)
|
|
Karsten Hopp |
9be36a |
|| (reginput > regline
|
|
Karsten Hopp |
9be36a |
&& vim_iswordc_buf(reginput[-1], reg_buf)))
|
|
Karsten Hopp |
9be36a |
bow = FALSE;
|
|
Karsten Hopp |
9be36a |
if (bow)
|
|
Karsten Hopp |
9be36a |
addstate_here(thislist, t->state->out, &t->sub, listid,
|
|
Karsten Hopp |
9be36a |
! &match, &listidx);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3260,3277 ****
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
else if (!vim_iswordc_buf(reginput[-1], reg_buf)
|
|
Karsten Hopp |
9be36a |
! || (reginput[0] != NUL && vim_iswordc_buf(c, reg_buf)))
|
|
Karsten Hopp |
9be36a |
eow = FALSE;
|
|
Karsten Hopp |
9be36a |
if (eow)
|
|
Karsten Hopp |
9be36a |
addstate_here(thislist, t->state->out, &t->sub, listid,
|
|
Karsten Hopp |
9be36a |
! &match, &i);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
9be36a |
case NFA_COMPOSING:
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
! int mc = c;
|
|
Karsten Hopp |
9be36a |
int len = 0;
|
|
Karsten Hopp |
9be36a |
nfa_state_T *end;
|
|
Karsten Hopp |
9be36a |
nfa_state_T *sta;
|
|
Karsten Hopp |
9be36a |
--- 3265,3283 ----
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
else if (!vim_iswordc_buf(reginput[-1], reg_buf)
|
|
Karsten Hopp |
9be36a |
! || (reginput[0] != NUL
|
|
Karsten Hopp |
9be36a |
! && vim_iswordc_buf(curc, reg_buf)))
|
|
Karsten Hopp |
9be36a |
eow = FALSE;
|
|
Karsten Hopp |
9be36a |
if (eow)
|
|
Karsten Hopp |
9be36a |
addstate_here(thislist, t->state->out, &t->sub, listid,
|
|
Karsten Hopp |
9be36a |
! &match, &listidx);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
9be36a |
case NFA_COMPOSING:
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
! int mc = curc;
|
|
Karsten Hopp |
9be36a |
int len = 0;
|
|
Karsten Hopp |
9be36a |
nfa_state_T *end;
|
|
Karsten Hopp |
9be36a |
nfa_state_T *sta;
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3286,3299 ****
|
|
Karsten Hopp |
9be36a |
/* Only match composing character(s), ignore base
|
|
Karsten Hopp |
9be36a |
* character. Used for ".{composing}" and "{composing}"
|
|
Karsten Hopp |
9be36a |
* (no preceding character). */
|
|
Karsten Hopp |
9be36a |
! len += mb_char2len(c);
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
if (ireg_icombine)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
/* If \Z was present, then ignore composing characters.
|
|
Karsten Hopp |
9be36a |
* When ignoring the base character this always matches. */
|
|
Karsten Hopp |
9be36a |
/* TODO: How about negated? */
|
|
Karsten Hopp |
9be36a |
! if (len == 0 && sta->c != c)
|
|
Karsten Hopp |
9be36a |
result = FAIL;
|
|
Karsten Hopp |
9be36a |
else
|
|
Karsten Hopp |
9be36a |
result = OK;
|
|
Karsten Hopp |
9be36a |
--- 3292,3305 ----
|
|
Karsten Hopp |
9be36a |
/* Only match composing character(s), ignore base
|
|
Karsten Hopp |
9be36a |
* character. Used for ".{composing}" and "{composing}"
|
|
Karsten Hopp |
9be36a |
* (no preceding character). */
|
|
Karsten Hopp |
9be36a |
! len += mb_char2len(mc);
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
if (ireg_icombine)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
/* If \Z was present, then ignore composing characters.
|
|
Karsten Hopp |
9be36a |
* When ignoring the base character this always matches. */
|
|
Karsten Hopp |
9be36a |
/* TODO: How about negated? */
|
|
Karsten Hopp |
9be36a |
! if (len == 0 && sta->c != curc)
|
|
Karsten Hopp |
9be36a |
result = FAIL;
|
|
Karsten Hopp |
9be36a |
else
|
|
Karsten Hopp |
9be36a |
result = OK;
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3312,3318 ****
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
/* We don't care about the order of composing characters.
|
|
Karsten Hopp |
9be36a |
* Get them into cchars[] first. */
|
|
Karsten Hopp |
9be36a |
! while (len < n)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
mc = mb_ptr2char(reginput + len);
|
|
Karsten Hopp |
9be36a |
cchars[ccount++] = mc;
|
|
Karsten Hopp |
9be36a |
--- 3318,3324 ----
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
/* We don't care about the order of composing characters.
|
|
Karsten Hopp |
9be36a |
* Get them into cchars[] first. */
|
|
Karsten Hopp |
9be36a |
! while (len < clen)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
mc = mb_ptr2char(reginput + len);
|
|
Karsten Hopp |
9be36a |
cchars[ccount++] = mc;
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3349,3355 ****
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NEWL:
|
|
Karsten Hopp |
9be36a |
if (!reg_line_lbr && REG_MULTI
|
|
Karsten Hopp |
9be36a |
! && c == NUL && reglnum <= reg_maxline)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
go_to_nextline = TRUE;
|
|
Karsten Hopp |
9be36a |
/* Pass -1 for the offset, which means taking the position
|
|
Karsten Hopp |
9be36a |
--- 3355,3361 ----
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NEWL:
|
|
Karsten Hopp |
9be36a |
if (!reg_line_lbr && REG_MULTI
|
|
Karsten Hopp |
9be36a |
! && curc == NUL && reglnum <= reg_maxline)
|
|
Karsten Hopp |
9be36a |
{
|
|
Karsten Hopp |
9be36a |
go_to_nextline = TRUE;
|
|
Karsten Hopp |
9be36a |
/* Pass -1 for the offset, which means taking the position
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3375,3409 ****
|
|
Karsten Hopp |
9be36a |
case NFA_CLASS_RETURN:
|
|
Karsten Hopp |
9be36a |
case NFA_CLASS_BACKSPACE:
|
|
Karsten Hopp |
9be36a |
case NFA_CLASS_ESCAPE:
|
|
Karsten Hopp |
9be36a |
! result = check_char_class(t->state->c, c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_END_NEG_RANGE:
|
|
Karsten Hopp |
9be36a |
/* This follows a series of negated nodes, like:
|
|
Karsten Hopp |
9be36a |
* CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */
|
|
Karsten Hopp |
9be36a |
! if (c > 0)
|
|
Karsten Hopp |
9be36a |
! addstate(nextlist, t->state->out, &t->sub, n, listid + 1,
|
|
Karsten Hopp |
9be36a |
! &match);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_ANY:
|
|
Karsten Hopp |
9be36a |
/* Any char except '\0', (end of input) does not match. */
|
|
Karsten Hopp |
9be36a |
! if (c > 0)
|
|
Karsten Hopp |
9be36a |
! addstate(nextlist, t->state->out, &t->sub, n, listid + 1,
|
|
Karsten Hopp |
9be36a |
! &match);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
/*
|
|
Karsten Hopp |
9be36a |
* Character classes like \a for alpha, \d for digit etc.
|
|
Karsten Hopp |
9be36a |
*/
|
|
Karsten Hopp |
9be36a |
case NFA_IDENT: /* \i */
|
|
Karsten Hopp |
9be36a |
! result = vim_isIDc(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_SIDENT: /* \I */
|
|
Karsten Hopp |
9be36a |
! result = !VIM_ISDIGIT(c) && vim_isIDc(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
--- 3381,3415 ----
|
|
Karsten Hopp |
9be36a |
case NFA_CLASS_RETURN:
|
|
Karsten Hopp |
9be36a |
case NFA_CLASS_BACKSPACE:
|
|
Karsten Hopp |
9be36a |
case NFA_CLASS_ESCAPE:
|
|
Karsten Hopp |
9be36a |
! result = check_char_class(t->state->c, curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_END_NEG_RANGE:
|
|
Karsten Hopp |
9be36a |
/* This follows a series of negated nodes, like:
|
|
Karsten Hopp |
9be36a |
* CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */
|
|
Karsten Hopp |
9be36a |
! if (curc > 0)
|
|
Karsten Hopp |
9be36a |
! addstate(nextlist, t->state->out, &t->sub, clen,
|
|
Karsten Hopp |
9be36a |
! listid + 1, &match);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_ANY:
|
|
Karsten Hopp |
9be36a |
/* Any char except '\0', (end of input) does not match. */
|
|
Karsten Hopp |
9be36a |
! if (curc > 0)
|
|
Karsten Hopp |
9be36a |
! addstate(nextlist, t->state->out, &t->sub, clen,
|
|
Karsten Hopp |
9be36a |
! listid + 1, &match);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
/*
|
|
Karsten Hopp |
9be36a |
* Character classes like \a for alpha, \d for digit etc.
|
|
Karsten Hopp |
9be36a |
*/
|
|
Karsten Hopp |
9be36a |
case NFA_IDENT: /* \i */
|
|
Karsten Hopp |
9be36a |
! result = vim_isIDc(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_SIDENT: /* \I */
|
|
Karsten Hopp |
9be36a |
! result = !VIM_ISDIGIT(curc) && vim_isIDc(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3413,3429 ****
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_SKWORD: /* \K */
|
|
Karsten Hopp |
9be36a |
! result = !VIM_ISDIGIT(c) && vim_iswordp_buf(reginput, reg_buf);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_FNAME: /* \f */
|
|
Karsten Hopp |
9be36a |
! result = vim_isfilec(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_SFNAME: /* \F */
|
|
Karsten Hopp |
9be36a |
! result = !VIM_ISDIGIT(c) && vim_isfilec(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
--- 3419,3436 ----
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_SKWORD: /* \K */
|
|
Karsten Hopp |
9be36a |
! result = !VIM_ISDIGIT(curc)
|
|
Karsten Hopp |
9be36a |
! && vim_iswordp_buf(reginput, reg_buf);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_FNAME: /* \f */
|
|
Karsten Hopp |
9be36a |
! result = vim_isfilec(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_SFNAME: /* \F */
|
|
Karsten Hopp |
9be36a |
! result = !VIM_ISDIGIT(curc) && vim_isfilec(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3433,3529 ****
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_SPRINT: /* \P */
|
|
Karsten Hopp |
9be36a |
! result = !VIM_ISDIGIT(c) && ptr2cells(reginput) == 1;
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_WHITE: /* \s */
|
|
Karsten Hopp |
9be36a |
! result = vim_iswhite(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NWHITE: /* \S */
|
|
Karsten Hopp |
9be36a |
! result = c != NUL && !vim_iswhite(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_DIGIT: /* \d */
|
|
Karsten Hopp |
9be36a |
! result = ri_digit(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NDIGIT: /* \D */
|
|
Karsten Hopp |
9be36a |
! result = c != NUL && !ri_digit(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_HEX: /* \x */
|
|
Karsten Hopp |
9be36a |
! result = ri_hex(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NHEX: /* \X */
|
|
Karsten Hopp |
9be36a |
! result = c != NUL && !ri_hex(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_OCTAL: /* \o */
|
|
Karsten Hopp |
9be36a |
! result = ri_octal(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NOCTAL: /* \O */
|
|
Karsten Hopp |
9be36a |
! result = c != NUL && !ri_octal(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_WORD: /* \w */
|
|
Karsten Hopp |
9be36a |
! result = ri_word(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NWORD: /* \W */
|
|
Karsten Hopp |
9be36a |
! result = c != NUL && !ri_word(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_HEAD: /* \h */
|
|
Karsten Hopp |
9be36a |
! result = ri_head(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NHEAD: /* \H */
|
|
Karsten Hopp |
9be36a |
! result = c != NUL && !ri_head(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_ALPHA: /* \a */
|
|
Karsten Hopp |
9be36a |
! result = ri_alpha(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NALPHA: /* \A */
|
|
Karsten Hopp |
9be36a |
! result = c != NUL && !ri_alpha(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_LOWER: /* \l */
|
|
Karsten Hopp |
9be36a |
! result = ri_lower(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NLOWER: /* \L */
|
|
Karsten Hopp |
9be36a |
! result = c != NUL && !ri_lower(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_UPPER: /* \u */
|
|
Karsten Hopp |
9be36a |
! result = ri_upper(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NUPPER: /* \U */
|
|
Karsten Hopp |
9be36a |
! result = c != NUL && !ri_upper(c);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
--- 3440,3536 ----
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_SPRINT: /* \P */
|
|
Karsten Hopp |
9be36a |
! result = !VIM_ISDIGIT(curc) && ptr2cells(reginput) == 1;
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_WHITE: /* \s */
|
|
Karsten Hopp |
9be36a |
! result = vim_iswhite(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NWHITE: /* \S */
|
|
Karsten Hopp |
9be36a |
! result = curc != NUL && !vim_iswhite(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_DIGIT: /* \d */
|
|
Karsten Hopp |
9be36a |
! result = ri_digit(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NDIGIT: /* \D */
|
|
Karsten Hopp |
9be36a |
! result = curc != NUL && !ri_digit(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_HEX: /* \x */
|
|
Karsten Hopp |
9be36a |
! result = ri_hex(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NHEX: /* \X */
|
|
Karsten Hopp |
9be36a |
! result = curc != NUL && !ri_hex(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_OCTAL: /* \o */
|
|
Karsten Hopp |
9be36a |
! result = ri_octal(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NOCTAL: /* \O */
|
|
Karsten Hopp |
9be36a |
! result = curc != NUL && !ri_octal(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_WORD: /* \w */
|
|
Karsten Hopp |
9be36a |
! result = ri_word(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NWORD: /* \W */
|
|
Karsten Hopp |
9be36a |
! result = curc != NUL && !ri_word(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_HEAD: /* \h */
|
|
Karsten Hopp |
9be36a |
! result = ri_head(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NHEAD: /* \H */
|
|
Karsten Hopp |
9be36a |
! result = curc != NUL && !ri_head(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_ALPHA: /* \a */
|
|
Karsten Hopp |
9be36a |
! result = ri_alpha(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NALPHA: /* \A */
|
|
Karsten Hopp |
9be36a |
! result = curc != NUL && !ri_alpha(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_LOWER: /* \l */
|
|
Karsten Hopp |
9be36a |
! result = ri_lower(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NLOWER: /* \L */
|
|
Karsten Hopp |
9be36a |
! result = curc != NUL && !ri_lower(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_UPPER: /* \u */
|
|
Karsten Hopp |
9be36a |
! result = ri_upper(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
case NFA_NUPPER: /* \U */
|
|
Karsten Hopp |
9be36a |
! result = curc != NUL && !ri_upper(curc);
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
break;
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3549,3565 ****
|
|
Karsten Hopp |
9be36a |
/* TODO: put this in #ifdef later */
|
|
Karsten Hopp |
9be36a |
if (t->state->c < -256)
|
|
Karsten Hopp |
9be36a |
EMSGN("INTERNAL: Negative state char: %ld", t->state->c);
|
|
Karsten Hopp |
9be36a |
! result = (no_Magic(t->state->c) == c);
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
if (!result)
|
|
Karsten Hopp |
9be36a |
result = ireg_ic == TRUE
|
|
Karsten Hopp |
9be36a |
! && MB_TOLOWER(t->state->c) == MB_TOLOWER(c);
|
|
Karsten Hopp |
9be36a |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
9be36a |
/* If there is a composing character which is not being
|
|
Karsten Hopp |
9be36a |
* ignored there can be no match. Match with composing
|
|
Karsten Hopp |
9be36a |
* character uses NFA_COMPOSING above. */
|
|
Karsten Hopp |
9be36a |
if (result && enc_utf8 && !ireg_icombine
|
|
Karsten Hopp |
9be36a |
! && n != utf_char2len(c))
|
|
Karsten Hopp |
9be36a |
result = FALSE;
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
--- 3556,3572 ----
|
|
Karsten Hopp |
9be36a |
/* TODO: put this in #ifdef later */
|
|
Karsten Hopp |
9be36a |
if (t->state->c < -256)
|
|
Karsten Hopp |
9be36a |
EMSGN("INTERNAL: Negative state char: %ld", t->state->c);
|
|
Karsten Hopp |
9be36a |
! result = (no_Magic(t->state->c) == curc);
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
if (!result)
|
|
Karsten Hopp |
9be36a |
result = ireg_ic == TRUE
|
|
Karsten Hopp |
9be36a |
! && MB_TOLOWER(t->state->c) == MB_TOLOWER(curc);
|
|
Karsten Hopp |
9be36a |
#ifdef FEAT_MBYTE
|
|
Karsten Hopp |
9be36a |
/* If there is a composing character which is not being
|
|
Karsten Hopp |
9be36a |
* ignored there can be no match. Match with composing
|
|
Karsten Hopp |
9be36a |
* character uses NFA_COMPOSING above. */
|
|
Karsten Hopp |
9be36a |
if (result && enc_utf8 && !ireg_icombine
|
|
Karsten Hopp |
9be36a |
! && clen != utf_char2len(curc))
|
|
Karsten Hopp |
9be36a |
result = FALSE;
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
ADD_POS_NEG_STATE(t->state);
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 3578,3598 ****
|
|
Karsten Hopp |
9be36a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, "(---) STARTSTATE\n");
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
! addstate(nextlist, start, m, n, listid + 1, &match);
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, ">>> Thislist had %d states available: ", thislist->n);
|
|
Karsten Hopp |
9be36a |
! for (i = 0; i< thislist->n; i++)
|
|
Karsten Hopp |
9be36a |
! fprintf(log_fd, "%d ", abs(thislist->t[i].state->id));
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, "\n");
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
nextchar:
|
|
Karsten Hopp |
9be36a |
/* Advance to the next character, or advance to the next line, or
|
|
Karsten Hopp |
9be36a |
* finish. */
|
|
Karsten Hopp |
9be36a |
! if (n != 0)
|
|
Karsten Hopp |
9be36a |
! reginput += n;
|
|
Karsten Hopp |
9be36a |
else if (go_to_nextline)
|
|
Karsten Hopp |
9be36a |
reg_nextline();
|
|
Karsten Hopp |
9be36a |
else
|
|
Karsten Hopp |
9be36a |
--- 3585,3609 ----
|
|
Karsten Hopp |
9be36a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, "(---) STARTSTATE\n");
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
! addstate(nextlist, start, m, clen, listid + 1, &match);
|
|
Karsten Hopp |
9be36a |
}
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, ">>> Thislist had %d states available: ", thislist->n);
|
|
Karsten Hopp |
9be36a |
! {
|
|
Karsten Hopp |
9be36a |
! int i;
|
|
Karsten Hopp |
9be36a |
!
|
|
Karsten Hopp |
9be36a |
! for (i = 0; i < thislist->n; i++)
|
|
Karsten Hopp |
9be36a |
! fprintf(log_fd, "%d ", abs(thislist->t[i].state->id));
|
|
Karsten Hopp |
9be36a |
! }
|
|
Karsten Hopp |
9be36a |
fprintf(log_fd, "\n");
|
|
Karsten Hopp |
9be36a |
#endif
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
nextchar:
|
|
Karsten Hopp |
9be36a |
/* Advance to the next character, or advance to the next line, or
|
|
Karsten Hopp |
9be36a |
* finish. */
|
|
Karsten Hopp |
9be36a |
! if (clen != 0)
|
|
Karsten Hopp |
9be36a |
! reginput += clen;
|
|
Karsten Hopp |
9be36a |
else if (go_to_nextline)
|
|
Karsten Hopp |
9be36a |
reg_nextline();
|
|
Karsten Hopp |
9be36a |
else
|
|
Karsten Hopp |
9be36a |
*** ../vim-7.3.1021/src/version.c 2013-05-26 14:32:01.000000000 +0200
|
|
Karsten Hopp |
9be36a |
--- src/version.c 2013-05-26 14:39:12.000000000 +0200
|
|
Karsten Hopp |
9be36a |
***************
|
|
Karsten Hopp |
9be36a |
*** 730,731 ****
|
|
Karsten Hopp |
9be36a |
--- 730,733 ----
|
|
Karsten Hopp |
9be36a |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
9be36a |
+ /**/
|
|
Karsten Hopp |
9be36a |
+ 1022,
|
|
Karsten Hopp |
9be36a |
/**/
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
--
|
|
Karsten Hopp |
9be36a |
Female engineers become irresistible at the age of consent and remain that
|
|
Karsten Hopp |
9be36a |
way until about thirty minutes after their clinical death. Longer if it's a
|
|
Karsten Hopp |
9be36a |
warm day.
|
|
Karsten Hopp |
9be36a |
(Scott Adams - The Dilbert principle)
|
|
Karsten Hopp |
9be36a |
|
|
Karsten Hopp |
9be36a |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
9be36a |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
9be36a |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
9be36a |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|