Loading ...
Sorry, an error occurred while loading the content.
 

NFA-regexp problem in Vim 7.4a.24

Expand Messages
  • Ingo Karkat
    Hello Vim developers, I ve found a discrepancy in pattern matching while re-running my plugins test suites. With the new NFA-regexp, a (rather complex,
    Message 1 of 4 , Jul 16, 2013
      Hello Vim developers,

      I've found a discrepancy in pattern matching while re-running my
      plugins' test suites. With the new NFA-regexp, a (rather complex,
      generated, used for searching insert mode completion matches) pattern
      does not match any more:

      :echo '__mul__sub__und__everywhere__' =~#
      '\V\<\%(m\%(_\@!\k\)\*_\@!\|_\*m\k\+\%(_\|\k\&\A\)\@=\)\%(\%(\%(_\@!\U\)\@<=\%(S\&\u\|\%(\k\&\A\)\+s\)\k\*\|_\@<!\%(S\&\u\|\%(\k\&\A\)\+s\)\l\k\*\)\|_\+s\k\+\)\%(\%(\%(_\@!\U\)\@<=\%(U\&\u\|\%(\k\&\A\)\+u\)\k\*\|_\@<!\%(U\&\u\|\%(\k\&\A\)\+u\)\l\k\*\)\|_\+u\k\+\)\%(\%(\%(_\@!\U\)\@<=\%(E\&\u\|\%(\k\&\A\)\+e\)\k\*\|_\@<!\%(E\&\u\|\%(\k\&\A\)\+e\)\l\k\*\)\|_\+e\k\+\)\>'

      To reproduce, use the attached script:

      vim -N -u NONE -S bad-re.vim
      0
      1

      This is with a huge build of Vim 7.4a.24, running in an Ubuntu 13.04
      x64 VM. See attached bad-re.version for more info.

      I last ran the test suite successfully with Vim 7.3.1280, so the bug
      must have been introduced since then.

      -- regards, ingo

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • glts
      ... I reduced Ingo s report to the following minimal example. function! Test(re) return mx__xe =~ %#= . a:re . m k +_ @= %(_ @! k ) @
      Message 2 of 4 , Jul 16, 2013
        On Tue, Jul 16, 2013 at 1:38 PM, Ingo Karkat <swdev@...> wrote:
        > I've found a discrepancy in pattern matching while re-running my
        > plugins' test suites. With the new NFA-regexp, a (rather complex,
        > generated, used for searching insert mode completion matches) pattern
        > does not match any more:
        >
        > :echo '__mul__sub__und__everywhere__' =~#
        > '\V\<\%(m\%(_\@!\k\)\*_\@!\|_\*m\k\+\%(_\|\k\&\A\)\@=\)\%(\%(\%(_\@!\U\)\@<=\%(S\&\u\|\%(\k\&\A\)\+s\)\k\*\|_\@<!\%(S\&\u\|\%(\k\&\A\)\+s\)\l\k\*\)\|_\+s\k\+\)\%(\%(\%(_\@!\U\)\@<=\%(U\&\u\|\%(\k\&\A\)\+u\)\k\*\|_\@<!\%(U\&\u\|\%(\k\&\A\)\+u\)\l\k\*\)\|_\+u\k\+\)\%(\%(\%(_\@!\U\)\@<=\%(E\&\u\|\%(\k\&\A\)\+e\)\k\*\|_\@<!\%(E\&\u\|\%(\k\&\A\)\+e\)\l\k\*\)\|_\+e\k\+\)\>'
        >
        > To reproduce, use the attached script:
        >
        > vim -N -u NONE -S bad-re.vim
        > 0
        > 1
        >
        > This is with a huge build of Vim 7.4a.24, running in an Ubuntu 13.04
        > x64 VM. See attached bad-re.version for more info.
        >
        > I last ran the test suite successfully with Vim 7.3.1280, so the bug
        > must have been introduced since then.

        I reduced Ingo's report to the following minimal example.

        function! Test(re)
        return 'mx__xe' =~ '\%#=' . a:re . 'm\k\+_\@=\%(_\@!\k\)\@<=\k\+e'
        endfunction
        for n in [0, 1]
        echo Test(n)
        endfor

        I can reproduce on current Mercurial tip. Hope it helps.

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • glts
        ... I bisected the reduced example. The first bad revision is: changeset: 4813:bc3f4804cf47 tag: v7-3-1153 user: Bram Moolenaar
        Message 3 of 4 , Jul 16, 2013
          On Tue, Jul 16, 2013 at 8:41 PM, glts <676c7473@...> wrote:
          > On Tue, Jul 16, 2013 at 1:38 PM, Ingo Karkat <swdev@...> wrote:
          >> I've found a discrepancy in pattern matching while re-running my
          >> plugins' test suites. With the new NFA-regexp, a (rather complex,
          >> generated, used for searching insert mode completion matches) pattern
          >> does not match any more:
          >>
          >> :echo '__mul__sub__und__everywhere__' =~#
          >> '\V\<\%(m\%(_\@!\k\)\*_\@!\|_\*m\k\+\%(_\|\k\&\A\)\@=\)\%(\%(\%(_\@!\U\)\@<=\%(S\&\u\|\%(\k\&\A\)\+s\)\k\*\|_\@<!\%(S\&\u\|\%(\k\&\A\)\+s\)\l\k\*\)\|_\+s\k\+\)\%(\%(\%(_\@!\U\)\@<=\%(U\&\u\|\%(\k\&\A\)\+u\)\k\*\|_\@<!\%(U\&\u\|\%(\k\&\A\)\+u\)\l\k\*\)\|_\+u\k\+\)\%(\%(\%(_\@!\U\)\@<=\%(E\&\u\|\%(\k\&\A\)\+e\)\k\*\|_\@<!\%(E\&\u\|\%(\k\&\A\)\+e\)\l\k\*\)\|_\+e\k\+\)\>'
          >>
          >> To reproduce, use the attached script:
          >>
          >> vim -N -u NONE -S bad-re.vim
          >> 0
          >> 1
          >>
          >> This is with a huge build of Vim 7.4a.24, running in an Ubuntu 13.04
          >> x64 VM. See attached bad-re.version for more info.
          >>
          >> I last ran the test suite successfully with Vim 7.3.1280, so the bug
          >> must have been introduced since then.
          >
          > I reduced Ingo's report to the following minimal example.
          >
          > function! Test(re)
          > return 'mx__xe' =~ '\%#=' . a:re . 'm\k\+_\@=\%(_\@!\k\)\@<=\k\+e'
          > endfunction
          > for n in [0, 1]
          > echo Test(n)
          > endfor
          >
          > I can reproduce on current Mercurial tip. Hope it helps.

          I bisected the reduced example.

          The first bad revision is:
          changeset: 4813:bc3f4804cf47
          tag: v7-3-1153
          user: Bram Moolenaar <bram@...>
          date: Sun Jun 09 16:24:45 2013 +0200
          summary: updated for version 7.3.1153

          --
          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Bram Moolenaar
          ... Thanks, it s always easier to figure out a simplified example. And this can probably added as a test once it s fixed. -- If your company is not involved in
          Message 4 of 4 , Jul 16, 2013
            glts wrote:

            > On Tue, Jul 16, 2013 at 1:38 PM, Ingo Karkat <swdev@...> wrote:
            > > I've found a discrepancy in pattern matching while re-running my
            > > plugins' test suites. With the new NFA-regexp, a (rather complex,
            > > generated, used for searching insert mode completion matches) pattern
            > > does not match any more:
            > >
            > > :echo '__mul__sub__und__everywhere__' =~#
            > > '\V\<\%(m\%(_\@!\k\)\*_\@!\|_\*m\k\+\%(_\|\k\&\A\)\@=\)\%(\%(\%(_\@!\U\)\@<=\%(S\&\u\|\%(\k\&\A\)\+s\)\k\*\|_\@<!\%(S\&\u\|\%(\k\&\A\)\+s\)\l\k\*\)\|_\+s\k\+\)\%(\%(\%(_\@!\U\)\@<=\%(U\&\u\|\%(\k\&\A\)\+u\)\k\*\|_\@<!\%(U\&\u\|\%(\k\&\A\)\+u\)\l\k\*\)\|_\+u\k\+\)\%(\%(\%(_\@!\U\)\@<=\%(E\&\u\|\%(\k\&\A\)\+e\)\k\*\|_\@<!\%(E\&\u\|\%(\k\&\A\)\+e\)\l\k\*\)\|_\+e\k\+\)\>'
            > >
            > > To reproduce, use the attached script:
            > >
            > > vim -N -u NONE -S bad-re.vim
            > > 0
            > > 1
            > >
            > > This is with a huge build of Vim 7.4a.24, running in an Ubuntu 13.04
            > > x64 VM. See attached bad-re.version for more info.
            > >
            > > I last ran the test suite successfully with Vim 7.3.1280, so the bug
            > > must have been introduced since then.
            >
            > I reduced Ingo's report to the following minimal example.
            >
            > function! Test(re)
            > return 'mx__xe' =~ '\%#=' . a:re . 'm\k\+_\@=\%(_\@!\k\)\@<=\k\+e'
            > endfunction
            > for n in [0, 1]
            > echo Test(n)
            > endfor
            >
            > I can reproduce on current Mercurial tip. Hope it helps.

            Thanks, it's always easier to figure out a simplified example.
            And this can probably added as a test once it's fixed.

            --
            If your company is not involved in something called "ISO 9000" you probably
            have no idea what it is. If your company _is_ involved in ISO 9000 then you
            definitely have no idea what it is.
            (Scott Adams - The Dilbert principle)

            /// Bram Moolenaar -- Bram@... -- 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 ///

            --
            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          Your message has been successfully submitted and would be delivered to recipients shortly.