|
Karsten Hopp |
a4509a |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
a4509a |
Subject: Patch 7.4.600
|
|
Karsten Hopp |
a4509a |
Fcc: outbox
|
|
Karsten Hopp |
a4509a |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
a4509a |
Mime-Version: 1.0
|
|
Karsten Hopp |
a4509a |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
a4509a |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
a4509a |
------------
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
Patch 7.4.600
|
|
Karsten Hopp |
a4509a |
Problem: Memory wasted in struct because of aligning.
|
|
Karsten Hopp |
a4509a |
Solution: Split pos in lnum and col. (Dominique Pelle)
|
|
Karsten Hopp |
a4509a |
Files: src/regexp_nfa.c
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
*** ../vim-7.4.599/src/regexp_nfa.c 2015-01-27 14:39:55.661913204 +0100
|
|
Karsten Hopp |
a4509a |
--- src/regexp_nfa.c 2015-01-27 14:43:04.323847916 +0100
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 1456,1462 ****
|
|
Karsten Hopp |
a4509a |
* matched an unlimited number of times. NFA_NOPEN is
|
|
Karsten Hopp |
a4509a |
* added only once at a position, while NFA_SPLIT is
|
|
Karsten Hopp |
a4509a |
* added multiple times. This is more efficient than
|
|
Karsten Hopp |
a4509a |
! * not allowsing NFA_SPLIT multiple times, it is used
|
|
Karsten Hopp |
a4509a |
* a lot. */
|
|
Karsten Hopp |
a4509a |
EMIT(NFA_NOPEN);
|
|
Karsten Hopp |
a4509a |
break;
|
|
Karsten Hopp |
a4509a |
--- 1456,1462 ----
|
|
Karsten Hopp |
a4509a |
* matched an unlimited number of times. NFA_NOPEN is
|
|
Karsten Hopp |
a4509a |
* added only once at a position, while NFA_SPLIT is
|
|
Karsten Hopp |
a4509a |
* added multiple times. This is more efficient than
|
|
Karsten Hopp |
a4509a |
! * not allowing NFA_SPLIT multiple times, it is used
|
|
Karsten Hopp |
a4509a |
* a lot. */
|
|
Karsten Hopp |
a4509a |
EMIT(NFA_NOPEN);
|
|
Karsten Hopp |
a4509a |
break;
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 3726,3733 ****
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
struct multipos
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! lpos_T start;
|
|
Karsten Hopp |
a4509a |
! lpos_T end;
|
|
Karsten Hopp |
a4509a |
} multi[NSUBEXP];
|
|
Karsten Hopp |
a4509a |
struct linepos
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
--- 3726,3735 ----
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
struct multipos
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! linenr_T start_lnum;
|
|
Karsten Hopp |
a4509a |
! linenr_T end_lnum;
|
|
Karsten Hopp |
a4509a |
! colnr_T start_col;
|
|
Karsten Hopp |
a4509a |
! colnr_T end_col;
|
|
Karsten Hopp |
a4509a |
} multi[NSUBEXP];
|
|
Karsten Hopp |
a4509a |
struct linepos
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 3812,3821 ****
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
fprintf(log_fd, "*** group %d, start: c=%d, l=%d, end: c=%d, l=%d\n",
|
|
Karsten Hopp |
a4509a |
j,
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[j].start.col,
|
|
Karsten Hopp |
a4509a |
! (int)sub->list.multi[j].start.lnum,
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[j].end.col,
|
|
Karsten Hopp |
a4509a |
! (int)sub->list.multi[j].end.lnum);
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
char *s = (char *)sub->list.line[j].start;
|
|
Karsten Hopp |
a4509a |
--- 3814,3823 ----
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
fprintf(log_fd, "*** group %d, start: c=%d, l=%d, end: c=%d, l=%d\n",
|
|
Karsten Hopp |
a4509a |
j,
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[j].start_col,
|
|
Karsten Hopp |
a4509a |
! (int)sub->list.multi[j].start_lnum,
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[j].end_col,
|
|
Karsten Hopp |
a4509a |
! (int)sub->list.multi[j].end_lnum);
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
char *s = (char *)sub->list.line[j].start;
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 3952,3959 ****
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! if (from->list.multi[0].end.lnum >= 0)
|
|
Karsten Hopp |
a4509a |
! to->list.multi[0].end = from->list.multi[0].end;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
--- 3954,3964 ----
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! if (from->list.multi[0].end_lnum >= 0)
|
|
Karsten Hopp |
a4509a |
! {
|
|
Karsten Hopp |
a4509a |
! to->list.multi[0].end_lnum = from->list.multi[0].end_lnum;
|
|
Karsten Hopp |
a4509a |
! to->list.multi[0].end_col = from->list.multi[0].end_col;
|
|
Karsten Hopp |
a4509a |
! }
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 3985,4017 ****
|
|
Karsten Hopp |
a4509a |
for (i = 0; i < todo; ++i)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (i < sub1->in_use)
|
|
Karsten Hopp |
a4509a |
! s1 = sub1->list.multi[i].start.lnum;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
s1 = -1;
|
|
Karsten Hopp |
a4509a |
if (i < sub2->in_use)
|
|
Karsten Hopp |
a4509a |
! s2 = sub2->list.multi[i].start.lnum;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
s2 = -1;
|
|
Karsten Hopp |
a4509a |
if (s1 != s2)
|
|
Karsten Hopp |
a4509a |
return FALSE;
|
|
Karsten Hopp |
a4509a |
! if (s1 != -1 && sub1->list.multi[i].start.col
|
|
Karsten Hopp |
a4509a |
! != sub2->list.multi[i].start.col)
|
|
Karsten Hopp |
a4509a |
return FALSE;
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
if (nfa_has_backref)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (i < sub1->in_use)
|
|
Karsten Hopp |
a4509a |
! s1 = sub1->list.multi[i].end.lnum;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
s1 = -1;
|
|
Karsten Hopp |
a4509a |
if (i < sub2->in_use)
|
|
Karsten Hopp |
a4509a |
! s2 = sub2->list.multi[i].end.lnum;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
s2 = -1;
|
|
Karsten Hopp |
a4509a |
if (s1 != s2)
|
|
Karsten Hopp |
a4509a |
return FALSE;
|
|
Karsten Hopp |
a4509a |
! if (s1 != -1 && sub1->list.multi[i].end.col
|
|
Karsten Hopp |
a4509a |
! != sub2->list.multi[i].end.col)
|
|
Karsten Hopp |
a4509a |
return FALSE;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
--- 3990,4022 ----
|
|
Karsten Hopp |
a4509a |
for (i = 0; i < todo; ++i)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (i < sub1->in_use)
|
|
Karsten Hopp |
a4509a |
! s1 = sub1->list.multi[i].start_lnum;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
s1 = -1;
|
|
Karsten Hopp |
a4509a |
if (i < sub2->in_use)
|
|
Karsten Hopp |
a4509a |
! s2 = sub2->list.multi[i].start_lnum;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
s2 = -1;
|
|
Karsten Hopp |
a4509a |
if (s1 != s2)
|
|
Karsten Hopp |
a4509a |
return FALSE;
|
|
Karsten Hopp |
a4509a |
! if (s1 != -1 && sub1->list.multi[i].start_col
|
|
Karsten Hopp |
a4509a |
! != sub2->list.multi[i].start_col)
|
|
Karsten Hopp |
a4509a |
return FALSE;
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
if (nfa_has_backref)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (i < sub1->in_use)
|
|
Karsten Hopp |
a4509a |
! s1 = sub1->list.multi[i].end_lnum;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
s1 = -1;
|
|
Karsten Hopp |
a4509a |
if (i < sub2->in_use)
|
|
Karsten Hopp |
a4509a |
! s2 = sub2->list.multi[i].end_lnum;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
s2 = -1;
|
|
Karsten Hopp |
a4509a |
if (s1 != s2)
|
|
Karsten Hopp |
a4509a |
return FALSE;
|
|
Karsten Hopp |
a4509a |
! if (s1 != -1 && sub1->list.multi[i].end_col
|
|
Karsten Hopp |
a4509a |
! != sub2->list.multi[i].end_col)
|
|
Karsten Hopp |
a4509a |
return FALSE;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 4062,4068 ****
|
|
Karsten Hopp |
a4509a |
if (sub->in_use <= 0)
|
|
Karsten Hopp |
a4509a |
col = -1;
|
|
Karsten Hopp |
a4509a |
else if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
! col = sub->list.multi[0].start.col;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
col = (int)(sub->list.line[0].start - regline);
|
|
Karsten Hopp |
a4509a |
nfa_set_code(state->c);
|
|
Karsten Hopp |
a4509a |
--- 4067,4073 ----
|
|
Karsten Hopp |
a4509a |
if (sub->in_use <= 0)
|
|
Karsten Hopp |
a4509a |
col = -1;
|
|
Karsten Hopp |
a4509a |
else if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
! col = sub->list.multi[0].start_col;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
col = (int)(sub->list.line[0].start - regline);
|
|
Karsten Hopp |
a4509a |
nfa_set_code(state->c);
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 4482,4488 ****
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (subidx < sub->in_use)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! save_lpos = sub->list.multi[subidx].start;
|
|
Karsten Hopp |
a4509a |
save_in_use = -1;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
--- 4487,4494 ----
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (subidx < sub->in_use)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! save_lpos.lnum = sub->list.multi[subidx].start_lnum;
|
|
Karsten Hopp |
a4509a |
! save_lpos.col = sub->list.multi[subidx].start_col;
|
|
Karsten Hopp |
a4509a |
save_in_use = -1;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 4490,4509 ****
|
|
Karsten Hopp |
a4509a |
save_in_use = sub->in_use;
|
|
Karsten Hopp |
a4509a |
for (i = sub->in_use; i < subidx; ++i)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[i].start.lnum = -1;
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[i].end.lnum = -1;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
sub->in_use = subidx + 1;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
if (off == -1)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start.lnum = reglnum + 1;
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start.col = 0;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start.lnum = reglnum;
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start.col =
|
|
Karsten Hopp |
a4509a |
(colnr_T)(reginput - regline + off);
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
--- 4496,4515 ----
|
|
Karsten Hopp |
a4509a |
save_in_use = sub->in_use;
|
|
Karsten Hopp |
a4509a |
for (i = sub->in_use; i < subidx; ++i)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[i].start_lnum = -1;
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[i].end_lnum = -1;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
sub->in_use = subidx + 1;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
if (off == -1)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start_lnum = reglnum + 1;
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start_col = 0;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start_lnum = reglnum;
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start_col =
|
|
Karsten Hopp |
a4509a |
(colnr_T)(reginput - regline + off);
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 4539,4545 ****
|
|
Karsten Hopp |
a4509a |
if (save_in_use == -1)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start = save_lpos;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
sub->list.line[subidx].start = save_ptr;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
--- 4545,4554 ----
|
|
Karsten Hopp |
a4509a |
if (save_in_use == -1)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
! {
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start_lnum = save_lpos.lnum;
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start_col = save_lpos.col;
|
|
Karsten Hopp |
a4509a |
! }
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
sub->list.line[subidx].start = save_ptr;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 4549,4555 ****
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
case NFA_MCLOSE:
|
|
Karsten Hopp |
a4509a |
if (nfa_has_zend && (REG_MULTI
|
|
Karsten Hopp |
a4509a |
! ? subs->norm.list.multi[0].end.lnum >= 0
|
|
Karsten Hopp |
a4509a |
: subs->norm.list.line[0].end != NULL))
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
/* Do not overwrite the position set by \ze. */
|
|
Karsten Hopp |
a4509a |
--- 4558,4564 ----
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
case NFA_MCLOSE:
|
|
Karsten Hopp |
a4509a |
if (nfa_has_zend && (REG_MULTI
|
|
Karsten Hopp |
a4509a |
! ? subs->norm.list.multi[0].end_lnum >= 0
|
|
Karsten Hopp |
a4509a |
: subs->norm.list.line[0].end != NULL))
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
/* Do not overwrite the position set by \ze. */
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 4603,4618 ****
|
|
Karsten Hopp |
a4509a |
sub->in_use = subidx + 1;
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! save_lpos = sub->list.multi[subidx].end;
|
|
Karsten Hopp |
a4509a |
if (off == -1)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end.lnum = reglnum + 1;
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end.col = 0;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end.lnum = reglnum;
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end.col =
|
|
Karsten Hopp |
a4509a |
(colnr_T)(reginput - regline + off);
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
/* avoid compiler warnings */
|
|
Karsten Hopp |
a4509a |
--- 4612,4628 ----
|
|
Karsten Hopp |
a4509a |
sub->in_use = subidx + 1;
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! save_lpos.lnum = sub->list.multi[subidx].end_lnum;
|
|
Karsten Hopp |
a4509a |
! save_lpos.col = sub->list.multi[subidx].end_col;
|
|
Karsten Hopp |
a4509a |
if (off == -1)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end_lnum = reglnum + 1;
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end_col = 0;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end_lnum = reglnum;
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end_col =
|
|
Karsten Hopp |
a4509a |
(colnr_T)(reginput - regline + off);
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
/* avoid compiler warnings */
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 4637,4643 ****
|
|
Karsten Hopp |
a4509a |
sub = &subs->norm;
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end = save_lpos;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
sub->list.line[subidx].end = save_ptr;
|
|
Karsten Hopp |
a4509a |
sub->in_use = save_in_use;
|
|
Karsten Hopp |
a4509a |
--- 4647,4656 ----
|
|
Karsten Hopp |
a4509a |
sub = &subs->norm;
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
! {
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end_lnum = save_lpos.lnum;
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end_col = save_lpos.col;
|
|
Karsten Hopp |
a4509a |
! }
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
sub->list.line[subidx].end = save_ptr;
|
|
Karsten Hopp |
a4509a |
sub->in_use = save_in_use;
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 4825,4839 ****
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! if (sub->list.multi[subidx].start.lnum < 0
|
|
Karsten Hopp |
a4509a |
! || sub->list.multi[subidx].end.lnum < 0)
|
|
Karsten Hopp |
a4509a |
goto retempty;
|
|
Karsten Hopp |
a4509a |
! if (sub->list.multi[subidx].start.lnum == reglnum
|
|
Karsten Hopp |
a4509a |
! && sub->list.multi[subidx].end.lnum == reglnum)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! len = sub->list.multi[subidx].end.col
|
|
Karsten Hopp |
a4509a |
! - sub->list.multi[subidx].start.col;
|
|
Karsten Hopp |
a4509a |
! if (cstrncmp(regline + sub->list.multi[subidx].start.col,
|
|
Karsten Hopp |
a4509a |
reginput, &len) == 0)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
*bytelen = len;
|
|
Karsten Hopp |
a4509a |
--- 4838,4852 ----
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! if (sub->list.multi[subidx].start_lnum < 0
|
|
Karsten Hopp |
a4509a |
! || sub->list.multi[subidx].end_lnum < 0)
|
|
Karsten Hopp |
a4509a |
goto retempty;
|
|
Karsten Hopp |
a4509a |
! if (sub->list.multi[subidx].start_lnum == reglnum
|
|
Karsten Hopp |
a4509a |
! && sub->list.multi[subidx].end_lnum == reglnum)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! len = sub->list.multi[subidx].end_col
|
|
Karsten Hopp |
a4509a |
! - sub->list.multi[subidx].start_col;
|
|
Karsten Hopp |
a4509a |
! if (cstrncmp(regline + sub->list.multi[subidx].start_col,
|
|
Karsten Hopp |
a4509a |
reginput, &len) == 0)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
*bytelen = len;
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 4843,4852 ****
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (match_with_backref(
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start.lnum,
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start.col,
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end.lnum,
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end.col,
|
|
Karsten Hopp |
a4509a |
bytelen) == RA_MATCH)
|
|
Karsten Hopp |
a4509a |
return TRUE;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
--- 4856,4865 ----
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (match_with_backref(
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start_lnum,
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].start_col,
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end_lnum,
|
|
Karsten Hopp |
a4509a |
! sub->list.multi[subidx].end_col,
|
|
Karsten Hopp |
a4509a |
bytelen) == RA_MATCH)
|
|
Karsten Hopp |
a4509a |
return TRUE;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 5441,5446 ****
|
|
Karsten Hopp |
a4509a |
--- 5454,5460 ----
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
/* Allocate memory for the lists of nodes. */
|
|
Karsten Hopp |
a4509a |
size = (nstate + 1) * sizeof(nfa_thread_T);
|
|
Karsten Hopp |
a4509a |
+
|
|
Karsten Hopp |
a4509a |
list[0].t = (nfa_thread_T *)lalloc(size, TRUE);
|
|
Karsten Hopp |
a4509a |
list[0].len = nstate + 1;
|
|
Karsten Hopp |
a4509a |
list[1].t = (nfa_thread_T *)lalloc(size, TRUE);
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 5482,5489 ****
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! m->norm.list.multi[0].start.lnum = reglnum;
|
|
Karsten Hopp |
a4509a |
! m->norm.list.multi[0].start.col = (colnr_T)(reginput - regline);
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
m->norm.list.line[0].start = reginput;
|
|
Karsten Hopp |
a4509a |
--- 5496,5503 ----
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! m->norm.list.multi[0].start_lnum = reglnum;
|
|
Karsten Hopp |
a4509a |
! m->norm.list.multi[0].start_col = (colnr_T)(reginput - regline);
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
m->norm.list.line[0].start = reginput;
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 5580,5586 ****
|
|
Karsten Hopp |
a4509a |
if (t->subs.norm.in_use <= 0)
|
|
Karsten Hopp |
a4509a |
col = -1;
|
|
Karsten Hopp |
a4509a |
else if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
! col = t->subs.norm.list.multi[0].start.col;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
col = (int)(t->subs.norm.list.line[0].start - regline);
|
|
Karsten Hopp |
a4509a |
nfa_set_code(t->state->c);
|
|
Karsten Hopp |
a4509a |
--- 5594,5600 ----
|
|
Karsten Hopp |
a4509a |
if (t->subs.norm.in_use <= 0)
|
|
Karsten Hopp |
a4509a |
col = -1;
|
|
Karsten Hopp |
a4509a |
else if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
! col = t->subs.norm.list.multi[0].start_col;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
col = (int)(t->subs.norm.list.line[0].start - regline);
|
|
Karsten Hopp |
a4509a |
nfa_set_code(t->state->c);
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 5861,5867 ****
|
|
Karsten Hopp |
a4509a |
* continue with what follows. */
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
/* TODO: multi-line match */
|
|
Karsten Hopp |
a4509a |
! bytelen = m->norm.list.multi[0].end.col
|
|
Karsten Hopp |
a4509a |
- (int)(reginput - regline);
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
bytelen = (int)(m->norm.list.line[0].end - reginput);
|
|
Karsten Hopp |
a4509a |
--- 5875,5881 ----
|
|
Karsten Hopp |
a4509a |
* continue with what follows. */
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
/* TODO: multi-line match */
|
|
Karsten Hopp |
a4509a |
! bytelen = m->norm.list.multi[0].end_col
|
|
Karsten Hopp |
a4509a |
- (int)(reginput - regline);
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
bytelen = (int)(m->norm.list.line[0].end - reginput);
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 6741,6747 ****
|
|
Karsten Hopp |
a4509a |
if (add)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
! m->norm.list.multi[0].start.col =
|
|
Karsten Hopp |
a4509a |
(colnr_T)(reginput - regline) + clen;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
m->norm.list.line[0].start = reginput + clen;
|
|
Karsten Hopp |
a4509a |
--- 6755,6761 ----
|
|
Karsten Hopp |
a4509a |
if (add)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
if (REG_MULTI)
|
|
Karsten Hopp |
a4509a |
! m->norm.list.multi[0].start_col =
|
|
Karsten Hopp |
a4509a |
(colnr_T)(reginput - regline) + clen;
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
m->norm.list.line[0].start = reginput + clen;
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 6854,6861 ****
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
for (i = 0; i < subs.norm.in_use; i++)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! reg_startpos[i] = subs.norm.list.multi[i].start;
|
|
Karsten Hopp |
a4509a |
! reg_endpos[i] = subs.norm.list.multi[i].end;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
if (reg_startpos[0].lnum < 0)
|
|
Karsten Hopp |
a4509a |
--- 6868,6878 ----
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
for (i = 0; i < subs.norm.in_use; i++)
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
! reg_startpos[i].lnum = subs.norm.list.multi[i].start_lnum;
|
|
Karsten Hopp |
a4509a |
! reg_startpos[i].col = subs.norm.list.multi[i].start_col;
|
|
Karsten Hopp |
a4509a |
!
|
|
Karsten Hopp |
a4509a |
! reg_endpos[i].lnum = subs.norm.list.multi[i].end_lnum;
|
|
Karsten Hopp |
a4509a |
! reg_endpos[i].col = subs.norm.list.multi[i].end_col;
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
if (reg_startpos[0].lnum < 0)
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 6903,6915 ****
|
|
Karsten Hopp |
a4509a |
struct multipos *mpos = &subs.synt.list.multi[i];
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
/* Only accept single line matches that are valid. */
|
|
Karsten Hopp |
a4509a |
! if (mpos->start.lnum >= 0
|
|
Karsten Hopp |
a4509a |
! && mpos->start.lnum == mpos->end.lnum
|
|
Karsten Hopp |
a4509a |
! && mpos->end.col >= mpos->start.col)
|
|
Karsten Hopp |
a4509a |
re_extmatch_out->matches[i] =
|
|
Karsten Hopp |
a4509a |
! vim_strnsave(reg_getline(mpos->start.lnum)
|
|
Karsten Hopp |
a4509a |
! + mpos->start.col,
|
|
Karsten Hopp |
a4509a |
! mpos->end.col - mpos->start.col);
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
--- 6920,6932 ----
|
|
Karsten Hopp |
a4509a |
struct multipos *mpos = &subs.synt.list.multi[i];
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
/* Only accept single line matches that are valid. */
|
|
Karsten Hopp |
a4509a |
! if (mpos->start_lnum >= 0
|
|
Karsten Hopp |
a4509a |
! && mpos->start_lnum == mpos->end_lnum
|
|
Karsten Hopp |
a4509a |
! && mpos->end_col >= mpos->start_col)
|
|
Karsten Hopp |
a4509a |
re_extmatch_out->matches[i] =
|
|
Karsten Hopp |
a4509a |
! vim_strnsave(reg_getline(mpos->start_lnum)
|
|
Karsten Hopp |
a4509a |
! + mpos->start_col,
|
|
Karsten Hopp |
a4509a |
! mpos->end_col - mpos->start_col);
|
|
Karsten Hopp |
a4509a |
}
|
|
Karsten Hopp |
a4509a |
else
|
|
Karsten Hopp |
a4509a |
{
|
|
Karsten Hopp |
a4509a |
*** ../vim-7.4.599/src/version.c 2015-01-27 14:39:55.661913204 +0100
|
|
Karsten Hopp |
a4509a |
--- src/version.c 2015-01-27 14:44:06.739164665 +0100
|
|
Karsten Hopp |
a4509a |
***************
|
|
Karsten Hopp |
a4509a |
*** 743,744 ****
|
|
Karsten Hopp |
a4509a |
--- 743,746 ----
|
|
Karsten Hopp |
a4509a |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
a4509a |
+ /**/
|
|
Karsten Hopp |
a4509a |
+ 600,
|
|
Karsten Hopp |
a4509a |
/**/
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
--
|
|
Karsten Hopp |
a4509a |
hundred-and-one symptoms of being an internet addict:
|
|
Karsten Hopp |
a4509a |
126. You brag to all of your friends about your date Saturday night...but
|
|
Karsten Hopp |
a4509a |
you don't tell them it was only in a chat room.
|
|
Karsten Hopp |
a4509a |
|
|
Karsten Hopp |
a4509a |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
a4509a |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
a4509a |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
a4509a |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|