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.4 / 7.4.437 < prev    next >
Encoding:
Internet Message Format  |  2014-09-09  |  3.2 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.437
  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.4.437
  11. Problem:    New and old regexp engine are not consistent.
  12. Solution:   Also give an error for "\ze*" for the old regexp engine.
  13. Files:        src/regexp.c, src/regexp_nfa.c
  14.  
  15.  
  16. *** ../vim-7.4.436/src/regexp.c    2014-07-09 19:32:30.935678834 +0200
  17. --- src/regexp.c    2014-09-09 17:11:32.444539356 +0200
  18. ***************
  19. *** 358,363 ****
  20. --- 358,365 ----
  21.   static char_u    *regprop __ARGS((char_u *));
  22.   #endif
  23.   
  24. + static int re_mult_next __ARGS((char *what));
  25.   static char_u e_missingbracket[] = N_("E769: Missing ] after %s[");
  26.   static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%(");
  27.   static char_u e_unmatchedp[] = N_("E54: Unmatched %s(");
  28. ***************
  29. *** 2166,2174 ****
  30. --- 2168,2180 ----
  31.   #endif
  32.   
  33.           case 's': ret = regnode(MOPEN + 0);
  34. +               if (re_mult_next("\\zs") == FAIL)
  35. +                   return NULL;
  36.                 break;
  37.   
  38.           case 'e': ret = regnode(MCLOSE + 0);
  39. +               if (re_mult_next("\\ze") == FAIL)
  40. +                   return NULL;
  41.                 break;
  42.   
  43.           default:  EMSG_RET_NULL(_("E68: Invalid character after \\z"));
  44. ***************
  45. *** 7005,7010 ****
  46. --- 7011,7028 ----
  47.   }
  48.   #endif        /* DEBUG */
  49.   
  50. + /*
  51. +  * Used in a place where no * or \+ can follow.
  52. +  */
  53. +     static int
  54. + re_mult_next(what)
  55. +     char *what;
  56. + {
  57. +     if (re_multi_type(peekchr()) == MULTI_MULT)
  58. +     EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
  59. +     return OK;
  60. + }
  61.   #ifdef FEAT_MBYTE
  62.   static void mb_decompose __ARGS((int c, int *c1, int *c2, int *c3));
  63.   
  64. *** ../vim-7.4.436/src/regexp_nfa.c    2014-08-29 11:56:21.350422045 +0200
  65. --- src/regexp_nfa.c    2014-09-09 17:10:17.572539193 +0200
  66. ***************
  67. *** 291,297 ****
  68.   static int nfa_regconcat __ARGS((void));
  69.   static int nfa_regbranch __ARGS((void));
  70.   static int nfa_reg __ARGS((int paren));
  71. - static int re_mult_next __ARGS((char *what));
  72.   #ifdef DEBUG
  73.   static void nfa_set_code __ARGS((int c));
  74.   static void nfa_postfix_dump __ARGS((char_u *expr, int retval));
  75. --- 291,296 ----
  76. ***************
  77. *** 2281,2298 ****
  78.       return OK;
  79.   }
  80.   
  81. - /*
  82. -  * Used in a place where no * or \+ can follow.
  83. -  */
  84. -     static int
  85. - re_mult_next(what)
  86. -     char *what;
  87. - {
  88. -     if (re_multi_type(peekchr()) == MULTI_MULT)
  89. -     EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
  90. -     return OK;
  91. - }
  92.   #ifdef DEBUG
  93.   static char_u code[50];
  94.   
  95. --- 2280,2285 ----
  96. *** ../vim-7.4.436/src/version.c    2014-09-09 16:59:34.792537789 +0200
  97. --- src/version.c    2014-09-09 17:12:34.352539491 +0200
  98. ***************
  99. *** 743,744 ****
  100. --- 743,746 ----
  101.   {   /* Add new patch number below this line */
  102. + /**/
  103. +     437,
  104.   /**/
  105.  
  106. -- 
  107. hundred-and-one symptoms of being an internet addict:
  108. 110. You actually volunteer to become your employer's webmaster.
  109.  
  110.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  111. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  112. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  113.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  114.