home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.3 / 7.3.1091 < prev    next >
Encoding:
Internet Message Format  |  2013-06-01  |  3.2 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.1091
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.1091
  11. Problem:    New regexp engine: no error when using \z1 or \z( where it does
  12.         not work.
  13. Solution:   Give an error message.
  14. Files:        src/regexp.c, src/regexp_nfa.c
  15.  
  16.  
  17. *** ../vim-7.3.1090/src/regexp.c    2013-06-01 19:54:39.000000000 +0200
  18. --- src/regexp.c    2013-06-02 14:56:07.000000000 +0200
  19. ***************
  20. *** 361,366 ****
  21. --- 361,368 ----
  22.   static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%(");
  23.   static char_u e_unmatchedp[] = N_("E54: Unmatched %s(");
  24.   static char_u e_unmatchedpar[] = N_("E55: Unmatched %s)");
  25. + static char_u e_z_not_allowed[] = N_("E66: \\z( not allowed here");
  26. + static char_u e_z1_not_allowed[] = N_("E67: \\z1 et al. not allowed here");
  27.   
  28.   #define NOT_MULTI    0
  29.   #define MULTI_ONE    1
  30. ***************
  31. *** 2120,2126 ****
  32.           {
  33.   #ifdef FEAT_SYN_HL
  34.           case '(': if (reg_do_extmatch != REX_SET)
  35. !                   EMSG_RET_NULL(_("E66: \\z( not allowed here"));
  36.                 if (one_exactly)
  37.                     EMSG_ONE_RET_NULL;
  38.                 ret = reg(REG_ZPAREN, &flags);
  39. --- 2122,2128 ----
  40.           {
  41.   #ifdef FEAT_SYN_HL
  42.           case '(': if (reg_do_extmatch != REX_SET)
  43. !                   EMSG_RET_NULL(_(e_z_not_allowed));
  44.                 if (one_exactly)
  45.                     EMSG_ONE_RET_NULL;
  46.                 ret = reg(REG_ZPAREN, &flags);
  47. ***************
  48. *** 2139,2145 ****
  49.           case '7':
  50.           case '8':
  51.           case '9': if (reg_do_extmatch != REX_USE)
  52. !                   EMSG_RET_NULL(_("E67: \\z1 et al. not allowed here"));
  53.                 ret = regnode(ZREF + c - '0');
  54.                 re_has_z = REX_USE;
  55.                 break;
  56. --- 2141,2147 ----
  57.           case '7':
  58.           case '8':
  59.           case '9': if (reg_do_extmatch != REX_USE)
  60. !                   EMSG_RET_NULL(_(e_z1_not_allowed));
  61.                 ret = regnode(ZREF + c - '0');
  62.                 re_has_z = REX_USE;
  63.                 break;
  64. *** ../vim-7.3.1090/src/regexp_nfa.c    2013-06-01 23:02:48.000000000 +0200
  65. --- src/regexp_nfa.c    2013-06-02 14:56:53.000000000 +0200
  66. ***************
  67. *** 865,870 ****
  68. --- 865,872 ----
  69.           case '8':
  70.           case '9':
  71.               /* \z1...\z9 */
  72. +             if (reg_do_extmatch != REX_USE)
  73. +             EMSG_RET_FAIL(_(e_z1_not_allowed));
  74.               EMIT(NFA_ZREF1 + (no_Magic(c) - '1'));
  75.               /* No need to set nfa_has_backref, the sub-matches don't
  76.                * change when \z1 .. \z9 maches or not. */
  77. ***************
  78. *** 872,877 ****
  79. --- 874,881 ----
  80.               break;
  81.           case '(':
  82.               /* \z(  */
  83. +             if (reg_do_extmatch != REX_SET)
  84. +             EMSG_RET_FAIL(_(e_z_not_allowed));
  85.               if (nfa_reg(REG_ZPAREN) == FAIL)
  86.               return FAIL;        /* cascaded error */
  87.               re_has_z = REX_SET;
  88. *** ../vim-7.3.1090/src/version.c    2013-06-01 23:02:48.000000000 +0200
  89. --- src/version.c    2013-06-02 14:58:17.000000000 +0200
  90. ***************
  91. *** 730,731 ****
  92. --- 730,733 ----
  93.   {   /* Add new patch number below this line */
  94. + /**/
  95. +     1091,
  96.   /**/
  97.  
  98. -- 
  99. Don't believe everything you hear or anything you say.
  100.  
  101.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  102. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  103. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  104.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  105.