changeset 4897:91136a41f83f v7.3.1194

updated for version 7.3.1194 Problem: Yaml highlighting is slow. Solution: Tune the estimation of pattern failure chance.
author Bram Moolenaar <bram@vim.org>
date Fri, 14 Jun 2013 22:33:51 +0200
parents 3f4f0bd1011c
children 1011f04e527f
files src/regexp_nfa.c src/version.c
diffstat 2 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -4686,6 +4686,18 @@ failure_chance(state, depth)
 	    /* empty match works always */
 	    return 0;
 
+	case NFA_START_INVISIBLE:
+	case NFA_START_INVISIBLE_FIRST:
+	case NFA_START_INVISIBLE_NEG:
+	case NFA_START_INVISIBLE_NEG_FIRST:
+	case NFA_START_INVISIBLE_BEFORE:
+	case NFA_START_INVISIBLE_BEFORE_FIRST:
+	case NFA_START_INVISIBLE_BEFORE_NEG:
+	case NFA_START_INVISIBLE_BEFORE_NEG_FIRST:
+	case NFA_START_PATTERN:
+	    /* recursive regmatch is expensive, use low failure chance */
+	    return 5;
+
 	case NFA_BOL:
 	case NFA_EOL:
 	case NFA_BOF:
@@ -5264,7 +5276,7 @@ nfa_regmatch(prog, start, submatch, m)
 		    skip_lid = nextlist->id;
 #endif
 		}
-		else if(state_in_list(thislist,
+		else if (state_in_list(thislist,
 					  t->state->out1->out->out, &t->subs))
 		{
 		    skip = t->state->out1->out->out;
--- 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 */
 /**/
+    1194,
+/**/
     1193,
 /**/
     1192,