Skip to content

Commit 923e6ee

Browse files
committed
Refactor regen/feature.pl: Most features are same-named internally and publicly so simplify data structure shape
1 parent 8e70937 commit 923e6ee

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

regen/feature.pl

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,37 @@ BEGIN
2424

2525
# (feature name) => (internal name, used in %^H and macro names)
2626
my %feature = (
27-
say => 'say',
28-
state => 'state',
29-
switch => 'switch',
30-
bitwise => 'bitwise',
31-
evalbytes => 'evalbytes',
27+
# A few features are publicly named differently than internally
3228
current_sub => '__SUB__',
33-
refaliasing => 'refaliasing',
34-
postderef_qq => 'postderef_qq',
3529
unicode_eval => 'unieval',
3630
declared_refs => 'myref',
3731
unicode_strings => 'unicode',
38-
fc => 'fc',
39-
signatures => 'signatures',
40-
isa => 'isa',
41-
indirect => 'indirect',
42-
multidimensional => 'multidimensional',
43-
bareword_filehandles => 'bareword_filehandles',
44-
try => 'try',
45-
defer => 'defer',
4632
extra_paired_delimiters => 'more_delims',
47-
module_true => 'module_true',
48-
class => 'class',
4933
apostrophe_as_package_separator => 'apos_as_name_sep',
50-
any => 'any',
51-
all => 'all',
52-
smartmatch => 'smartmatch',
34+
35+
# Most features have identical public and internal names
36+
map { $_ => $_ } qw(
37+
say
38+
state
39+
switch
40+
bitwise
41+
evalbytes
42+
refaliasing
43+
postderef_qq
44+
fc
45+
signatures
46+
isa
47+
indirect
48+
multidimensional
49+
bareword_filehandles
50+
try
51+
defer
52+
module_true
53+
class
54+
any
55+
all
56+
smartmatch
57+
)
5358
);
5459

5560
# NOTE: If a feature is ever enabled in a non-contiguous range of Perl

0 commit comments

Comments
 (0)