diff options
author | Zefram <zefram@fysh.org> | 2010-09-08 09:51:29 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-09-08 10:15:44 +0200 |
commit | ea25a9b2cf73948b1e8c5675de027e0ad13277bd (patch) | |
tree | 2b8bc87185e0e9e01b643752f911cdf4eeac0f85 /lib | |
parent | c99cfaa7c4ced6145d9642cd15da5bb2ea4ad19e (diff) | |
download | perl-ea25a9b2cf73948b1e8c5675de027e0ad13277bd.tar.gz |
make qw(...) first-class syntax
This makes a qw(...) list literal a distinct token type for the
parser, where previously it was munged into a "(",THING,")" sequence.
The change means that qw(...) can't accidentally supply parens to parts
of the grammar that want real parens. Due to many bits of code taking
advantage of that by "foreach my $x qw(...) {}", this patch also includes
a hack to coerce qw(...) to the old-style parenthesised THING, emitting
a deprecation warning along the way.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Tie/Scalar.t | 2 | ||||
-rw-r--r-- | lib/unicore/mktables | 28 |
2 files changed, 15 insertions, 15 deletions
diff --git a/lib/Tie/Scalar.t b/lib/Tie/Scalar.t index a8e803d1f5..9be536f8b3 100644 --- a/lib/Tie/Scalar.t +++ b/lib/Tie/Scalar.t @@ -22,7 +22,7 @@ use Test::More tests => 16; use_ok( 'Tie::Scalar' ); # these are "abstract virtual" parent methods -for my $method qw( TIESCALAR FETCH STORE ) { +for my $method (qw( TIESCALAR FETCH STORE )) { eval { Tie::Scalar->$method() }; like( $@, qr/doesn't define a $method/, "croaks on inherited $method()" ); } diff --git a/lib/unicore/mktables b/lib/unicore/mktables index 0c10453a00..505e2abe3e 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -792,7 +792,7 @@ if ($v_version gt v3.2.0) { # unless explicitly added. if ($v_version ge v5.2.0) { my $unihan = 'Unihan; remove from list if using Unihan'; - foreach my $table qw ( + foreach my $table (qw ( kAccountingNumeric kOtherNumeric kPrimaryNumeric @@ -808,7 +808,7 @@ if ($v_version ge v5.2.0) { kIRG_USource kIRG_VSource kRSUnicode - ) + )) { $why_suppress_if_empty_warn_if_not{$table} = $unihan; } @@ -4314,10 +4314,10 @@ sub trace { return main::trace(@_); } # Here are the methods that are required to be defined by any derived # class - for my $sub qw( + for my $sub (qw( append_to_body pre_body - ) + )) # append_to_body and pre_body are called in the write() method # to add stuff after the main body of the table, but before # its close; and to prepend stuff before the beginning of the @@ -4795,7 +4795,7 @@ sub trace { return main::trace(@_); } # Accessors for the range list stored in this table. First for # unconditional - for my $sub qw( + for my $sub (qw( contains count each_range @@ -4806,7 +4806,7 @@ sub trace { return main::trace(@_); } range_count reset_each_range value_of - ) + )) { no strict "refs"; *$sub = sub { @@ -4818,9 +4818,9 @@ sub trace { return main::trace(@_); } } # Then for ones that should fail if locked - for my $sub qw( + for my $sub (qw( delete_range - ) + )) { no strict "refs"; *$sub = sub { @@ -5783,9 +5783,9 @@ END } # Accessors for the underlying list that should fail if locked. - for my $sub qw( + for my $sub (qw( add_duplicate - ) + )) { no strict "refs"; *$sub = sub { @@ -6553,10 +6553,10 @@ END } # Accessors for the underlying list - for my $sub qw( + for my $sub (qw( get_valid_code_point get_invalid_code_point - ) + )) { no strict "refs"; *$sub = sub { @@ -7121,7 +7121,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } # Most of the accessors for a property actually apply to its map table. # Setup up accessor functions for those, referring to %map - for my $sub qw( + for my $sub (qw( add_alias add_anomalous_entry add_comment @@ -7166,7 +7166,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace } to_output_map value_of write - ) + )) # 'property' above is for symmetry, so that one can take # the property of a property and get itself, and so don't # have to distinguish between properties and tables in |