]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.1217 v7.3.1217
authorBram Moolenaar <Bram@vim.org>
Mon, 17 Jun 2013 19:33:41 +0000 (21:33 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 17 Jun 2013 19:33:41 +0000 (21:33 +0200)
Problem:    New regexp engine: Can't handle \%[[ao]]. (Yukihiro Nakadaira)
Solution:   Support nested atoms inside \%[].

src/regexp_nfa.c
src/testdir/test64.in
src/testdir/test64.ok
src/version.c

index fc87e39fb34190480a7aa91f83126313daed8f3e..f11c01a9c79b4c5c673687355f66ff18bafb4d4e 100644 (file)
@@ -1150,13 +1150,16 @@ nfa_regatom()
                        int         n;
 
                        /* \%[abc] */
-                       for (n = 0; (c = getchr()) != ']'; ++n)
+                       for (n = 0; (c = peekchr()) != ']'; ++n)
                        {
                            if (c == NUL)
                                EMSG2_RET_FAIL(_(e_missing_sb),
                                                      reg_magic == MAGIC_ALL);
-                           EMIT(c);
+                           /* recursive call! */
+                           if (nfa_regatom() == FAIL)
+                               return FAIL;
                        }
+                       getchr();  /* get the ] */
                        if (n == 0)
                            EMSG2_RET_FAIL(_(e_empty_sb),
                                                      reg_magic == MAGIC_ALL);
index 0cabcdfc03ce7f2dbdb7cc9f40edf8a4ff0be919..061f1f1e7d5a4537143c4c4e3e58e33bc50aa392 100644 (file)
@@ -366,6 +366,7 @@ STARTTEST
 :call add(tl, [2, '\%[bar]x', 'barxx', 'barx'])
 :call add(tl, [2, '\%[bar]x', 'bxx', 'bx'])
 :call add(tl, [2, '\%[bar]x', 'xxx', 'x'])
+:call add(tl, [2, 'b\%[[ao]r]', 'bar bor', 'bar'])
 :"
 :"""" Alternatives, must use first longest match
 :call add(tl, [2, 'goo\|go', 'google', 'goo'])
index fda589223d9ce0826cdd1fc9afd0fb5f4229d1fe..7021d18b59c449b56d401aeb999e963331d70212 100644 (file)
@@ -836,6 +836,9 @@ OK 2 - \%[bar]x
 OK 0 - \%[bar]x
 OK 1 - \%[bar]x
 OK 2 - \%[bar]x
+OK 0 - b\%[[ao]r]
+OK 1 - b\%[[ao]r]
+OK 2 - b\%[[ao]r]
 OK 0 - goo\|go
 OK 1 - goo\|go
 OK 2 - goo\|go
index e1c4ebcf76a819d1511f8d8589f05db4f423ef7b..86f8a858f257930531bcbb83544ce8e3502d1d10 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1217,
 /**/
     1216,
 /**/