| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds support for vstrings to Data::Dumper, in both Perl
and XS implementations.
Since the actual vstring cannot be obtained from pure Perl, there is a
new _vstring XS function that the PP implementation uses, falling back
to sprintf "%vd" if XS is not available. The former dumps v1.2_3 cor-
rectly, while the latter produces v1.23. (I could make it use B to
extract the correct string, but XS is likely to be unavailable in
those circumstances where B is also unavailable [i.e., miniperl], so
it didn’t seem worth the effort.)
Some Perl versions (read: *all* released versions as of this message)
let vstring magic linger too long on strings that have been modified.
So that is checked for, but the bug is probed at compile time and the
code is #ifdeffed or use-constanted out when the bug is not present.
Due to the definition of the _bad_vsmg constant, I had to move
XSLoader::load into the BEGIN block. Since I was putting it there,
I combined it, the $Useperl = 1 and the eval{} into one statement,
for speed.
Since I was putting XSLoader::load into a BEGIN block, $VERSION needed
to be in one, too.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Some compilers complain, because -1 is being assigned to an unsigned
variable. This variable is not actually used before being assigned
to, but we have to initialise it as some other compilers cannot
detect that.
|
|
|
|
|
|
| |
It was only listed here because originally the perldiag entry had
nonexistent spelt correctly, while the perl source had it hyphenated.
That was corrected a while ago.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The op that the else block (see the diff) is trying to null is already
a null. So this else block can be deleted.
The null I’m referring to is
$ perl -MO=Concise -e 'sort $fo @fo'
8 <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
2 <;> nextstate(main 1 -e:1) v:{ ->3
7 <@> sort vKS ->8
3 <0> pushmark s ->4
- <1> null K/1 ->5 <-- over here.
- <1> ex-rv2sv sK/1 ->-
4 <#> gvsv[*fo] s ->5
6 <1> rv2av[t3] lK/1 ->7
5 <#> gv[*fo] s ->6
-e syntax OK
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PerlIO::get_layers should not be ignoring an argument like 12, but
treating "12" (the string) as a filehandle, as those are both the
same value.
It’s an instance of the string/num bug, which is a bit like the
Unicode Bug.
This commit takes the conservative approach of expanding it to flat
scalars in general, but not references (in case we decide to do
something interesting later on, even though I think that would be a
bad idea).
|
| |
|
|
|
|
| |
Yours truly added tests to substr.t outside of sub run_tests.
|
|
|
|
|
|
|
|
|
|
|
| |
If PL_defoutgv has been deleted from its stash, select() returns it
as a ref, but if the stash has been freed (even though the gv still
exists), it returns undef.
That makes no sense.
This is one of those nice cases where simplifying the code
fixes a bug.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The return value from select() is sometimes a string, and sometimes a
globref. It was originally always a string, but typeglobs not to be
found under their names in their stashes started being returned as
references in 5.002 beta 1 (4633a7c4b). The logic is a little faulty,
though, as sometimes the name that is returned cannot be used to find
the glob:
$ perl -le '
open "foo::bar", ">/dev/ttys009";
select foo::bar;
my $handle = \*foo::bar;
my $stash = \%foo::bar;
*foo:: = *bar::;
print "hello";
select select;
print "hello" or warn $!
'
Bad file descriptor at -e line 9.
In this example, /dev/ttys009 is another terminal window. "hello"
only appears once, not twice.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
| |
I didn’t know that done_testing could take an argument. This elimi-
nates the manual fiddling of the test count every time a test is added
to __DATA__. For other tests, which are the exception, we still have
the safety of a test count to make sure the tests actually run.
|
|
|
|
|
|
|
|
|
|
|
| |
Before the recent feature revamp (2fc860ee1e0), loading the
unicode_strings feature would always set the feature_unicode %^H ele-
ment, even though the core did not actually use it. Now it is some-
times not set. So we have to check the hint bits as well. Since
feature.pm has it hardcoded, load feature.pm to get the right bit.
The stuff with $feature_bundle_mask is redundant, but it avoids load-
ing feature.pm unnecessarily.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is related to 4b58603b60.
This time it’s this op tree that pure_string can’t handle:
8 </> match() vK/RTIME ->9
7 <|> regcomp(other->8) sK/1 ->8
3 <1> regcreset sK/1 ->4
6 <1> av2arylen sK/1 ->7
5 <1> rv2av[t2] sKR/1 ->6
4 <#> gv[*a] s ->5
In writing a test for this, I triggered a case that 415d4c68d missed
(only $a and $b are exempt from strict vars, not @a and @b), so that
is fixed in the same commit.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
B::Deparse only supported strict refs till now, and not the other two.
The hints were always present, but were being ignored. It was more
complicated than simply printing out the pragma settings. Variables
have to be qualified, too, under strict vars.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit fixes a regression introduced by b50b2058.
ambient_pragmas makes changes to %^H, which affect the currently com-
piling scope.
BEGIN {
new B'Deparse -> ambient_pragmas strict => 'all';
}
use 5.012;
# no strict here
B::Deparse really does know too much about perl’s internals. It is
calling strict.pm’s internal routines, which now set %^H, so Deparse
has to localise it.
Since it is very easy to write tests in evals that simply do not run
(I actually did that when trying to test this, and was puzzled as to
why everything was passing anyway), I have restored the test count.
Sorry, Nicholas.
|
|
|
|
|
|
|
| |
It’s possible for XS code to create hash entries with null values.
pp_helem and pp_slice were not taking that into account. In fact,
the core produces such hash entries, but they are rarely visible from
Perl. It’s good to check for them anyway.
|
| |
|
|
|
|
| |
without touching anything else.
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Features can now be loaded by version declarations without feature.pm
having to be loaded.
feature.pm is now a generated file. feature.h is a new file with mac-
ros to make this work. regen/feature.pl is a new script to generate
those two files.
A few hint bits are used to represent the current feature bundle. If
the ‘custom’ bundle is active, this means that the hint hash is used,
as before.
There is no longer any need for ‘negative’ features--those whose
entries in %^H turn them off. The only feature in that category was a
default feature. Now we use the default bundle in PL_hints, which is
indicated by 0 (see feature.h), so we don’t even have to set it.
feature.pm, when it sees bundle hints active, updates %^H to match
and then sets the current bundle to ‘custom’, before enabling or disa-
bling features.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
The data are now to be modified in regen/feature.pl, rather than
lib/feature.pm.
|
| | |
|
| |
| |
| |
| |
| | |
In case #define is changed to # define some day. (Not likely, but
this will make things easier for future maintainers.)
|
| | |
|
| |
| |
| |
| |
| | |
This should now only be called by macros in feature.h when PL_hints
indicates that %^H is where the features are.
|
| |
| |
| |
| |
| | |
unicode_strings was not the longest string. We can determine it auto-
matically, now that this macro is in a generated file.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Some tests were relying on the side effect of ‘use 5.9.5’ loading
feature.pm.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.)
|