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.289 < prev    next >
Encoding:
Internet Message Format  |  2014-05-12  |  3.5 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.289
  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.289
  11. Problem:    Pattern with repeated backreference does not match with new regexp
  12.         engine. (Urtica Dioica)
  13. Solution:   Also check the end of a submatch when deciding to put a state in
  14.         the state list.
  15. Files:        src/testdir/test64.in, src/testdir/test64.ok, src/regexp_nfa.c
  16.  
  17.  
  18. *** ../vim-7.4.288/src/testdir/test64.in    2013-11-21 17:12:55.000000000 +0100
  19. --- src/testdir/test64.in    2014-05-13 15:35:02.477659266 +0200
  20. ***************
  21. *** 407,412 ****
  22. --- 407,413 ----
  23.   :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<=$', 'foo.bat/foo.bat', 'foo.bat/foo.bat', 'bat', 'bat'])
  24.   :call add(tl, [2, '\\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}', '2013-06-27${0}', '${0}', '0'])
  25.   :call add(tl, [2, '^\(a*\)\1$', 'aaaaaaaa', 'aaaaaaaa', 'aaaa'])
  26. + :call add(tl, [2, '^\(a\{-2,}\)\1\+$', 'aaaaaaaaa', 'aaaaaaaaa', 'aaa'])
  27.   :"
  28.   :"""" Look-behind with limit
  29.   :call add(tl, [2, '<\@<=span.', 'xxspanxx<spanyyy', 'spany'])
  30. *** ../vim-7.4.288/src/testdir/test64.ok    2013-11-21 17:12:55.000000000 +0100
  31. --- src/testdir/test64.ok    2014-05-13 15:49:21.381666784 +0200
  32. ***************
  33. *** 947,952 ****
  34. --- 947,955 ----
  35.   OK 0 - ^\(a*\)\1$
  36.   OK 1 - ^\(a*\)\1$
  37.   OK 2 - ^\(a*\)\1$
  38. + OK 0 - ^\(a\{-2,}\)\1\+$
  39. + OK 1 - ^\(a\{-2,}\)\1\+$
  40. + OK 2 - ^\(a\{-2,}\)\1\+$
  41.   OK 0 - <\@<=span.
  42.   OK 1 - <\@<=span.
  43.   OK 2 - <\@<=span.
  44. *** ../vim-7.4.288/src/regexp_nfa.c    2014-04-23 19:06:33.702828771 +0200
  45. --- src/regexp_nfa.c    2014-05-13 15:49:15.065666729 +0200
  46. ***************
  47. *** 3945,3950 ****
  48. --- 3945,3951 ----
  49.   
  50.   /*
  51.    * Return TRUE if "sub1" and "sub2" have the same start positions.
  52. +  * When using back-references also check the end position.
  53.    */
  54.       static int
  55.   sub_equal(sub1, sub2)
  56. ***************
  57. *** 3976,3981 ****
  58. --- 3977,3999 ----
  59.           if (s1 != -1 && sub1->list.multi[i].start.col
  60.                            != sub2->list.multi[i].start.col)
  61.           return FALSE;
  62. +         if (nfa_has_backref)
  63. +         {
  64. +         if (i < sub1->in_use)
  65. +             s1 = sub1->list.multi[i].end.lnum;
  66. +         else
  67. +             s1 = -1;
  68. +         if (i < sub2->in_use)
  69. +             s2 = sub2->list.multi[i].end.lnum;
  70. +         else
  71. +             s2 = -1;
  72. +         if (s1 != s2)
  73. +             return FALSE;
  74. +         if (s1 != -1 && sub1->list.multi[i].end.col
  75. +                            != sub2->list.multi[i].end.col)
  76. +         return FALSE;
  77. +         }
  78.       }
  79.       }
  80.       else
  81. ***************
  82. *** 3992,3997 ****
  83. --- 4010,4028 ----
  84.           sp2 = NULL;
  85.           if (sp1 != sp2)
  86.           return FALSE;
  87. +         if (nfa_has_backref)
  88. +         {
  89. +         if (i < sub1->in_use)
  90. +             sp1 = sub1->list.line[i].end;
  91. +         else
  92. +             sp1 = NULL;
  93. +         if (i < sub2->in_use)
  94. +             sp2 = sub2->list.line[i].end;
  95. +         else
  96. +             sp2 = NULL;
  97. +         if (sp1 != sp2)
  98. +             return FALSE;
  99. +         }
  100.       }
  101.       }
  102.   
  103. *** ../vim-7.4.288/src/version.c    2014-05-13 14:03:36.425611242 +0200
  104. --- src/version.c    2014-05-13 15:51:52.009668103 +0200
  105. ***************
  106. *** 736,737 ****
  107. --- 736,739 ----
  108.   {   /* Add new patch number below this line */
  109. + /**/
  110. +     289,
  111.   /**/
  112.  
  113. -- 
  114. hundred-and-one symptoms of being an internet addict:
  115. 152. You find yourself falling for someone you've never seen or hardly
  116.      know, but, boy can he/she TYPE!!!!!!
  117.  
  118.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  119. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  120. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  121.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  122.