summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-09 17:25:34 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-09 17:25:34 +0200
commit927d4a1fb58dcac856cb0959c895db899f692703 (patch)
tree0bc9bcf353453de98f041f76cd27e39d19123ab2
parent2a4e98ac1ef8c86232f51f1c7079a192eecdea82 (diff)
downloadvim-927d4a1fb58dcac856cb0959c895db899f692703.zip
updated for version 7.3.1154
Problem: New regexp_nfa engine: Uneccessary code. Solution: Remove uneccessary code.
-rw-r--r--src/regexp_nfa.c19
-rw-r--r--src/version.c2
2 files changed, 11 insertions, 10 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index c5386ce80..7e9b04ca7 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -3795,14 +3795,8 @@ addstate(l, state, subs, pim, off)
int did_print = FALSE;
#endif
- if (l == NULL || state == NULL)
- return;
-
switch (state->c)
{
- case NFA_SPLIT:
- case NFA_NOPEN:
- case NFA_SKIP_CHAR:
case NFA_NCLOSE:
case NFA_MCLOSE:
case NFA_MCLOSE1:
@@ -3827,6 +3821,9 @@ addstate(l, state, subs, pim, off)
case NFA_ZCLOSE9:
#endif
case NFA_ZEND:
+ case NFA_SPLIT:
+ case NFA_NOPEN:
+ case NFA_SKIP_CHAR:
/* These nodes are not added themselves but their "out" and/or
* "out1" may be added below. */
break;
@@ -3889,12 +3886,14 @@ skip_add:
return;
}
+ /* Do not add the state again when it exists with the same
+ * positions. */
if (has_state_with_pos(l, state, subs))
goto skip_add;
}
- /* when there are backreferences or look-behind matches the number
- * of states may be (a lot) bigger */
+ /* When there are backreferences the number of states may be (a
+ * lot) bigger than anticipated. */
if (nfa_has_backref && l->n == l->len)
{
int newlen = l->len * 3 / 2 + 50;
@@ -3985,8 +3984,8 @@ skip_add:
sub = &subs->norm;
}
- /* Set the position (with "off") in the subexpression. Save and
- * restore it when it was in use. Otherwise fill any gap. */
+ /* Set the position (with "off" added) in the subexpression. Save
+ * and restore it when it was in use. Otherwise fill any gap. */
save_ptr = NULL;
if (REG_MULTI)
{
diff --git a/src/version.c b/src/version.c
index 1f9eda61b..4b2b2f6ba 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1154,
+/**/
1153,
/**/
1152,