Fix issue with (?!) not being a valid expression. Update tests and docs to match.

[SVN r77602]
This commit is contained in:
John Maddock
2012-03-28 12:00:34 +00:00
parent 9ab4fb9eff
commit b45d6bb70c
88 changed files with 148 additions and 98 deletions

View File

@ -531,7 +531,7 @@ and =(?+1)= recurses to the next sub-expression to be declared.
the /condition/ is true, otherwise attempts to match /no-pattern/.
=(?(condition)yes-pattern)= attempts to match /yes-pattern/ if the /condition/
is true, otherwise fails.
is true, otherwise matches the NULL string.
/condition/ may be either: a forward lookahead assert, the index of
a marked sub-expression (the condition becomes true if the sub-expression
@ -544,10 +544,18 @@ Here is a summary of the possible predicates:
executes /no-pattern/.
* =(?(?!assert)yes-pattern|no-pattern)= Executes /yes-pattern/ if the forward look-ahead assert does not match, otherwise
executes /no-pattern/.
* =(?(['N])yes-pattern|no-pattern)= Executes /yes-pattern/ if subexpression /N/ has been matched, otherwise
executes /no-pattern/.
* =(?(<['name]>)yes-pattern|no-pattern)= Executes /yes-pattern/ if named subexpression /name/ has been matched, otherwise
executes /no-pattern/.
* =(?('['name]')yes-pattern|no-pattern)= Executes /yes-pattern/ if named subexpression /name/ has been matched, otherwise
executes /no-pattern/.
* =(?(R)yes-pattern|no-pattern)= Executes /yes-pattern/ if we are executing inside a recursion, otherwise
executes /no-pattern/.
* [^(?(R['N])yes-pattern|no-pattern)] Executes /yes-pattern/ if we are executing inside a recursion to sub-expression /N/, otherwise
executes /no-pattern/.
* [^(?(R&['name])yes-pattern|no-pattern)] Executes /yes-pattern/ if we are executing inside a recursion to named sub-expression /name/, otherwise
executes /no-pattern/.
* [^(?(DEFINE)never-exectuted-pattern)] Defines a block of code that is never executed and matches no characters:
this is usually used to define one or more named sub-expressions which are refered to from elsewhere in the pattern.