Mercurial > vim
comparison src/regexp_nfa.c @ 4714:fc4d7f02ea3a v7.3.1104
updated for version 7.3.1104
Problem: New regexp engine does not handle "~".
Solution: Add support for "~".
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 02 Jun 2013 22:08:03 +0200 |
parents | 832bf8136d86 |
children | a804309e7327 |
comparison
equal
deleted
inserted
replaced
4713:7a2f465822c4 | 4714:fc4d7f02ea3a |
---|---|
827 /* these should follow an atom, not form an atom */ | 827 /* these should follow an atom, not form an atom */ |
828 syntax_error = TRUE; | 828 syntax_error = TRUE; |
829 EMSGN(_(e_misplaced), no_Magic(c)); | 829 EMSGN(_(e_misplaced), no_Magic(c)); |
830 return FAIL; | 830 return FAIL; |
831 | 831 |
832 case Magic('~'): /* previous substitute pattern */ | 832 case Magic('~'): |
833 /* TODO: Not supported yet */ | 833 { |
834 return FAIL; | 834 char_u *lp; |
835 | |
836 /* Previous substitute pattern. | |
837 * Generated as "\%(pattern\)". */ | |
838 if (reg_prev_sub == NULL) | |
839 { | |
840 EMSG(_(e_nopresub)); | |
841 return FAIL; | |
842 } | |
843 for (lp = reg_prev_sub; *lp != NUL; mb_cptr_adv(lp)) | |
844 { | |
845 EMIT(PTR2CHAR(lp)); | |
846 if (lp != reg_prev_sub) | |
847 EMIT(NFA_CONCAT); | |
848 } | |
849 EMIT(NFA_NOPEN); | |
850 break; | |
851 } | |
835 | 852 |
836 case Magic('1'): | 853 case Magic('1'): |
837 case Magic('2'): | 854 case Magic('2'): |
838 case Magic('3'): | 855 case Magic('3'): |
839 case Magic('4'): | 856 case Magic('4'): |