diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-11-25 19:40:12 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-12-31 08:27:20 -0700 |
commit | ae98608918f0b92985b47a5ac2987ebd9797be4c (patch) | |
tree | 040697220e48491e0e5999b96116a2c0b69a0e40 /t/lib | |
parent | eff8b7dc9a14f3aa38ddb85d01d614da4c6d8957 (diff) | |
download | perl-ae98608918f0b92985b47a5ac2987ebd9797be4c.tar.gz |
Convert regnode to a flag for [...]
Prior to this commit, there were 3 types of ANYOF nodes; now there are
two: regular, and one for the synthetic start class (ssc). This commit
converted the third type dealing with warning about matching \p{}
against non-Unicode code points, into using the spare flag bit for ANYOF
nodes.
This allows this bit to apply to ssc ANYOF nodes, whereas previously it
couldn't. There is a bug in which the warning isn't raised if the match
is rejected by the optimizer, because of this inability. This bug will
be fixed in a later commit.
Another option would have been to create a new node-type which was an
ANYOF_SSC_WARN_SUPER node. But this adds extra complications to things;
and we have a spare bit that we might as well use. The comments give
better possibilities for freeing up 2 bits should they be needed.
Diffstat (limited to 't/lib')
-rw-r--r-- | t/lib/warnings/utf8 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/lib/warnings/utf8 b/t/lib/warnings/utf8 index 02507b3118..aefa653150 100644 --- a/t/lib/warnings/utf8 +++ b/t/lib/warnings/utf8 @@ -643,6 +643,17 @@ Code point 0x110048 is not Unicode, all \p{} matches fail; all \P{} matches succ Code point 0x110049 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 72. Code point 0x110049 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 72. ######## +# TODO Matching Unicode property against above-Unicode code point outputs a warning even if optimizer rejects the match (in synthetic start class) +use warnings 'non_unicode'; +"\x{110000}" =~ /b?\p{Space}/; +EXPECT +Code point 0x110000 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 2. +######## +# NAME Matching POSIX class property against above-Unicode code point doesn't output a warning +use warnings 'non_unicode'; +"\x{110000}" =~ /b?[[:space:]]/; +EXPECT +######## use warnings 'utf8'; chr(0x110000) =~ /\p{Any}/; no warnings 'non_unicode'; |