summaryrefslogtreecommitdiff
path: root/regcomp.sym
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-06-27 14:43:41 -0600
committerKarl Williamson <public@khwilliamson.com>2012-06-29 22:22:42 -0600
commit3172e3fd885a9c54105d3b6156f18dc761fe29e5 (patch)
treed3b2ef63938ee83c1873a6a4b0f845b522bc63e4 /regcomp.sym
parent693fefec6759ebf0a9ec40a0f59346d86831349c (diff)
downloadperl-3172e3fd885a9c54105d3b6156f18dc761fe29e5.tar.gz
regcomp.c: Optimize e.g., /[^\w]/, /[[^:word:]]/ into /\W/
This optimizes character classes that have a single element that is one of the ops that have the same meaning outside (namely \d, \h, \s, \w, \v, :word:, :digit: and their complements) to that op. Those ops take less space than a character class and run faster. An initial '^' for complementing the class is also handled.
Diffstat (limited to 'regcomp.sym')
-rw-r--r--regcomp.sym3
1 files changed, 3 insertions, 0 deletions
diff --git a/regcomp.sym b/regcomp.sym
index c36a7fc2cd..0865a73ed5 100644
--- a/regcomp.sym
+++ b/regcomp.sym
@@ -227,6 +227,9 @@ KEEPS KEEPS, no ; $& begins here.
#*New charclass like patterns
LNBREAK LNBREAK, none ; generic newline pattern
+
+# regcomp.c expects the node number of the complement to be one greater than
+# the non-complement
VERTWS VERTWS, none 0 S ; vertical whitespace (Perl 6)
NVERTWS NVERTWS, none 0 S ; not vertical whitespace (Perl 6)
HORIZWS HORIZWS, none 0 S ; horizontal whitespace (Perl 6)