|
Karsten Hopp |
f3a10e |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
f3a10e |
Subject: Patch 7.3.1103
|
|
Karsten Hopp |
f3a10e |
Fcc: outbox
|
|
Karsten Hopp |
f3a10e |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
f3a10e |
Mime-Version: 1.0
|
|
Karsten Hopp |
f3a10e |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
f3a10e |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
f3a10e |
------------
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
Patch 7.3.1103
|
|
Karsten Hopp |
f3a10e |
Problem: New regexp engine: overhead in saving and restoring.
|
|
Karsten Hopp |
f3a10e |
Solution: Make saving and restoring list IDs faster. Don't copy or check \z
|
|
Karsten Hopp |
f3a10e |
subexpressions when they are not used.
|
|
Karsten Hopp |
f3a10e |
Files: src/regexp_nfa.c
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
*** ../vim-7.3.1102/src/regexp_nfa.c 2013-06-02 16:40:44.000000000 +0200
|
|
Karsten Hopp |
f3a10e |
--- src/regexp_nfa.c 2013-06-02 21:00:41.000000000 +0200
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 237,242 ****
|
|
Karsten Hopp |
f3a10e |
--- 237,245 ----
|
|
Karsten Hopp |
f3a10e |
/* NFA regexp \1 .. \9 encountered. */
|
|
Karsten Hopp |
f3a10e |
static int nfa_has_backref;
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
+ /* NFA regexp has \z( ), set zsubexpr. */
|
|
Karsten Hopp |
f3a10e |
+ static int nfa_has_zsubexpr;
|
|
Karsten Hopp |
f3a10e |
+
|
|
Karsten Hopp |
f3a10e |
/* Number of sub expressions actually being used during execution. 1 if only
|
|
Karsten Hopp |
f3a10e |
* the whole match (subexpr 0) is used. */
|
|
Karsten Hopp |
f3a10e |
static int nfa_nsubexpr;
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 272,281 ****
|
|
Karsten Hopp |
f3a10e |
static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size));
|
|
Karsten Hopp |
f3a10e |
static int check_char_class __ARGS((int class, int c));
|
|
Karsten Hopp |
f3a10e |
static void st_error __ARGS((int *postfix, int *end, int *p));
|
|
Karsten Hopp |
f3a10e |
! static void nfa_set_neg_listids __ARGS((nfa_state_T *start));
|
|
Karsten Hopp |
f3a10e |
! static void nfa_set_null_listids __ARGS((nfa_state_T *start));
|
|
Karsten Hopp |
f3a10e |
! static void nfa_save_listids __ARGS((nfa_state_T *start, int *list));
|
|
Karsten Hopp |
f3a10e |
! static void nfa_restore_listids __ARGS((nfa_state_T *start, int *list));
|
|
Karsten Hopp |
f3a10e |
static int nfa_re_num_cmp __ARGS((long_u val, int op, long_u pos));
|
|
Karsten Hopp |
f3a10e |
static long nfa_regtry __ARGS((nfa_regprog_T *prog, colnr_T col));
|
|
Karsten Hopp |
f3a10e |
static long nfa_regexec_both __ARGS((char_u *line, colnr_T col));
|
|
Karsten Hopp |
f3a10e |
--- 275,282 ----
|
|
Karsten Hopp |
f3a10e |
static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size));
|
|
Karsten Hopp |
f3a10e |
static int check_char_class __ARGS((int class, int c));
|
|
Karsten Hopp |
f3a10e |
static void st_error __ARGS((int *postfix, int *end, int *p));
|
|
Karsten Hopp |
f3a10e |
! static void nfa_save_listids __ARGS((nfa_regprog_T *prog, int *list));
|
|
Karsten Hopp |
f3a10e |
! static void nfa_restore_listids __ARGS((nfa_regprog_T *prog, int *list));
|
|
Karsten Hopp |
f3a10e |
static int nfa_re_num_cmp __ARGS((long_u val, int op, long_u pos));
|
|
Karsten Hopp |
f3a10e |
static long nfa_regtry __ARGS((nfa_regprog_T *prog, colnr_T col));
|
|
Karsten Hopp |
f3a10e |
static long nfa_regexec_both __ARGS((char_u *line, colnr_T col));
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 3000,3005 ****
|
|
Karsten Hopp |
f3a10e |
--- 3001,3024 ----
|
|
Karsten Hopp |
f3a10e |
return TRUE;
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
+ #ifdef ENABLE_LOG
|
|
Karsten Hopp |
f3a10e |
+ static void
|
|
Karsten Hopp |
f3a10e |
+ report_state(char *action, regsub_T *sub, nfa_state_T *state, int lid);
|
|
Karsten Hopp |
f3a10e |
+ {
|
|
Karsten Hopp |
f3a10e |
+ int col;
|
|
Karsten Hopp |
f3a10e |
+
|
|
Karsten Hopp |
f3a10e |
+ if (sub->in_use <= 0)
|
|
Karsten Hopp |
f3a10e |
+ col = -1;
|
|
Karsten Hopp |
f3a10e |
+ else if (REG_MULTI)
|
|
Karsten Hopp |
f3a10e |
+ col = sub->list.multi[0].start.col;
|
|
Karsten Hopp |
f3a10e |
+ else
|
|
Karsten Hopp |
f3a10e |
+ col = (int)(sub->list.line[0].start - regline);
|
|
Karsten Hopp |
f3a10e |
+ nfa_set_code(state->c);
|
|
Karsten Hopp |
f3a10e |
+ fprintf(log_fd, "> %s state %d to list %d. char %d: %s (start col %d)\n",
|
|
Karsten Hopp |
f3a10e |
+ action, abs(state->id), lid, state->c, code, col);
|
|
Karsten Hopp |
f3a10e |
+ }
|
|
Karsten Hopp |
f3a10e |
+ #endif
|
|
Karsten Hopp |
f3a10e |
+
|
|
Karsten Hopp |
f3a10e |
static void
|
|
Karsten Hopp |
f3a10e |
addstate(l, state, subs, off)
|
|
Karsten Hopp |
f3a10e |
nfa_list_T *l; /* runtime state list */
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 3118,3124 ****
|
|
Karsten Hopp |
f3a10e |
if (thread->state->id == state->id
|
|
Karsten Hopp |
f3a10e |
&& sub_equal(&thread->subs.norm, &subs->norm)
|
|
Karsten Hopp |
f3a10e |
#ifdef FEAT_SYN_HL
|
|
Karsten Hopp |
f3a10e |
! && sub_equal(&thread->subs.synt, &subs->synt)
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
)
|
|
Karsten Hopp |
f3a10e |
goto skip_add;
|
|
Karsten Hopp |
f3a10e |
--- 3137,3144 ----
|
|
Karsten Hopp |
f3a10e |
if (thread->state->id == state->id
|
|
Karsten Hopp |
f3a10e |
&& sub_equal(&thread->subs.norm, &subs->norm)
|
|
Karsten Hopp |
f3a10e |
#ifdef FEAT_SYN_HL
|
|
Karsten Hopp |
f3a10e |
! && (!nfa_has_zsubexpr ||
|
|
Karsten Hopp |
f3a10e |
! sub_equal(&thread->subs.synt, &subs->synt))
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
)
|
|
Karsten Hopp |
f3a10e |
goto skip_add;
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 3141,3181 ****
|
|
Karsten Hopp |
f3a10e |
thread->state = state;
|
|
Karsten Hopp |
f3a10e |
copy_sub(&thread->subs.norm, &subs->norm);
|
|
Karsten Hopp |
f3a10e |
#ifdef FEAT_SYN_HL
|
|
Karsten Hopp |
f3a10e |
! copy_sub(&thread->subs.synt, &subs->synt);
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
f3a10e |
! {
|
|
Karsten Hopp |
f3a10e |
! int col;
|
|
Karsten Hopp |
f3a10e |
!
|
|
Karsten Hopp |
f3a10e |
! if (thread->subs.norm.in_use <= 0)
|
|
Karsten Hopp |
f3a10e |
! col = -1;
|
|
Karsten Hopp |
f3a10e |
! else if (REG_MULTI)
|
|
Karsten Hopp |
f3a10e |
! col = thread->subs.norm.list.multi[0].start.col;
|
|
Karsten Hopp |
f3a10e |
! else
|
|
Karsten Hopp |
f3a10e |
! col = (int)(thread->subs.norm.list.line[0].start - regline);
|
|
Karsten Hopp |
f3a10e |
! nfa_set_code(state->c);
|
|
Karsten Hopp |
f3a10e |
! fprintf(log_fd, "> Adding state %d to list %d. char %d: %s (start col %d)\n",
|
|
Karsten Hopp |
f3a10e |
! abs(state->id), l->id, state->c, code, col);
|
|
Karsten Hopp |
f3a10e |
! did_print = TRUE;
|
|
Karsten Hopp |
f3a10e |
! }
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
f3a10e |
if (!did_print)
|
|
Karsten Hopp |
f3a10e |
! {
|
|
Karsten Hopp |
f3a10e |
! int col;
|
|
Karsten Hopp |
f3a10e |
!
|
|
Karsten Hopp |
f3a10e |
! if (subs->norm.in_use <= 0)
|
|
Karsten Hopp |
f3a10e |
! col = -1;
|
|
Karsten Hopp |
f3a10e |
! else if (REG_MULTI)
|
|
Karsten Hopp |
f3a10e |
! col = subs->norm.list.multi[0].start.col;
|
|
Karsten Hopp |
f3a10e |
! else
|
|
Karsten Hopp |
f3a10e |
! col = (int)(subs->norm.list.line[0].start - regline);
|
|
Karsten Hopp |
f3a10e |
! nfa_set_code(state->c);
|
|
Karsten Hopp |
f3a10e |
! fprintf(log_fd, "> Processing state %d for list %d. char %d: %s (start col %d)\n",
|
|
Karsten Hopp |
f3a10e |
! abs(state->id), l->id, state->c, code, col);
|
|
Karsten Hopp |
f3a10e |
! }
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
switch (state->c)
|
|
Karsten Hopp |
f3a10e |
{
|
|
Karsten Hopp |
f3a10e |
--- 3161,3178 ----
|
|
Karsten Hopp |
f3a10e |
thread->state = state;
|
|
Karsten Hopp |
f3a10e |
copy_sub(&thread->subs.norm, &subs->norm);
|
|
Karsten Hopp |
f3a10e |
#ifdef FEAT_SYN_HL
|
|
Karsten Hopp |
f3a10e |
! if (nfa_has_zsubexpr)
|
|
Karsten Hopp |
f3a10e |
! copy_sub(&thread->subs.synt, &subs->synt);
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
f3a10e |
! report_state("Adding", &thread->subs.norm, state, l->id);
|
|
Karsten Hopp |
f3a10e |
! did_print = TRUE;
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
f3a10e |
if (!did_print)
|
|
Karsten Hopp |
f3a10e |
! report_state("Processing", &subs->norm, state, l->id);
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
switch (state->c)
|
|
Karsten Hopp |
f3a10e |
{
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 3600,3648 ****
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
/*
|
|
Karsten Hopp |
f3a10e |
! * Set all NFA nodes' list ID equal to -1.
|
|
Karsten Hopp |
f3a10e |
*/
|
|
Karsten Hopp |
f3a10e |
static void
|
|
Karsten Hopp |
f3a10e |
! nfa_set_neg_listids(start)
|
|
Karsten Hopp |
f3a10e |
! nfa_state_T *start;
|
|
Karsten Hopp |
f3a10e |
! {
|
|
Karsten Hopp |
f3a10e |
! if (start != NULL && start->lastlist >= 0)
|
|
Karsten Hopp |
f3a10e |
! {
|
|
Karsten Hopp |
f3a10e |
! start->lastlist = -1;
|
|
Karsten Hopp |
f3a10e |
! nfa_set_neg_listids(start->out);
|
|
Karsten Hopp |
f3a10e |
! nfa_set_neg_listids(start->out1);
|
|
Karsten Hopp |
f3a10e |
! }
|
|
Karsten Hopp |
f3a10e |
! }
|
|
Karsten Hopp |
f3a10e |
!
|
|
Karsten Hopp |
f3a10e |
! /*
|
|
Karsten Hopp |
f3a10e |
! * Set all NFA nodes' list ID equal to 0.
|
|
Karsten Hopp |
f3a10e |
! */
|
|
Karsten Hopp |
f3a10e |
! static void
|
|
Karsten Hopp |
f3a10e |
! nfa_set_null_listids(start)
|
|
Karsten Hopp |
f3a10e |
! nfa_state_T *start;
|
|
Karsten Hopp |
f3a10e |
! {
|
|
Karsten Hopp |
f3a10e |
! if (start != NULL && start->lastlist == -1)
|
|
Karsten Hopp |
f3a10e |
! {
|
|
Karsten Hopp |
f3a10e |
! start->lastlist = 0;
|
|
Karsten Hopp |
f3a10e |
! nfa_set_null_listids(start->out);
|
|
Karsten Hopp |
f3a10e |
! nfa_set_null_listids(start->out1);
|
|
Karsten Hopp |
f3a10e |
! }
|
|
Karsten Hopp |
f3a10e |
! }
|
|
Karsten Hopp |
f3a10e |
!
|
|
Karsten Hopp |
f3a10e |
! /*
|
|
Karsten Hopp |
f3a10e |
! * Save list IDs for all NFA states in "list".
|
|
Karsten Hopp |
f3a10e |
! */
|
|
Karsten Hopp |
f3a10e |
! static void
|
|
Karsten Hopp |
f3a10e |
! nfa_save_listids(start, list)
|
|
Karsten Hopp |
f3a10e |
! nfa_state_T *start;
|
|
Karsten Hopp |
f3a10e |
int *list;
|
|
Karsten Hopp |
f3a10e |
{
|
|
Karsten Hopp |
f3a10e |
! if (start != NULL && start->lastlist != -1)
|
|
Karsten Hopp |
f3a10e |
! {
|
|
Karsten Hopp |
f3a10e |
! list[abs(start->id)] = start->lastlist;
|
|
Karsten Hopp |
f3a10e |
! start->lastlist = -1;
|
|
Karsten Hopp |
f3a10e |
! nfa_save_listids(start->out, list);
|
|
Karsten Hopp |
f3a10e |
! nfa_save_listids(start->out1, list);
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
--- 3597,3620 ----
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
/*
|
|
Karsten Hopp |
f3a10e |
! * Save list IDs for all NFA states of "prog" into "list".
|
|
Karsten Hopp |
f3a10e |
! * Also reset the IDs to zero.
|
|
Karsten Hopp |
f3a10e |
*/
|
|
Karsten Hopp |
f3a10e |
static void
|
|
Karsten Hopp |
f3a10e |
! nfa_save_listids(prog, list)
|
|
Karsten Hopp |
f3a10e |
! nfa_regprog_T *prog;
|
|
Karsten Hopp |
f3a10e |
int *list;
|
|
Karsten Hopp |
f3a10e |
{
|
|
Karsten Hopp |
f3a10e |
! int i;
|
|
Karsten Hopp |
f3a10e |
! nfa_state_T *p;
|
|
Karsten Hopp |
f3a10e |
!
|
|
Karsten Hopp |
f3a10e |
! /* Order in the list is reverse, it's a bit faster that way. */
|
|
Karsten Hopp |
f3a10e |
! p = &prog->state[0];
|
|
Karsten Hopp |
f3a10e |
! for (i = prog->nstate; --i >= 0; )
|
|
Karsten Hopp |
f3a10e |
! {
|
|
Karsten Hopp |
f3a10e |
! list[i] = p->lastlist;
|
|
Karsten Hopp |
f3a10e |
! p->lastlist = 0;
|
|
Karsten Hopp |
f3a10e |
! ++p;
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 3650,3664 ****
|
|
Karsten Hopp |
f3a10e |
* Restore list IDs from "list" to all NFA states.
|
|
Karsten Hopp |
f3a10e |
*/
|
|
Karsten Hopp |
f3a10e |
static void
|
|
Karsten Hopp |
f3a10e |
! nfa_restore_listids(start, list)
|
|
Karsten Hopp |
f3a10e |
! nfa_state_T *start;
|
|
Karsten Hopp |
f3a10e |
int *list;
|
|
Karsten Hopp |
f3a10e |
{
|
|
Karsten Hopp |
f3a10e |
! if (start != NULL && start->lastlist == -1)
|
|
Karsten Hopp |
f3a10e |
{
|
|
Karsten Hopp |
f3a10e |
! start->lastlist = list[abs(start->id)];
|
|
Karsten Hopp |
f3a10e |
! nfa_restore_listids(start->out, list);
|
|
Karsten Hopp |
f3a10e |
! nfa_restore_listids(start->out1, list);
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
--- 3622,3639 ----
|
|
Karsten Hopp |
f3a10e |
* Restore list IDs from "list" to all NFA states.
|
|
Karsten Hopp |
f3a10e |
*/
|
|
Karsten Hopp |
f3a10e |
static void
|
|
Karsten Hopp |
f3a10e |
! nfa_restore_listids(prog, list)
|
|
Karsten Hopp |
f3a10e |
! nfa_regprog_T *prog;
|
|
Karsten Hopp |
f3a10e |
int *list;
|
|
Karsten Hopp |
f3a10e |
{
|
|
Karsten Hopp |
f3a10e |
! int i;
|
|
Karsten Hopp |
f3a10e |
! nfa_state_T *p;
|
|
Karsten Hopp |
f3a10e |
!
|
|
Karsten Hopp |
f3a10e |
! p = &prog->state[0];
|
|
Karsten Hopp |
f3a10e |
! for (i = prog->nstate; --i >= 0; )
|
|
Karsten Hopp |
f3a10e |
{
|
|
Karsten Hopp |
f3a10e |
! p->lastlist = list[i];
|
|
Karsten Hopp |
f3a10e |
! ++p;
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 3673,3679 ****
|
|
Karsten Hopp |
f3a10e |
return val == pos;
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
! static int nfa_regmatch __ARGS((nfa_state_T *start, regsubs_T *submatch, regsubs_T *m));
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
/*
|
|
Karsten Hopp |
f3a10e |
* Main matching routine.
|
|
Karsten Hopp |
f3a10e |
--- 3648,3654 ----
|
|
Karsten Hopp |
f3a10e |
return val == pos;
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
! static int nfa_regmatch __ARGS((nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *submatch, regsubs_T *m));
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
/*
|
|
Karsten Hopp |
f3a10e |
* Main matching routine.
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 3686,3692 ****
|
|
Karsten Hopp |
f3a10e |
* Note: Caller must ensure that: start != NULL.
|
|
Karsten Hopp |
f3a10e |
*/
|
|
Karsten Hopp |
f3a10e |
static int
|
|
Karsten Hopp |
f3a10e |
! nfa_regmatch(start, submatch, m)
|
|
Karsten Hopp |
f3a10e |
nfa_state_T *start;
|
|
Karsten Hopp |
f3a10e |
regsubs_T *submatch;
|
|
Karsten Hopp |
f3a10e |
regsubs_T *m;
|
|
Karsten Hopp |
f3a10e |
--- 3661,3668 ----
|
|
Karsten Hopp |
f3a10e |
* Note: Caller must ensure that: start != NULL.
|
|
Karsten Hopp |
f3a10e |
*/
|
|
Karsten Hopp |
f3a10e |
static int
|
|
Karsten Hopp |
f3a10e |
! nfa_regmatch(prog, start, submatch, m)
|
|
Karsten Hopp |
f3a10e |
! nfa_regprog_T *prog;
|
|
Karsten Hopp |
f3a10e |
nfa_state_T *start;
|
|
Karsten Hopp |
f3a10e |
regsubs_T *submatch;
|
|
Karsten Hopp |
f3a10e |
regsubs_T *m;
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 3872,3878 ****
|
|
Karsten Hopp |
f3a10e |
nfa_match = TRUE;
|
|
Karsten Hopp |
f3a10e |
copy_sub(&submatch->norm, &t->subs.norm);
|
|
Karsten Hopp |
f3a10e |
#ifdef FEAT_SYN_HL
|
|
Karsten Hopp |
f3a10e |
! copy_sub(&submatch->synt, &t->subs.synt);
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
f3a10e |
log_subsexpr(&t->subs);
|
|
Karsten Hopp |
f3a10e |
--- 3848,3855 ----
|
|
Karsten Hopp |
f3a10e |
nfa_match = TRUE;
|
|
Karsten Hopp |
f3a10e |
copy_sub(&submatch->norm, &t->subs.norm);
|
|
Karsten Hopp |
f3a10e |
#ifdef FEAT_SYN_HL
|
|
Karsten Hopp |
f3a10e |
! if (nfa_has_zsubexpr)
|
|
Karsten Hopp |
f3a10e |
! copy_sub(&submatch->synt, &t->subs.synt);
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
f3a10e |
log_subsexpr(&t->subs);
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 3928,3934 ****
|
|
Karsten Hopp |
f3a10e |
{
|
|
Karsten Hopp |
f3a10e |
copy_sub(&m->norm, &t->subs.norm);
|
|
Karsten Hopp |
f3a10e |
#ifdef FEAT_SYN_HL
|
|
Karsten Hopp |
f3a10e |
! copy_sub(&m->synt, &t->subs.synt);
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
nfa_match = TRUE;
|
|
Karsten Hopp |
f3a10e |
--- 3905,3912 ----
|
|
Karsten Hopp |
f3a10e |
{
|
|
Karsten Hopp |
f3a10e |
copy_sub(&m->norm, &t->subs.norm);
|
|
Karsten Hopp |
f3a10e |
#ifdef FEAT_SYN_HL
|
|
Karsten Hopp |
f3a10e |
! if (nfa_has_zsubexpr)
|
|
Karsten Hopp |
f3a10e |
! copy_sub(&m->synt, &t->subs.synt);
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
}
|
|
Karsten Hopp |
f3a10e |
nfa_match = TRUE;
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 4024,4035 ****
|
|
Karsten Hopp |
f3a10e |
/* Have to clear the listid field of the NFA nodes, so that
|
|
Karsten Hopp |
f3a10e |
* nfa_regmatch() and addstate() can run properly after
|
|
Karsten Hopp |
f3a10e |
* recursion. */
|
|
Karsten Hopp |
f3a10e |
! nfa_save_listids(start, listids);
|
|
Karsten Hopp |
f3a10e |
! nfa_set_null_listids(start);
|
|
Karsten Hopp |
f3a10e |
nfa_endp = endposp;
|
|
Karsten Hopp |
f3a10e |
! result = nfa_regmatch(t->state->out, submatch, m);
|
|
Karsten Hopp |
f3a10e |
! nfa_set_neg_listids(start);
|
|
Karsten Hopp |
f3a10e |
! nfa_restore_listids(start, listids);
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
/* restore position in input text */
|
|
Karsten Hopp |
f3a10e |
reginput = save_reginput;
|
|
Karsten Hopp |
f3a10e |
--- 4002,4011 ----
|
|
Karsten Hopp |
f3a10e |
/* Have to clear the listid field of the NFA nodes, so that
|
|
Karsten Hopp |
f3a10e |
* nfa_regmatch() and addstate() can run properly after
|
|
Karsten Hopp |
f3a10e |
* recursion. */
|
|
Karsten Hopp |
f3a10e |
! nfa_save_listids(prog, listids);
|
|
Karsten Hopp |
f3a10e |
nfa_endp = endposp;
|
|
Karsten Hopp |
f3a10e |
! result = nfa_regmatch(prog, t->state->out, submatch, m);
|
|
Karsten Hopp |
f3a10e |
! nfa_restore_listids(prog, listids);
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
/* restore position in input text */
|
|
Karsten Hopp |
f3a10e |
reginput = save_reginput;
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 4665,4671 ****
|
|
Karsten Hopp |
f3a10e |
--- 4641,4652 ----
|
|
Karsten Hopp |
f3a10e |
#ifdef FEAT_SYN_HL
|
|
Karsten Hopp |
f3a10e |
/* Clear the external match subpointers if necessary. */
|
|
Karsten Hopp |
f3a10e |
if (prog->reghasz == REX_SET)
|
|
Karsten Hopp |
f3a10e |
+ {
|
|
Karsten Hopp |
f3a10e |
+ nfa_has_zsubexpr = TRUE;
|
|
Karsten Hopp |
f3a10e |
need_clear_zsubexpr = TRUE;
|
|
Karsten Hopp |
f3a10e |
+ }
|
|
Karsten Hopp |
f3a10e |
+ else
|
|
Karsten Hopp |
f3a10e |
+ nfa_has_zsubexpr = FALSE;
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
#ifdef ENABLE_LOG
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 4694,4700 ****
|
|
Karsten Hopp |
f3a10e |
clear_sub(&m.synt);
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
! if (nfa_regmatch(start, &subs, &m) == FALSE)
|
|
Karsten Hopp |
f3a10e |
return 0;
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
cleanup_subexpr();
|
|
Karsten Hopp |
f3a10e |
--- 4675,4681 ----
|
|
Karsten Hopp |
f3a10e |
clear_sub(&m.synt);
|
|
Karsten Hopp |
f3a10e |
#endif
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
! if (nfa_regmatch(prog, start, &subs, &m) == FALSE)
|
|
Karsten Hopp |
f3a10e |
return 0;
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
cleanup_subexpr();
|
|
Karsten Hopp |
f3a10e |
*** ../vim-7.3.1102/src/version.c 2013-06-02 19:22:05.000000000 +0200
|
|
Karsten Hopp |
f3a10e |
--- src/version.c 2013-06-02 21:24:50.000000000 +0200
|
|
Karsten Hopp |
f3a10e |
***************
|
|
Karsten Hopp |
f3a10e |
*** 730,731 ****
|
|
Karsten Hopp |
f3a10e |
--- 730,733 ----
|
|
Karsten Hopp |
f3a10e |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
f3a10e |
+ /**/
|
|
Karsten Hopp |
f3a10e |
+ 1103,
|
|
Karsten Hopp |
f3a10e |
/**/
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
--
|
|
Karsten Hopp |
f3a10e |
hundred-and-one symptoms of being an internet addict:
|
|
Karsten Hopp |
f3a10e |
53. To find out what time it is, you send yourself an e-mail and check the
|
|
Karsten Hopp |
f3a10e |
"Date:" field.
|
|
Karsten Hopp |
f3a10e |
|
|
Karsten Hopp |
f3a10e |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
f3a10e |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
f3a10e |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
f3a10e |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|