Tim Chase wrote:
> I suspect, in testing ideas on this, I may have turned up a bug
> in either the implementation of \%[] or its documentation needs a
> remedy.
>
> In theory, the following should work:
>
> :match Error /int\%[\(eger\|erval\)]/
>
> I base that assumption on a combination of these two pieces of
> the help:
>
> From ":help /\%[]" one finds that this syntax matches "a list of
> optionally matched atoms." (note "atoms", not "ordinary atoms")
>
> So what's an atom? We jump over to ":help atom" where we read
> that an atom is
>
> atom ::= ordinary-atom |/ordinary-atom|
> or \( pattern \) |/\(|
> or \%( pattern \) |/\%(|
> or \z( pattern \) |/\z(|
>
> and that a pattern is (according to ":help pattern")
>
> pattern ::= branch
> or branch \| branch
> or branch \| branch \| branch
> etc.
>
> Thus, my understanding of it is that one should be perfectly
> allowed to use a \(...\|...\) "atom" within a \%[] expression.
> If this is not the case, the help for \%[] may likely intend to
> refer to "ordinary atoms" rather than "atoms".
>
> *However*, the above search/match expression returns an "E369:
> invalid item in \%[]" error.
>
> I get this both in vim6.3 and vim7.
The documentation omits to mention that \(\) things are not allowed
inside \%[]. It also doesn't nest.
--
MORTICIAN: Bring out your dead!
[clang]
Bring out your dead!
[clang]
Bring out your dead!
CUSTOMER: Here's one -- nine pence.
DEAD PERSON: I'm not dead!
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///