summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-12-18 22:57:55 -0700
committerKarl Williamson <public@khwilliamson.com>2013-12-31 08:27:22 -0700
commitf215ab38f4d9ea2dca08fc71b38db0eb650d5107 (patch)
tree8a879c1152bd39eb7e1233b0539f0675f30a3779
parentd4405284bef0786f068653135984f30606cae144 (diff)
downloadperl-f215ab38f4d9ea2dca08fc71b38db0eb650d5107.tar.gz
regcomp.c: comment typo and rewording
-rw-r--r--regcomp.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/regcomp.c b/regcomp.c
index 5b10edd866..aa8da59a22 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13165,7 +13165,7 @@ parseit:
* would cause things in <depends_list> to match
* inappropriately, except that any \p{}, including
* this one forces Unicode semantics, which means there
- * is <no depends_list> */
+ * is no <depends_list> */
ANYOF_FLAGS(ret) |= ANYOF_NONBITMAP_NON_UTF8;
}
else {
@@ -13950,9 +13950,16 @@ parseit:
return ret;
}
- /* If the character class contains only a single element, it may be
- * optimizable into another node type which is smaller and runs faster.
- * Check if this is the case for this class */
+ /* Here, we've gone through the entire class and dealt with multi-char
+ * folds. We are now in a position that we can do some checks to see if we
+ * can optimize this ANYOF node into a simpler one, even in Pass 1.
+ * Currently we only do two checks:
+ * 1) is in the unlikely event that the user has specified both, eg. \w and
+ * \W under /l, then the class matches everything. (This optimization
+ * is done only to make the optimizer code run later work.)
+ * 2) if the character class contains only a single element (including a
+ * single range), we see if there is an equivalent node for it.
+ * Other checks are possible */
if (! ret_invlist /* Can't optimize if returning the constructed
inversion list */
&& (UNLIKELY(posixl_matches_all) || element_count == 1))