summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-12-04 11:04:24 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-12-04 14:33:30 -0800
commitf5eec17cdc8138641bd75afb9c79295f9bbecde3 (patch)
tree9564c22e8c6a5778fdc4f88894f962def489b8b8
parentb15b9c2a4267eed1abe5a08e57b250f7fab2e9f9 (diff)
downloadperl-f5eec17cdc8138641bd75afb9c79295f9bbecde3.tar.gz
[perl #115818] Don’t croak for /[.zog.]/
/[.zog.]/ produces a warning, because the POSIX syntax is not used correctly. It must be /[[.zog.]]/. /[[.zog.]]/ croaks, because that POSIX syntax has not been imple- mented yet. There is currently a croak for the former, too, even though it is the latter syntax that is forbidden. There is no reason to forbid the former. The reason for warning is that /[.zog.]/ is a regular character class (equivalent to [.zog]), so it might not do what the programmer intended. If that is why we warn, it doesn’t make sense to croak. After all, perl is only guessing that the programmer *might* have made a mistake. This makes /[.foo.]/ similar to /[:foo:]/, which warns and then acts like /[:fo]/.
-rw-r--r--regcomp.c10
-rw-r--r--t/lib/warnings/regcomp1
2 files changed, 0 insertions, 11 deletions
diff --git a/regcomp.c b/regcomp.c
index a595a8cfcc..f6391168f8 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -11576,16 +11576,6 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
ckWARN3reg(s+2,
"POSIX syntax [%c %c] belongs inside character classes",
c, c);
-
- /* [[=foo=]] and [[.foo.]] are still future. */
- if (POSIXCC_NOTYET(c)) {
- /* adjust RExC_parse so the error shows after
- the class closes */
- while (UCHARAT(RExC_parse) && UCHARAT(RExC_parse++) != ']')
- NOOP;
- SvREFCNT_dec(listsv);
- vFAIL3("POSIX syntax [%c %c] is reserved for future extensions", c, c);
- }
}
}
diff --git a/t/lib/warnings/regcomp b/t/lib/warnings/regcomp
index 84d46fc0e8..cb0c703add 100644
--- a/t/lib/warnings/regcomp
+++ b/t/lib/warnings/regcomp
@@ -98,7 +98,6 @@ no warnings 'regexp' ;
/[.zog.]/;
EXPECT
POSIX syntax [. .] belongs inside character classes in regex; marked by <-- HERE in m/[.zog.] <-- HERE / at - line 5.
-POSIX syntax [. .] is reserved for future extensions in regex; marked by <-- HERE in m/[.zog.] <-- HERE / at - line 5.
########
# regcomp.c [S_regclass]
$_ = "";