summaryrefslogtreecommitdiff
path: root/regen
Commit message (Collapse)AuthorAgeFilesLines
* [perl #103492] Give lvalue cx to (s)printf argsFather Chrysostomos2011-12-311-1/+1
| | | | | | | | | 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.
* 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.
* 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.
* Deparse implicit with ‘use feature’Father Chrysostomos2011-12-241-4/+4
| | | | | | | | | 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.
* use VERSION needs to enable uni8bit hintFather Chrysostomos2011-12-241-0/+4
|
* 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
|
* Make MAX_FEATURE_LEN reflect realityFather Chrysostomos2011-12-241-2/+6
| | | | | 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-241-1/+1
|
* feature.pl: Remove unused varFather Chrysostomos2011-12-241-1/+0
|
* feature.pm: Move hint normalisation to separate functionFather Chrysostomos2011-12-241-10/+13
| | | | | | | | | | | | | 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-241-1/+5
| | | | | | | | | | 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-241-0/+27
|
* Move FEATURE_IS_ENABLED to feature.hFather Chrysostomos2011-12-241-2/+9
| | | | | It makes little sense to have it in perl.h any more. (Until recently, feature.h didn’t exist.)
* Eliminate ‘negative’ featuresFather Chrysostomos2011-12-241-28/+7
| | | | | | 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.
* feature.pl: Tweak commentFather Chrysostomos2011-12-241-1/+1
| | | | | so that people as crazy as I won’t try to add internal names like ~~_--~!_.
* feature.h: Avoid compiler warningFather Chrysostomos2011-12-241-1/+12
| | | | unsigned >= 0 produces a warning, even if the 0 is actually a macro.
* Use new feature-testing macrosFather Chrysostomos2011-12-241-1/+2
| | | | | | | 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.
* feature.pm: Set bundle hints when dis/enabling featuresFather Chrysostomos2011-12-241-0/+12
| | | | | | | | | | 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.
* feature.pm: Add function for getting the current bundleFather Chrysostomos2011-12-241-0/+6
| | | | | | 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.
* feature.pl: Use @HintedBundles for generating feature.hFather Chrysostomos2011-12-241-5/+3
| | | | | This variable, added in the previous commit for feature.pm’s sake, also makes generating constants in feature.h simpler.
* Give feature.pm the bundle hintsFather Chrysostomos2011-12-241-1/+12
| | | | | It’s going to need them, in order to determine which list of features is currently enabled.
* feature.pl: Generate list of feature bundles in podFather Chrysostomos2011-12-241-11/+19
|
* feature.pl: Add section headersFather Chrysostomos2011-12-241-1/+18
| | | | | This commit adds comments that give this file some semblance of structure.
* feature.pl: Move hint-checking code upFather Chrysostomos2011-12-241-23/+24
| | | | | This puts it with the other code that generates ‘global’ variables used by generation code.
* Add macros for checking individual featuresFather Chrysostomos2011-12-241-0/+39
|
* feature.pl: %BundleRangesFather Chrysostomos2011-12-241-0/+19
| | | | | This hash will be used by subsequent commits to generate macros for checking individual features.
* feature.h: Add macros for current hintsFather Chrysostomos2011-12-241-0/+4
| | | | | | | | | 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.
* feature.h: Parenthesise macro definitionFather Chrysostomos2011-12-241-1/+1
|
* Make feature.pl executableFather Chrysostomos2011-12-241-0/+0
|
* Use only \w+ for internal feature namesFather Chrysostomos2011-12-241-1/+1
| | | | This will make it possible to create macros for each.
* feature.pl: Remove the feature_ prefix from the dataFather Chrysostomos2011-12-241-10/+11
| | | | | | | 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.
* feature.pl: Gen %feature_bundle from %UniqueBundlesFather Chrysostomos2011-12-241-23/+11
| | | | | | | | | | | | | | | | | %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.)
* Add feature.h, with constants for feature bundlesFather Chrysostomos2011-12-241-3/+46
|
* Parse the feature hint bits & assert their usabilityFather Chrysostomos2011-12-241-0/+20
|
* Create regen/feature.plFather Chrysostomos2011-12-241-0/+461
| | | | | This script generates lib/feature.pm. Soon it will be made to gener- ate other files, too.
* [perl #29070] Add vstring set-magicFather Chrysostomos2011-12-231-1/+2
| | | | | | | | | | | | 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.
* Stop seek($glob_copy...) from clearing PL_last_in_gvFather Chrysostomos2011-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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’.
* Stop tell($glob_copy) from clearing PL_last_in_gvFather Chrysostomos2011-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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’.
* [perl #80628] __SUB__Father Chrysostomos2011-11-222-0/+5
| | | | | After much alternation, altercation and alteration, __SUB__ is finally here.
* Throw a helpful warning when someone tries length(@array) or length(%hash)Matthew Horsfall (alh)2011-11-181-1/+1
|
* Add evalbytes functionFather Chrysostomos2011-11-062-1/+4
| | | | | | | | | | | 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.
* Warn for $[ ‘version’ checksFather Chrysostomos2011-11-011-8/+8
| | | | | | | 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: < > <= >=
* mk_PL_charclass.pl: Accept Unicode 6.1 syntaxKarl Williamson2011-10-011-2/+3
| | | | The file read by this has a slightly changed format in 6.1
* mk_PL_charclass.pl: Revise comments, gen'd headerKarl Williamson2011-10-011-11/+15
|
* Merge postinc and postdecFather Chrysostomos2011-09-161-2/+1
| | | | They were nearly identical.
* Merge preinc and postincFather Chrysostomos2011-09-161-2/+1
| | | | | They are almost identical. This gives the compiler less code to digest.
* regen/opcode.pl: generate OP_IS_DIRHOP, use in gv.cJim Cromie2011-09-092-9/+17
| | | | | | | Generate OP_IS_DIRHOP like other OP_IS_* macros, use in gv.c:Perl_gv_add_by_type(). Modifies 'F' operand type to 'DF'. This yields a micro-optimization.
* implement OP_IS_NUMCOMPARE like other OP_IS macrosJim Cromie2011-09-092-21/+27
| | | | | | | other macros are written by regen/opcode.pl into opnames.h Generate OP_IS_NUMCOMPARE the same way, and get a micro-optimization. Adds a new 'S<' operand type for the numeric comparison ops. Needs make regen.
* In embed.pl, inline walk_table() into its only caller.Nicholas Clark2011-08-251-27/+6
|