Skip to content

Commit 69bcf1d

Browse files
author
Father Chrysostomos
committed
Create regen/feature.pl
This script generates lib/feature.pm. Soon it will be made to gener- ate other files, too.
1 parent ebd7756 commit 69bcf1d

File tree

6 files changed

+488
-21
lines changed

6 files changed

+488
-21
lines changed

Cross/Makefile-cross-SH

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,7 @@ CHMOD_W = chmod +w
848848
# opcode.pl: opcode.h opnames.h pp_proto.h
849849
# regcomp.pl: regnodes.h
850850
# warnings.pl: warnings.h lib/warnings.pm
851+
# feature.pl: lib/feature.pl
851852
# The correct versions should be already supplied with the perl kit,
852853
# in case you don't have perl available.
853854
# To force them to be regenerated, run
@@ -856,7 +857,8 @@ CHMOD_W = chmod +w
856857
# (make regen_headers is kept for backwards compatibility)
857858
858859
AUTOGEN_FILES = opcode.h opnames.h pp_proto.h proto.h embed.h embedvar.h \
859-
perlapi.h perlapi.c regnodes.h warnings.h lib/warnings.pm
860+
perlapi.h perlapi.c regnodes.h warnings.h lib/warnings.pm \
861+
lib/feature.pm
860862
861863
.PHONY: regen_headers regen_all
862864

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4822,6 +4822,7 @@ regcomp.h Private declarations for above
48224822
regcomp.sym Data for regnodes.h
48234823
regen/embed_lib.pl Reads embed.fnc and regen/opcodes
48244824
regen/embed.pl Produces {embed,embedvar,proto}.h
4825+
regen/feature.pl Generates feature.pm
48254826
regen/keywords.pl Program to write keywords.h
48264827
regen/mg_vtable.pl generate mg_vtable.h
48274828
regen/mk_PL_charclass.pl Populate the PL_charclass table

Makefile.SH

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,7 @@ CHMOD_W = chmod +w
11531153
# opcode.pl: opcode.h opnames.h pp_proto.h
11541154
# regcomp.pl: regnodes.h
11551155
# warnings.pl: warnings.h lib/warnings.pm
1156+
# feature.pl: lib/feature.pm
11561157
# The correct versions should be already supplied with the perl kit,
11571158
# in case you don't have perl available.
11581159
# To force them to be regenerated, run
@@ -1161,7 +1162,8 @@ CHMOD_W = chmod +w
11611162
# (make regen_headers is kept for backwards compatibility)
11621163
11631164
AUTOGEN_FILES = opcode.h opnames.h pp_proto.h proto.h embed.h embedvar.h \
1164-
perlapi.h perlapi.c regnodes.h warnings.h lib/warnings.pm
1165+
perlapi.h perlapi.c regnodes.h warnings.h lib/warnings.pm \
1166+
lib/feature.pm
11651167
11661168
.PHONY: regen_headers regen_all
11671169

lib/feature.pm

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
# -*- buffer-read-only: t -*-
2+
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
3+
# This file is built by regen/feature.pl.
4+
# Any changes made here will be lost!
5+
16
package feature;
27

38
our $VERSION = '1.25';
49

5-
# (feature name) => (internal name, used in %^H)
610
my %feature = (
711
say => 'feature_say',
812
state => 'feature_state',
@@ -13,33 +17,27 @@ my %feature = (
1317
unicode_strings => 'feature_unicode',
1418
);
1519

16-
# These work backwards--the presence of the hint elem disables the feature:
1720
my %default_feature = (
18-
array_base => 'feature_no$[',
21+
array_base => 'feature_no$[',
1922
);
2023

21-
# This gets set (for now) in $^H as well as in %^H,
22-
# for runtime speed of the uc/lc/ucfirst/lcfirst functions.
23-
# See HINT_UNI_8_BIT in perl.h.
24-
our $hint_uni8bit = 0x00000800;
25-
26-
# NB. the latest bundle must be loaded by the -E switch (see toke.c)
27-
2824
our %feature_bundle = (
29-
"default" => [keys %default_feature],
30-
"5.10" => [qw(say state switch array_base)],
31-
"5.11" => [qw(say state switch unicode_strings array_base)],
32-
"5.15" => [qw(say state switch unicode_strings unicode_eval
33-
evalbytes current_sub)],
25+
"5.10" => [qw(array_base say state switch)],
26+
"5.11" => [qw(array_base say state switch unicode_strings)],
27+
"5.15" => [qw(current_sub evalbytes say state switch unicode_eval unicode_strings)],
28+
"5.9.5" => [qw(array_base say state switch)],
29+
"default" => [qw(array_base)],
3430
);
3531

32+
3633
# Each of these is the same as the previous bundle
37-
for(12...14, 16) {
34+
for (12,13,14,16) {
3835
$feature_bundle{"5.$_"} = $feature_bundle{"5.".($_-1)}
3936
}
40-
41-
# special case
42-
$feature_bundle{"5.9.5"} = $feature_bundle{"5.10"};
37+
# This gets set (for now) in $^H as well as in %^H,
38+
# for runtime speed of the uc/lc/ucfirst/lcfirst functions.
39+
# See HINT_UNI_8_BIT in perl.h.
40+
our $hint_uni8bit = 0x00000800;
4341

4442
# TODO:
4543
# - think about versioned features (use feature switch => 2)
@@ -372,3 +370,5 @@ sub croak {
372370
}
373371

374372
1;
373+
374+
# ex: set ro:

regen.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
regcomp.pl
2424
warnings.pl
2525
embed.pl
26+
feature.pl
2627
);
2728

2829
my $tap = $ARGV[0] && $ARGV[0] eq '--tap' ? '# ' : '';

0 commit comments

Comments
 (0)