|
Karsten Hopp |
2dbc7a |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
2dbc7a |
Subject: Patch 7.3.1106
|
|
Karsten Hopp |
2dbc7a |
Fcc: outbox
|
|
Karsten Hopp |
2dbc7a |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
2dbc7a |
Mime-Version: 1.0
|
|
Karsten Hopp |
2dbc7a |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
2dbc7a |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
2dbc7a |
------------
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
Patch 7.3.1106
|
|
Karsten Hopp |
2dbc7a |
Problem: New regexp engine: saving and restoring lastlist in the states
|
|
Karsten Hopp |
2dbc7a |
takes a lot of time.
|
|
Karsten Hopp |
2dbc7a |
Solution: Use a second lastlist value for the first recursive call.
|
|
Karsten Hopp |
2dbc7a |
Files: src/regexp.h, src/regexp_nfa.c
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
*** ../vim-7.3.1105/src/regexp.h 2013-06-02 15:55:52.000000000 +0200
|
|
Karsten Hopp |
2dbc7a |
--- src/regexp.h 2013-06-03 11:29:26.000000000 +0200
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 72,78 ****
|
|
Karsten Hopp |
2dbc7a |
nfa_state_T *out;
|
|
Karsten Hopp |
2dbc7a |
nfa_state_T *out1;
|
|
Karsten Hopp |
2dbc7a |
int id;
|
|
Karsten Hopp |
2dbc7a |
! int lastlist;
|
|
Karsten Hopp |
2dbc7a |
int negated;
|
|
Karsten Hopp |
2dbc7a |
int val;
|
|
Karsten Hopp |
2dbc7a |
};
|
|
Karsten Hopp |
2dbc7a |
--- 72,78 ----
|
|
Karsten Hopp |
2dbc7a |
nfa_state_T *out;
|
|
Karsten Hopp |
2dbc7a |
nfa_state_T *out1;
|
|
Karsten Hopp |
2dbc7a |
int id;
|
|
Karsten Hopp |
2dbc7a |
! int lastlist[2]; /* 0: normal, 1: recursive */
|
|
Karsten Hopp |
2dbc7a |
int negated;
|
|
Karsten Hopp |
2dbc7a |
int val;
|
|
Karsten Hopp |
2dbc7a |
};
|
|
Karsten Hopp |
2dbc7a |
*** ../vim-7.3.1105/src/regexp_nfa.c 2013-06-02 22:37:39.000000000 +0200
|
|
Karsten Hopp |
2dbc7a |
--- src/regexp_nfa.c 2013-06-03 12:15:17.000000000 +0200
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 255,260 ****
|
|
Karsten Hopp |
2dbc7a |
--- 255,269 ----
|
|
Karsten Hopp |
2dbc7a |
/* If not NULL match must end at this position */
|
|
Karsten Hopp |
2dbc7a |
static save_se_T *nfa_endp = NULL;
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
+ /* listid is global, so that it increases on recursive calls to
|
|
Karsten Hopp |
2dbc7a |
+ * nfa_regmatch(), which means we don't have to clear the lastlist field of
|
|
Karsten Hopp |
2dbc7a |
+ * all the states. */
|
|
Karsten Hopp |
2dbc7a |
+ static int nfa_listid;
|
|
Karsten Hopp |
2dbc7a |
+ static int nfa_alt_listid;
|
|
Karsten Hopp |
2dbc7a |
+
|
|
Karsten Hopp |
2dbc7a |
+ /* 0 for first call to nfa_regmatch(), 1 for recursive call. */
|
|
Karsten Hopp |
2dbc7a |
+ static int nfa_ll_index = 0;
|
|
Karsten Hopp |
2dbc7a |
+
|
|
Karsten Hopp |
2dbc7a |
static int nfa_regcomp_start __ARGS((char_u*expr, int re_flags));
|
|
Karsten Hopp |
2dbc7a |
static int nfa_recognize_char_class __ARGS((char_u *start, char_u *end, int extra_newl));
|
|
Karsten Hopp |
2dbc7a |
static int nfa_emit_equi_class __ARGS((int c, int neg));
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 2169,2175 ****
|
|
Karsten Hopp |
2dbc7a |
s->out1 = out1;
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
s->id = istate;
|
|
Karsten Hopp |
2dbc7a |
! s->lastlist = 0;
|
|
Karsten Hopp |
2dbc7a |
s->negated = FALSE;
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
return s;
|
|
Karsten Hopp |
2dbc7a |
--- 2178,2185 ----
|
|
Karsten Hopp |
2dbc7a |
s->out1 = out1;
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
s->id = istate;
|
|
Karsten Hopp |
2dbc7a |
! s->lastlist[0] = 0;
|
|
Karsten Hopp |
2dbc7a |
! s->lastlist[1] = 0;
|
|
Karsten Hopp |
2dbc7a |
s->negated = FALSE;
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
return s;
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 3113,3121 ****
|
|
Karsten Hopp |
2dbc7a |
#endif
|
|
Karsten Hopp |
2dbc7a |
/* These nodes do not need to be added, but we need to bail out
|
|
Karsten Hopp |
2dbc7a |
* when it was tried to be added to this list before. */
|
|
Karsten Hopp |
2dbc7a |
! if (state->lastlist == l->id)
|
|
Karsten Hopp |
2dbc7a |
goto skip_add;
|
|
Karsten Hopp |
2dbc7a |
! state->lastlist = l->id;
|
|
Karsten Hopp |
2dbc7a |
break;
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
case NFA_BOL:
|
|
Karsten Hopp |
2dbc7a |
--- 3123,3131 ----
|
|
Karsten Hopp |
2dbc7a |
#endif
|
|
Karsten Hopp |
2dbc7a |
/* These nodes do not need to be added, but we need to bail out
|
|
Karsten Hopp |
2dbc7a |
* when it was tried to be added to this list before. */
|
|
Karsten Hopp |
2dbc7a |
! if (state->lastlist[nfa_ll_index] == l->id)
|
|
Karsten Hopp |
2dbc7a |
goto skip_add;
|
|
Karsten Hopp |
2dbc7a |
! state->lastlist[nfa_ll_index] = l->id;
|
|
Karsten Hopp |
2dbc7a |
break;
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
case NFA_BOL:
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 3131,3137 ****
|
|
Karsten Hopp |
2dbc7a |
/* FALLTHROUGH */
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
default:
|
|
Karsten Hopp |
2dbc7a |
! if (state->lastlist == l->id)
|
|
Karsten Hopp |
2dbc7a |
{
|
|
Karsten Hopp |
2dbc7a |
/* This state is already in the list, don't add it again,
|
|
Karsten Hopp |
2dbc7a |
* unless it is an MOPEN that is used for a backreference. */
|
|
Karsten Hopp |
2dbc7a |
--- 3141,3147 ----
|
|
Karsten Hopp |
2dbc7a |
/* FALLTHROUGH */
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
default:
|
|
Karsten Hopp |
2dbc7a |
! if (state->lastlist[nfa_ll_index] == l->id)
|
|
Karsten Hopp |
2dbc7a |
{
|
|
Karsten Hopp |
2dbc7a |
/* This state is already in the list, don't add it again,
|
|
Karsten Hopp |
2dbc7a |
* unless it is an MOPEN that is used for a backreference. */
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 3173,3179 ****
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
/* add the state to the list */
|
|
Karsten Hopp |
2dbc7a |
! state->lastlist = l->id;
|
|
Karsten Hopp |
2dbc7a |
thread = &l->t[l->n++];
|
|
Karsten Hopp |
2dbc7a |
thread->state = state;
|
|
Karsten Hopp |
2dbc7a |
copy_sub(&thread->subs.norm, &subs->norm);
|
|
Karsten Hopp |
2dbc7a |
--- 3183,3189 ----
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
/* add the state to the list */
|
|
Karsten Hopp |
2dbc7a |
! state->lastlist[nfa_ll_index] = l->id;
|
|
Karsten Hopp |
2dbc7a |
thread = &l->t[l->n++];
|
|
Karsten Hopp |
2dbc7a |
thread->state = state;
|
|
Karsten Hopp |
2dbc7a |
copy_sub(&thread->subs.norm, &subs->norm);
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 3616,3621 ****
|
|
Karsten Hopp |
2dbc7a |
--- 3626,3632 ----
|
|
Karsten Hopp |
2dbc7a |
/*
|
|
Karsten Hopp |
2dbc7a |
* Save list IDs for all NFA states of "prog" into "list".
|
|
Karsten Hopp |
2dbc7a |
* Also reset the IDs to zero.
|
|
Karsten Hopp |
2dbc7a |
+ * Only used for the recursive value lastlist[1].
|
|
Karsten Hopp |
2dbc7a |
*/
|
|
Karsten Hopp |
2dbc7a |
static void
|
|
Karsten Hopp |
2dbc7a |
nfa_save_listids(prog, list)
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 3629,3636 ****
|
|
Karsten Hopp |
2dbc7a |
p = &prog->state[0];
|
|
Karsten Hopp |
2dbc7a |
for (i = prog->nstate; --i >= 0; )
|
|
Karsten Hopp |
2dbc7a |
{
|
|
Karsten Hopp |
2dbc7a |
! list[i] = p->lastlist;
|
|
Karsten Hopp |
2dbc7a |
! p->lastlist = 0;
|
|
Karsten Hopp |
2dbc7a |
++p;
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
--- 3640,3647 ----
|
|
Karsten Hopp |
2dbc7a |
p = &prog->state[0];
|
|
Karsten Hopp |
2dbc7a |
for (i = prog->nstate; --i >= 0; )
|
|
Karsten Hopp |
2dbc7a |
{
|
|
Karsten Hopp |
2dbc7a |
! list[i] = p->lastlist[1];
|
|
Karsten Hopp |
2dbc7a |
! p->lastlist[1] = 0;
|
|
Karsten Hopp |
2dbc7a |
++p;
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 3649,3655 ****
|
|
Karsten Hopp |
2dbc7a |
p = &prog->state[0];
|
|
Karsten Hopp |
2dbc7a |
for (i = prog->nstate; --i >= 0; )
|
|
Karsten Hopp |
2dbc7a |
{
|
|
Karsten Hopp |
2dbc7a |
! p->lastlist = list[i];
|
|
Karsten Hopp |
2dbc7a |
++p;
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
--- 3660,3666 ----
|
|
Karsten Hopp |
2dbc7a |
p = &prog->state[0];
|
|
Karsten Hopp |
2dbc7a |
for (i = prog->nstate; --i >= 0; )
|
|
Karsten Hopp |
2dbc7a |
{
|
|
Karsten Hopp |
2dbc7a |
! p->lastlist[1] = list[i];
|
|
Karsten Hopp |
2dbc7a |
++p;
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 3683,3692 ****
|
|
Karsten Hopp |
2dbc7a |
--- 3694,3705 ----
|
|
Karsten Hopp |
2dbc7a |
char_u *save_regline = regline;
|
|
Karsten Hopp |
2dbc7a |
int save_reglnum = reglnum;
|
|
Karsten Hopp |
2dbc7a |
int save_nfa_match = nfa_match;
|
|
Karsten Hopp |
2dbc7a |
+ int save_nfa_listid = nfa_listid;
|
|
Karsten Hopp |
2dbc7a |
save_se_T *save_nfa_endp = nfa_endp;
|
|
Karsten Hopp |
2dbc7a |
save_se_T endpos;
|
|
Karsten Hopp |
2dbc7a |
save_se_T *endposp = NULL;
|
|
Karsten Hopp |
2dbc7a |
int result;
|
|
Karsten Hopp |
2dbc7a |
+ int need_restore = FALSE;
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
if (state->c == NFA_START_INVISIBLE_BEFORE)
|
|
Karsten Hopp |
2dbc7a |
{
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 3745,3774 ****
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
- /* Call nfa_regmatch() to check if the current concat matches
|
|
Karsten Hopp |
2dbc7a |
- * at this position. The concat ends with the node
|
|
Karsten Hopp |
2dbc7a |
- * NFA_END_INVISIBLE */
|
|
Karsten Hopp |
2dbc7a |
- if (*listids == NULL)
|
|
Karsten Hopp |
2dbc7a |
- {
|
|
Karsten Hopp |
2dbc7a |
- *listids = (int *)lalloc(sizeof(int) * nstate, TRUE);
|
|
Karsten Hopp |
2dbc7a |
- if (*listids == NULL)
|
|
Karsten Hopp |
2dbc7a |
- {
|
|
Karsten Hopp |
2dbc7a |
- EMSG(_("E878: (NFA) Could not allocate memory for branch traversal!"));
|
|
Karsten Hopp |
2dbc7a |
- return 0;
|
|
Karsten Hopp |
2dbc7a |
- }
|
|
Karsten Hopp |
2dbc7a |
- }
|
|
Karsten Hopp |
2dbc7a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
2dbc7a |
if (log_fd != stderr)
|
|
Karsten Hopp |
2dbc7a |
fclose(log_fd);
|
|
Karsten Hopp |
2dbc7a |
log_fd = NULL;
|
|
Karsten Hopp |
2dbc7a |
#endif
|
|
Karsten Hopp |
2dbc7a |
! /* Have to clear the listid field of the NFA nodes, so that
|
|
Karsten Hopp |
2dbc7a |
! * nfa_regmatch() and addstate() can run properly after
|
|
Karsten Hopp |
2dbc7a |
! * recursion. */
|
|
Karsten Hopp |
2dbc7a |
! nfa_save_listids(prog, *listids);
|
|
Karsten Hopp |
2dbc7a |
nfa_endp = endposp;
|
|
Karsten Hopp |
2dbc7a |
result = nfa_regmatch(prog, state->out, submatch, m);
|
|
Karsten Hopp |
2dbc7a |
! nfa_restore_listids(prog, *listids);
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
/* restore position in input text */
|
|
Karsten Hopp |
2dbc7a |
reginput = save_reginput;
|
|
Karsten Hopp |
2dbc7a |
--- 3758,3809 ----
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
2dbc7a |
if (log_fd != stderr)
|
|
Karsten Hopp |
2dbc7a |
fclose(log_fd);
|
|
Karsten Hopp |
2dbc7a |
log_fd = NULL;
|
|
Karsten Hopp |
2dbc7a |
#endif
|
|
Karsten Hopp |
2dbc7a |
! /* Have to clear the lastlist field of the NFA nodes, so that
|
|
Karsten Hopp |
2dbc7a |
! * nfa_regmatch() and addstate() can run properly after recursion. */
|
|
Karsten Hopp |
2dbc7a |
! if (nfa_ll_index == 1)
|
|
Karsten Hopp |
2dbc7a |
! {
|
|
Karsten Hopp |
2dbc7a |
! /* Already calling nfa_regmatch() recursively. Save the lastlist[1]
|
|
Karsten Hopp |
2dbc7a |
! * values and clear them. */
|
|
Karsten Hopp |
2dbc7a |
! if (*listids == NULL)
|
|
Karsten Hopp |
2dbc7a |
! {
|
|
Karsten Hopp |
2dbc7a |
! *listids = (int *)lalloc(sizeof(int) * nstate, TRUE);
|
|
Karsten Hopp |
2dbc7a |
! if (*listids == NULL)
|
|
Karsten Hopp |
2dbc7a |
! {
|
|
Karsten Hopp |
2dbc7a |
! EMSG(_("E878: (NFA) Could not allocate memory for branch traversal!"));
|
|
Karsten Hopp |
2dbc7a |
! return 0;
|
|
Karsten Hopp |
2dbc7a |
! }
|
|
Karsten Hopp |
2dbc7a |
! }
|
|
Karsten Hopp |
2dbc7a |
! nfa_save_listids(prog, *listids);
|
|
Karsten Hopp |
2dbc7a |
! need_restore = TRUE;
|
|
Karsten Hopp |
2dbc7a |
! /* any value of nfa_listid will do */
|
|
Karsten Hopp |
2dbc7a |
! }
|
|
Karsten Hopp |
2dbc7a |
! else
|
|
Karsten Hopp |
2dbc7a |
! {
|
|
Karsten Hopp |
2dbc7a |
! /* First recursive nfa_regmatch() call, switch to the second lastlist
|
|
Karsten Hopp |
2dbc7a |
! * entry. Make sure nfa_listid is different from a previous recursive
|
|
Karsten Hopp |
2dbc7a |
! * call, because some states may still have this ID. */
|
|
Karsten Hopp |
2dbc7a |
! ++nfa_ll_index;
|
|
Karsten Hopp |
2dbc7a |
! if (nfa_listid <= nfa_alt_listid)
|
|
Karsten Hopp |
2dbc7a |
! nfa_listid = nfa_alt_listid;
|
|
Karsten Hopp |
2dbc7a |
! }
|
|
Karsten Hopp |
2dbc7a |
!
|
|
Karsten Hopp |
2dbc7a |
! /* Call nfa_regmatch() to check if the current concat matches at this
|
|
Karsten Hopp |
2dbc7a |
! * position. The concat ends with the node NFA_END_INVISIBLE */
|
|
Karsten Hopp |
2dbc7a |
nfa_endp = endposp;
|
|
Karsten Hopp |
2dbc7a |
result = nfa_regmatch(prog, state->out, submatch, m);
|
|
Karsten Hopp |
2dbc7a |
!
|
|
Karsten Hopp |
2dbc7a |
! if (need_restore)
|
|
Karsten Hopp |
2dbc7a |
! nfa_restore_listids(prog, *listids);
|
|
Karsten Hopp |
2dbc7a |
! else
|
|
Karsten Hopp |
2dbc7a |
! {
|
|
Karsten Hopp |
2dbc7a |
! --nfa_ll_index;
|
|
Karsten Hopp |
2dbc7a |
! nfa_alt_listid = nfa_listid;
|
|
Karsten Hopp |
2dbc7a |
! }
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
/* restore position in input text */
|
|
Karsten Hopp |
2dbc7a |
reginput = save_reginput;
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 3776,3781 ****
|
|
Karsten Hopp |
2dbc7a |
--- 3811,3817 ----
|
|
Karsten Hopp |
2dbc7a |
reglnum = save_reglnum;
|
|
Karsten Hopp |
2dbc7a |
nfa_match = save_nfa_match;
|
|
Karsten Hopp |
2dbc7a |
nfa_endp = save_nfa_endp;
|
|
Karsten Hopp |
2dbc7a |
+ nfa_listid = save_nfa_listid;
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
2dbc7a |
log_fd = fopen(NFA_REGEXP_RUN_LOG, "a");
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 3821,3827 ****
|
|
Karsten Hopp |
2dbc7a |
nfa_list_T list[3];
|
|
Karsten Hopp |
2dbc7a |
nfa_list_T *listtbl[2][2];
|
|
Karsten Hopp |
2dbc7a |
nfa_list_T *ll;
|
|
Karsten Hopp |
2dbc7a |
- int listid = 1;
|
|
Karsten Hopp |
2dbc7a |
int listidx;
|
|
Karsten Hopp |
2dbc7a |
nfa_list_T *thislist;
|
|
Karsten Hopp |
2dbc7a |
nfa_list_T *nextlist;
|
|
Karsten Hopp |
2dbc7a |
--- 3857,3862 ----
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 3875,3881 ****
|
|
Karsten Hopp |
2dbc7a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
2dbc7a |
fprintf(log_fd, "(---) STARTSTATE\n");
|
|
Karsten Hopp |
2dbc7a |
#endif
|
|
Karsten Hopp |
2dbc7a |
! thislist->id = listid;
|
|
Karsten Hopp |
2dbc7a |
addstate(thislist, start, m, 0);
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
/* There are two cases when the NFA advances: 1. input char matches the
|
|
Karsten Hopp |
2dbc7a |
--- 3910,3916 ----
|
|
Karsten Hopp |
2dbc7a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
2dbc7a |
fprintf(log_fd, "(---) STARTSTATE\n");
|
|
Karsten Hopp |
2dbc7a |
#endif
|
|
Karsten Hopp |
2dbc7a |
! thislist->id = nfa_listid + 1;
|
|
Karsten Hopp |
2dbc7a |
addstate(thislist, start, m, 0);
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
/* There are two cases when the NFA advances: 1. input char matches the
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 3923,3932 ****
|
|
Karsten Hopp |
2dbc7a |
nextlist = &list[flag ^= 1];
|
|
Karsten Hopp |
2dbc7a |
nextlist->n = 0; /* clear nextlist */
|
|
Karsten Hopp |
2dbc7a |
listtbl[1][0] = nextlist;
|
|
Karsten Hopp |
2dbc7a |
! ++listid;
|
|
Karsten Hopp |
2dbc7a |
! thislist->id = listid;
|
|
Karsten Hopp |
2dbc7a |
! nextlist->id = listid + 1;
|
|
Karsten Hopp |
2dbc7a |
! neglist->id = listid + 1;
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
2dbc7a |
fprintf(log_fd, "------------------------------------------\n");
|
|
Karsten Hopp |
2dbc7a |
--- 3958,3967 ----
|
|
Karsten Hopp |
2dbc7a |
nextlist = &list[flag ^= 1];
|
|
Karsten Hopp |
2dbc7a |
nextlist->n = 0; /* clear nextlist */
|
|
Karsten Hopp |
2dbc7a |
listtbl[1][0] = nextlist;
|
|
Karsten Hopp |
2dbc7a |
! ++nfa_listid;
|
|
Karsten Hopp |
2dbc7a |
! thislist->id = nfa_listid;
|
|
Karsten Hopp |
2dbc7a |
! nextlist->id = nfa_listid + 1;
|
|
Karsten Hopp |
2dbc7a |
! neglist->id = nfa_listid + 1;
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
2dbc7a |
fprintf(log_fd, "------------------------------------------\n");
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 4843,4848 ****
|
|
Karsten Hopp |
2dbc7a |
--- 4878,4885 ----
|
|
Karsten Hopp |
2dbc7a |
nfa_has_zend = prog->has_zend;
|
|
Karsten Hopp |
2dbc7a |
nfa_has_backref = prog->has_backref;
|
|
Karsten Hopp |
2dbc7a |
nfa_nsubexpr = prog->nsubexp;
|
|
Karsten Hopp |
2dbc7a |
+ nfa_listid = 1;
|
|
Karsten Hopp |
2dbc7a |
+ nfa_alt_listid = 2;
|
|
Karsten Hopp |
2dbc7a |
#ifdef DEBUG
|
|
Karsten Hopp |
2dbc7a |
nfa_regengine.expr = prog->pattern;
|
|
Karsten Hopp |
2dbc7a |
#endif
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 4851,4857 ****
|
|
Karsten Hopp |
2dbc7a |
for (i = 0; i < nstate; ++i)
|
|
Karsten Hopp |
2dbc7a |
{
|
|
Karsten Hopp |
2dbc7a |
prog->state[i].id = i;
|
|
Karsten Hopp |
2dbc7a |
! prog->state[i].lastlist = 0;
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
retval = nfa_regtry(prog, col);
|
|
Karsten Hopp |
2dbc7a |
--- 4888,4895 ----
|
|
Karsten Hopp |
2dbc7a |
for (i = 0; i < nstate; ++i)
|
|
Karsten Hopp |
2dbc7a |
{
|
|
Karsten Hopp |
2dbc7a |
prog->state[i].id = i;
|
|
Karsten Hopp |
2dbc7a |
! prog->state[i].lastlist[0] = 0;
|
|
Karsten Hopp |
2dbc7a |
! prog->state[i].lastlist[1] = 0;
|
|
Karsten Hopp |
2dbc7a |
}
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
retval = nfa_regtry(prog, col);
|
|
Karsten Hopp |
2dbc7a |
*** ../vim-7.3.1105/src/version.c 2013-06-02 22:37:39.000000000 +0200
|
|
Karsten Hopp |
2dbc7a |
--- src/version.c 2013-06-03 12:13:15.000000000 +0200
|
|
Karsten Hopp |
2dbc7a |
***************
|
|
Karsten Hopp |
2dbc7a |
*** 730,731 ****
|
|
Karsten Hopp |
2dbc7a |
--- 730,733 ----
|
|
Karsten Hopp |
2dbc7a |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
2dbc7a |
+ /**/
|
|
Karsten Hopp |
2dbc7a |
+ 1106,
|
|
Karsten Hopp |
2dbc7a |
/**/
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
--
|
|
Karsten Hopp |
2dbc7a |
hundred-and-one symptoms of being an internet addict:
|
|
Karsten Hopp |
2dbc7a |
59. Your wife says communication is important in a marriage...so you buy
|
|
Karsten Hopp |
2dbc7a |
another computer and install a second phone line so the two of you can
|
|
Karsten Hopp |
2dbc7a |
chat.
|
|
Karsten Hopp |
2dbc7a |
|
|
Karsten Hopp |
2dbc7a |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
2dbc7a |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
2dbc7a |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
2dbc7a |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|