diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-06-02 22:08:03 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-06-02 22:08:03 +0200 |
commit | f18fb7af7504a47e59ce85ddd1e50b56651a80d3 (patch) | |
tree | 8f38232b36951464721f1491f3051a17396e48b5 | |
parent | f6de032afe1c4583cd4df585a7d46f93740357dc (diff) |
updated for version 7.3.1104v7.3.1104
Problem: New regexp engine does not handle "~".
Solution: Add support for "~".
-rw-r--r-- | src/regexp_nfa.c | 23 | ||||
-rw-r--r-- | src/testdir/test24.in | bin | 1240 -> 1301 bytes | |||
-rw-r--r-- | src/testdir/test24.ok | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 25 insertions, 3 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index f9b1888614..6b6d369777 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -829,9 +829,26 @@ nfa_regatom() EMSGN(_(e_misplaced), no_Magic(c)); return FAIL; - case Magic('~'): /* previous substitute pattern */ - /* TODO: Not supported yet */ - return FAIL; + case Magic('~'): + { + char_u *lp; + + /* Previous substitute pattern. + * Generated as "\%(pattern\)". */ + if (reg_prev_sub == NULL) + { + EMSG(_(e_nopresub)); + return FAIL; + } + for (lp = reg_prev_sub; *lp != NUL; mb_cptr_adv(lp)) + { + EMIT(PTR2CHAR(lp)); + if (lp != reg_prev_sub) + EMIT(NFA_CONCAT); + } + EMIT(NFA_NOPEN); + break; + } case Magic('1'): case Magic('2'): diff --git a/src/testdir/test24.in b/src/testdir/test24.in Binary files differindex 80eb90bf69..7dfc1afdc6 100644 --- a/src/testdir/test24.in +++ b/src/testdir/test24.in diff --git a/src/testdir/test24.ok b/src/testdir/test24.ok index ed25dd4364..cd61210968 100644 --- a/src/testdir/test24.ok +++ b/src/testdir/test24.ok @@ -27,3 +27,6 @@ xx foobar xA xx xx an A xx XX 9; YY 77; + xyz + bcd + BB diff --git a/src/version.c b/src/version.c index 2ec2881430..57320724c7 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 */ /**/ + 1104, +/**/ 1103, /**/ 1102, |