summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-02-25 20:31:30 -0700
committerKarl Williamson <public@khwilliamson.com>2011-02-25 21:06:10 -0700
commit84193928209d94622b4501beec2498f435ef3cbf (patch)
tree822cdffc6a438118080e71434f44bd3b100d6952 /regcomp.h
parent137165a601b852a9679983cdfe8d35be29f0939c (diff)
downloadperl-84193928209d94622b4501beec2498f435ef3cbf.tar.gz
bleadperl breaks RCLAMP/Text-Glob
This was from commit f424400810b6af341e96230836690da51c37b812 which came from needing a bit in an already-full flags field, and my faulty analysis that two bits could be shared. I found another mechanism to free up another bit, and now can separate these shared bits again.
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/regcomp.h b/regcomp.h
index 21eb1b3760..e7e642d922 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -351,12 +351,19 @@ struct regnode_charclass_class {
#define ANYOF_INVERT 0x04
/* EOS, meaning that it can match an empty string too, is used for the
- * synthetic start class (ssc) only. It can share the INVERT bit, as the ssc
- * is never inverted. The bit just needs to be turned off before regexec.c
- * gets a hold of it so that regexec.c doesn't think it's inverted, but this
- * happens automatically, as if the ssc can match an EOS, the ssc is discarded,
- * and never passed to regexec.c */
-#define ANYOF_EOS ANYOF_INVERT
+ * synthetic start class (ssc) only. It looks like it could share the INVERT
+ * bit, as the ssc is never inverted. But doing that caused this reges to
+ * not match:
+ * 'foo/file.fob' =~ m,^(?=[^\.])[^/]* /(?=[^\.])[^/]*\.fo[^/]$,;
+ * (except the space between the * and the / above shouldn't be there; it was
+ * inserted to make this comment continue on.)
+ * Rather than try to figure out what was going on in the optimizer, I (khw)
+ * found a way to save a different bit. But my original line of reasoning was
+ * "The bit just needs to be turned off before regexec.c gets a hold of it so
+ * that regexec.c doesn't think it's inverted, but this happens automatically,
+ * as if the ssc can match an EOS, the ssc is discarded, and never passed to
+ * regexec.c" */
+#define ANYOF_EOS 0x10
/* CLASS is never set unless LOCALE is too: has runtime \d, \w, [:posix:], ...
* The non-locale ones are resolved at compile-time */