summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update concise-xs.t for recent DD changeFather Chrysostomos2011-12-251-1/+2
|
* [perl #101162] DD support for vstringsFather Chrysostomos2011-12-253-8/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Increase $Data::Dumper::VERSION to 2.135_02Father Chrysostomos2011-12-251-2/+2
|
* Supress warning in XS::APItest’s hash.tFather Chrysostomos2011-12-251-1/+3
|
* sv.c:dirp_dup: Avoid compiler warningFather Chrysostomos2011-12-251-1/+1
| | | | | | | 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.
* diag.t: Remove documented entryFather Chrysostomos2011-12-251-1/+0
| | | | | | 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.
* [perl #99426] op.c: Remove dead code from ck_sortFather Chrysostomos2011-12-251-2/+0
| | | | | | | | | | | | | | | | | | | | 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
* Document ‘Attempt to clear deleted array’ in perldiagFather Chrysostomos2011-12-252-1/+7
|
* Add diag_listed_as for non-numeric warningsFather Chrysostomos2011-12-252-2/+2
|
* PerlIO::get_layers: Treat numbers as stringsFather Chrysostomos2011-12-252-2/+6
| | | | | | | | | | | | | | 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).
* [perl #97956] PerlIO::get_layers: call get-magicFather Chrysostomos2011-12-252-8/+23
|
* Run more substr tests under a new threadFather Chrysostomos2011-12-241-31/+31
| | | | Yours truly added tests to substr.t outside of sub run_tests.
* select() can return undef when defoutgv is setFather Chrysostomos2011-12-242-10/+13
| | | | | | | | | | | 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.
* select() sometimes returns invalid stringFather Chrysostomos2011-12-242-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add basic tests for select()Father Chrysostomos2011-12-242-0/+20
|
* [perl #86060] $( $| $) need braces in regexpsFather Chrysostomos2011-12-242-1/+9
|
* feature.pl: Get HINT_UNI_8_BIT from perl.hFather Chrysostomos2011-12-241-12/+19
| | | | | | 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.
* coresubs.t: Call done_testing with an argFather Chrysostomos2011-12-241-2/+1
|
* coreamp.t: Call done_testing with an argFather Chrysostomos2011-12-241-6/+1
|
* deparse.t: Automatically count __DATA__ testsFather Chrysostomos2011-12-241-2/+3
| | | | | | | 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.
* Deparse the /d flag with implicit featuresFather Chrysostomos2011-12-242-1/+18
| | | | | | | | | | | 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.
* Deparse /$#a/ correctlyFather Chrysostomos2011-12-242-3/+7
| | | | | | | | | | | | | | | | | 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.
* Don’t warn for open(foo::bar)Father Chrysostomos2011-12-242-0/+2
|
* Deparse.pm: Document that strict vars and subs workFather Chrysostomos2011-12-241-1/+1
|
* Port regen/regen_lib.pl to 5.6.2Father Chrysostomos2011-12-241-1/+1
| | | | | | 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.
* [perl #24027] Deparse strict vars and subsFather Chrysostomos2011-12-242-17/+51
| | | | | | | 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.
* Fix Deparse ambient_pragmas/strict regressionFather Chrysostomos2011-12-242-0/+20
| | | | | | | | | | | | | | | | | | | | | 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.
* Don’t crash when writing to null hash elemFather Chrysostomos2011-12-243-4/+17
| | | | | | | 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.
* hv.c: Make newHVhv work on tied hashesFather Chrysostomos2011-12-243-4/+23
|
* *Now* increase $XS::APItest::VERSION to 0.35Father Chrysostomos2011-12-241-1/+1
| | | | without touching anything else.
* Deparse.pm: Document that use feature is supportedFather Chrysostomos2011-12-241-1/+2
|
* Deparse all features with ‘use/no feature’Father Chrysostomos2011-12-242-18/+33
|
* [Merge] Feature-loading revampFather Chrysostomos2011-12-2426-126/+1032
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * rmg: feature.pl needs to be runFather Chrysostomos2011-12-241-0/+2
| |
| * Deparse implicit with ‘use feature’Father Chrysostomos2011-12-244-28/+88
| | | | | | | | | | | | | | | | | | 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.
| * Deparse CORE::say, etc., when bundle hints are in useFather Chrysostomos2011-12-242-2/+49
| |
| * use VERSION needs to enable uni8bit hintFather Chrysostomos2011-12-243-0/+17
| |
| * Update rmg concerning feature bundlesFather Chrysostomos2011-12-241-2/+3
| | | | | | | | | | The data are now to be modified in regen/feature.pl, rather than lib/feature.pm.
| * Update perlfunc/use: feature.pm is not loadedFather Chrysostomos2011-12-241-8/+7
| |
| * feature.pl: Make the perl.h search more resilientFather Chrysostomos2011-12-241-1/+1
| | | | | | | | | | In case #define is changed to # define some day. (Not likely, but this will make things easier for future maintainers.)
| * feature.pl: Mention perl.h as a sourceFather Chrysostomos2011-12-241-1/+2
| |
| * toke.c: Add assertion to feature_is_enabledFather Chrysostomos2011-12-241-0/+2
| | | | | | | | | | This should now only be called by macros in feature.h when PL_hints indicates that %^H is where the features are.
| * Make MAX_FEATURE_LEN reflect realityFather Chrysostomos2011-12-242-3/+7
| | | | | | | | | | unicode_strings was not the longest string. We can determine it auto- matically, now that this macro is in a generated file.
| * feature.h: FEATURE_IS_ENABLED can use CURRENT_HINTSFather Chrysostomos2011-12-242-2/+2
| |
| * feature.pl: Remove unused varFather Chrysostomos2011-12-241-1/+0
| |
| * Fix up t/lib/feature/implicitFather Chrysostomos2011-12-241-8/+1
| | | | | | | | | | Some tests were relying on the side effect of ‘use 5.9.5’ loading feature.pm.
| * feature.pm: Move hint normalisation to separate functionFather Chrysostomos2011-12-242-20/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * op.c: Use new feature bundle hintsFather Chrysostomos2011-12-243-18/+12
| | | | | | | | | | | | | | | | | | | | 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.
| * feature.h: Function for enabling bundlesFather Chrysostomos2011-12-242-0/+48
| |
| * Move FEATURE_IS_ENABLED to feature.hFather Chrysostomos2011-12-243-11/+16
| | | | | | | | | | It makes little sense to have it in perl.h any more. (Until recently, feature.h didn’t exist.)