This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Use POSIXA, NPOSIXA
authorKarl Williamson <public@khwilliamson.com>
Fri, 20 Jul 2012 16:23:14 +0000 (10:23 -0600)
committerKarl Williamson <public@khwilliamson.com>
Wed, 25 Jul 2012 03:13:49 +0000 (21:13 -0600)
commit0658cddeb9feb16c427ac50f4000b008516b9958
tree6107b53e26cbdce9e42393b8aadf84dd14600772
parent3615ea5819e869b314f723b0ce28dfb1d80017ef
regcomp.c: Use POSIXA, NPOSIXA

This commit optimizes character classes which are matched under /a or
/aa and consist of a single Posix class, into POSIXA or NPOSIXA regop
types.  For example /[[:word:]]/a.  Since [:ascii:] is always
ascii-restricted no matter what the charset modifier is, it is always
optimized.

These nodes should execute somewhat faster than a generic ANYOF node,
and are significantly smaller, taking 2 bytes instead of 12.

The flags field of the node structure is used to hold an enum indicating
which of the 15 Posix classes is being matched.
regcomp.c
regexec.c
t/re/re_tests