This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don't bother doing POSIX charclass parsing if it
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 3 Nov 2001 18:34:08 +0000 (18:34 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 3 Nov 2001 18:34:08 +0000 (18:34 +0000)
commit9a86a77bd2e47579153b5c82d594bdb3778f11fc
tree0b3c3d773618327063adf546a2badaf3605e5473
parentbeeb77fc17e11913205723efb9351ff771305f35
Don't bother doing POSIX charclass parsing if it
possibly cannot be so.  Prepares way for charclass
syntax like [[abc]||[def]] (or just [[abc][def]])
for union, [[\w]&&[$a]] for intersection,
and [[a-z]&&[^def]] for subtraction.

Currently /[[a]/ (or /[a[]/) parses as a character
class containing two characters, "[" and "a",
this may have to be broken for the syntax described
above, otherwise we would have to scan the whole pattern
to find out whether the square brackets match pairwise.
Luckily, the special case of "[" doesn't seem to be
documented (as opposed to "]" and "-"), so we may have
better story for breaking it...  One can always use \[
if one wants a literal "[", so there.

p4raw-id: //depot/perl@12835
regcomp.c