Christian Brabandt wrote:

> On Di, 21 Mai 2013, Christian Brabandt wrote:
> 
> > And also not supported yet are  \_[...] 
> > collections.
> 
> BTW: This patch enables the \_[...] collections.
> 
> diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
> --- a/src/regexp_nfa.c
> +++ b/src/regexp_nfa.c
> @@ -679,9 +679,7 @@
>  
>             /* "\_[" is collection plus newline */
>             if (c == '[')
> -               /* TODO: make this work
> -                * goto collection; */
> -               return FAIL;
> +                goto collection;
>  
>         /* "\_x" is character class plus newline */
>         /*FALLTHROUGH*/
> @@ -891,7 +889,7 @@
>             }
>             break;
>  
> -/* collection: */
> +collection:
>         case Magic('['):
>             /*
>              * Glue is emitted between several atoms from the [].
> 

That just enables it, doesn't fix the problems caused.

I believe the pattern that failed was \_[0-9]\?\>.
Somehow the \_[] eats the line break and then \> fails to match.

Discovered using the dnsmasq syntax, especially the DnsmasqIPv4
match.  Using syntax files as a wild test for regexp works quite well.
But it does not find everything (and I still have too few files to test
with).

Here are some more patterns that still fail:

Multi-byte problem? Marc Weber
    echo matchlist('1', '\%#=1\o{\?Ä\Z')
    echo matchlist('1', '\%#=2\o{\?Ä\Z')

Difference in matching this pattern: (Marc Weber)
   echo matchlist("t", '\%#=1ú\Z')
   echo matchlist("t", '\%#=2ú\Z')

Difference in matching this pattern:
    echo matchlist('google', '\%#=1\<go*\|go')
    echo matchlist('google', '\%#=2\<go*\|go')

Difference in matching this pattern: (Marc Weber)
  echo matchlist("\na", '\%#=1\_F')
  echo matchlist("\na", '\%#=0\_F')
  echo matchlist("\na", '\%#=2\_F')

-- 
If you don't get everything you want, think of
everything you didn't get and don't want.

 /// Bram Moolenaar -- b...@moolenaar.net -- 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui