| To: vim_dev@googlegroups.com |
| Subject: Patch 7.3.1104 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.3.1104 |
| Problem: New regexp engine does not handle "~". |
| Solution: Add support for "~". |
| Files: src/regexp_nfa.c, src/testdir/test24.in, src/testdir/test24.ok |
| |
| |
| |
| |
| |
| *** 829,837 **** |
| EMSGN(_(e_misplaced), no_Magic(c)); |
| return FAIL; |
| |
| ! case Magic('~'): /* previous substitute pattern */ |
| ! /* TODO: Not supported yet */ |
| ! return FAIL; |
| |
| case Magic('1'): |
| case Magic('2'): |
| --- 829,854 ---- |
| EMSGN(_(e_misplaced), no_Magic(c)); |
| 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'): |
| |
| |
| |
| *** 44,49 **** |
| --- 44,56 ---- |
| :s/^\(\h\w*\%(->\|\.\)\=\)\+=/XX/ |
| |
| :s/^\(\h\w*\%(->\|\.\)\=\)\+=/YY/ |
| + |
| + :s/aaa/xyz/ |
| + |
| + :s/~/bcd/ |
| + |
| + :s/~\+/BB/ |
| + :" |
| :?start?,$w! test.out |
| :qa! |
| ENDTEST |
| |
| *** 77,79 **** |
| --- 84,89 ---- |
| xx an file xx |
| x= 9; |
| hh= 77; |
| + aaa |
| + xyz |
| + bcdbcdbcd |
| |
| |
| |
| *** 27,29 **** |
| --- 27,32 ---- |
| xx an A xx |
| XX 9; |
| YY 77; |
| + xyz |
| + bcd |
| + BB |
| |
| |
| |
| *** 730,731 **** |
| --- 730,733 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 1104, |
| /**/ |
| |
| -- |
| Q: What is a patch 22? |
| A: A patch you need to include to make it possible to include patches. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ an exciting new programming language -- http://www.Zimbu.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |