| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
| |
regen/mg_vtable.pl was modified a while ago to generate the table
for copying and pasting, but at least twice since then it has not
been updated properly; once by me and once by the author of that
part of regen/mg_vtable.pl.
|
|
|
|
|
|
|
|
|
| |
Or potential lvalue context, like function calls.
The %n format code’s existence renders these two very much like func-
tion calls, as they can modify their arguments.
This allows sprintf("...%n", substr ...) to work.
|
|
|
|
|
|
| |
Since feature.pm is now a generated file, there is no reason to hard-
code constants from perl.h into it. We can get them from perl.h auto-
matically.
|
|
|
|
|
|
| |
Since the regen scripts use the system perl, I thought I might as
well test regen/feature.pl with 5.6.2, the earliest I have installed.
It failed.
|
|
|
|
|
|
|
|
|
| |
When a version declaration has been seen, it’s not possible to deparse
the code perfectly correctly, but using ‘no feature; use feature
"5.14"’ is a reasonable tradeoff. See also commit 1c74777c25.
This necessitated sorting %^H keys that are output to keep tests pass-
ing. Previously they were relying on phases of the moon.
|
| |
|
|
|
|
|
| |
In case #define is changed to # define some day. (Not likely, but
this will make things easier for future maintainers.)
|
| |
|
|
|
|
|
| |
unicode_strings was not the longest string. We can determine it auto-
matically, now that this macro is in a generated file.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PL_hints/$^H can hold feature bundle hints that cause %^H to be
ignored when features are looked up.
When feature->import and ->unimport are invoked, they set bits in $^H
such that %^H is used once more. But they have to modify %^H to con-
tain what the bits in $^H imply.
Up till now, unimport was delegating to import, which meant that more
work was being done than necessary, because import would then detect
the special condition of $^H and repeat (some of) that work.
|
|
|
|
|
|
|
|
|
|
| |
Now ‘use v5.22’ and ‘use 5.005’ no longer have to load feature.pm
to enable the current feature bundle. All they do is twiddle bits
in PL_hints.
Since version declarations no longer call feature->unimport, there
may be junk left over in %^H (which we leave for speed’s sake), so
feature.pm has to delete that junk before enabling features.
|
| |
|
|
|
|
|
| |
It makes little sense to have it in perl.h any more. (Until
recently, feature.h didn’t exist.)
|
|
|
|
|
|
| |
Now that we have hints in $^H to indicate the default feature bun-
dle, there is no need for entries in %^H that turn features off by
their presence.
|
|
|
|
|
| |
so that people as crazy as I won’t try to add internal
names like ~~_--~!_.
|
|
|
|
| |
unsigned >= 0 produces a warning, even if the 0 is actually a macro.
|
|
|
|
|
|
|
| |
Instead of using FEATURE_IS_ENABLED("say"), etc., now use
FEATURE_SAY_IS_ENABLED instead. These new macros, in feature.h, also
check feature bundle hints in PL_hints, so we can start using those
hints. Two commits ago, feature.pm started setting them.
|
|
|
|
|
|
|
|
|
|
| |
The core does not use these hints just yet, but feature.pm can start
setting them.
Currently, the hint bits for feature bundles (CURRENT_FEATURE_BUNDLE
in feature.h) are equal to FEATURE_BUNDLE_DEFAULT (0) by default.
feature.pm sets them to FEATURE_BUNDLE_CUSTOM when modifying
hint settings.
|
|
|
|
|
|
| |
This is for when we switch over to using hints in $^H for feature bun-
dles. When $bundle_number == $hint_mask, it means that the hints in
%^H apply.
|
|
|
|
|
| |
This variable, added in the previous commit for feature.pm’s sake,
also makes generating constants in feature.h simpler.
|
|
|
|
|
| |
It’s going to need them, in order to determine which list of features
is currently enabled.
|
| |
|
|
|
|
|
| |
This commit adds comments that give this file some semblance of
structure.
|
|
|
|
|
| |
This puts it with the other code that generates ‘global’ variables
used by generation code.
|
| |
|
|
|
|
|
| |
This hash will be used by subsequent commits to generate macros for
checking individual features.
|
|
|
|
|
|
|
|
|
| |
CURRENT_HINTS is not specific to features, but for now will be used by
nothing else. It returns the compile-time or run-time hints, depend-
ing on whether PL_curcop points to &PL_compiling.
CURRENT_FEATURE_BUNDLE extracts the feature bundle number from the
current hints.
|
| |
|
| |
|
|
|
|
| |
This will make it possible to create macros for each.
|
|
|
|
|
|
|
| |
It’s not necessary to repeat it, as we can simply add it to feature.pm
when we generate it.
Removing it makes these data usable for feature.h, too.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
%UniqueBundles was added for generating constants in feature.h, but
we can use it for feature.pm’s %feature_bundle as well, simplify-
ing the code.
This eliminates this piece of code in feature.pm, spelling it
out longhand:
# Each of these is the same as the previous bundle
for (12,13,14,16) {
$feature_bundle{"5.$_"} = $feature_bundle{"5.".($_-1)}
}
While that code might be neat, it would make the generation code
unduly complex. (It was designed for hand-editing anyway.)
|
| |
|
| |
|
|
|
|
|
| |
This script generates lib/feature.pm. Soon it will be made to gener-
ate other files, too.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some operators, like pp_complement, assign their argument to TARG
(which copies vstring magic), modify it in place, and then call set-
magic. That’s supposed to work, but vstring magic was remaining as it
was, such that ~v7 would still be treated as "v7" by vstring-aware
code, even though the resulting string is not "\7".
This commit adds vstring set-magic that checks to see whether the pv
still matches the vstring. It cannot simply free the vstring magic,
as that would prevent $x=v0 from working.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
seek had the same bug as tell. Here is the commit message from
8dc99089, which fixed tell:
----------------------------------------------------------------------
Stop tell($glob_copy) from clearing PL_last_in_gv
This bug is a side effect of rv2gv’s starting to return an incoercible
mortal copy of a coercible glob in 5.14:
$ perl5.12.4 -le 'open FH, "t/test.pl"; $fh=*FH; tell $fh; print tell'
0
$ perl5.14.0 -le 'open FH, "t/test.pl"; $fh=*FH; tell $fh; print tell'
-1
In the first case, tell without arguments is returning the position of
the filehandle.
In the second case, tell with an explicit argument that happens to
be a coercible glob (tell has an implicit rv2gv, so tell $fh is actu-
ally tell *$fh) sets PL_last_in_gv to a mortal copy thereof, which is
freed at the end of the statement, setting PL_last_in_gv to null. So
there is no ‘last used’ handle by the time we get to the tell without
arguments.
This commit adds a new rv2gv flag that tells it not to copy the glob.
By doing it unconditionally on the kidop, this allows tell(*$fh) to
work the same way.
Let’s hope nobody does tell(*{*$fh}), which will unset PL_last_in_gv
because the inner * returns a mortal copy.
This whole area is really icky. PL_last_in_gv should be refcounted,
but that would cause handles to leak out of scope, breaking programs
that rely on the auto-closing ‘feature’.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This bug is a side effect of rv2gv’s starting to return an incoercible
mortal copy of a coercible glob in 5.14:
$ perl5.12.4 -le 'open FH, "t/test.pl"; $fh=*FH; tell $fh; print tell'
0
$ perl5.14.0 -le 'open FH, "t/test.pl"; $fh=*FH; tell $fh; print tell'
-1
In the first case, tell without arguments is returning the position of
the filehandle.
In the second case, tell with an explicit argument that happens to
be a coercible glob (tell has an implicit rv2gv, so tell $fh is actu-
ally tell *$fh) sets PL_last_in_gv to a mortal copy thereof, which is
freed at the end of the statement, setting PL_last_in_gv to null. So
there is no ‘last used’ handle by the time we get to the tell without
arguments.
This commit adds a new rv2gv flag that tells it not to copy the glob.
By doing it unconditionally on the kidop, this allows tell(*$fh) to
work the same way.
Let’s hope nobody does tell(*{*$fh}), which will unset PL_last_in_gv
because the inner * returns a mortal copy.
This whole area is really icky. PL_last_in_gv should be refcounted,
but that would cause handles to leak out of scope, breaking programs
that rely on the auto-closing ‘feature’.
|
|
|
|
|
| |
After much alternation, altercation and alteration, __SUB__ is
finally here.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This function evaluates its argument as a byte string, regardless of
the internal encoding. It croaks if the string contains characters
outside the byte range. Hence evalbytes(" use utf8; '\xc4\x80' ")
will return "\x{100}", even if the original string had the UTF8 flag
on, and evalbytes(" '\xc4\x80' ") will return "\xc4\x80".
This has the side effect of fixing the deparsing of CORE::break under
‘use feature’ when there is an override.
|
|
|
|
|
|
|
| |
Following Michael Schwern’s suggestion, here is a warning for those
hapless folks who use $[ for version checks.
It applies whenever $[ is used in one of: < > <= >=
|
|
|
|
| |
The file read by this has a slightly changed format in 6.1
|
| |
|
|
|
|
| |
They were nearly identical.
|
|
|
|
|
| |
They are almost identical. This gives the compiler less code
to digest.
|