summaryrefslogtreecommitdiff
path: root/regen
Commit message (Collapse)AuthorAgeFilesLines
* warnings.pl: Update commentKarl Williamson2011-02-181-2/+2
|
* Subclass utf8 warnings so can turn off individuallyKarl Williamson2011-02-171-1/+8
|
* Revert "l1_char_class_tab.h: Remove multi-char fold targets"Karl Williamson2011-02-141-1/+1
| | | | | | | | | | This reverts commit 88c8c9616516015e2fe0b502cdb92dc4efcc0c10. It turns out that these multi-char fold targets are now needed; In a future commit, I plan to compile in the dozen or so rules that are needed to avoid a Latin1-only regex from having to go out to the utf8 tables to avoid the performance penalty; or calling code can use the also forthcoming 'use re "/aa"'.
* l1_char_class_tab.h: Remove multi-char fold targetsKarl Williamson2011-02-041-1/+1
| | | | | | | These are not currently used, and slow things down, as regular expressions that have them, such as /[Etl]/i now have to go out and load utf8 code. This remains the case, though, for bracketed character classes that include [KkSs].
* embed.fnc: Add inline function capabilityKarl Williamson2011-01-291-3/+6
| | | | This patch adds to embed.pl the capability to generate static inline functions.
* Merge perl_keyword.pl into regen/keywords.pl, to generate keywords.[ch]Nicholas Clark2011-01-241-265/+333
| | | | | | | | | | Prepend + or - in front of all the keyword names in __DATA__ to mark weak and strong keywords, needed for keyword.c As keywords.c needs Devel::Tokenizer::C 0.05, not a core module (and not a common module either) we can no longer run it as part of regen.pl. So store the sha256 of the source in the generated files, and use this in to check that they are not stale (in t/porting/regen.t)
* Move mk_PL_charclass.pl from Porting/ to regen/Nicholas Clark2011-01-241-0/+246
|
* Move regencharclass.pl from Porting/ to regen/Nicholas Clark2011-01-231-0/+736
|
* Store the SHA-256 of the source in files generated by regen_perly.plNicholas Clark2011-01-231-3/+32
| | | | | | | bison isn't available everywhere, so we can't simply re-run regen_perly.pl to verify that perly.{act,h,tab} are up to date. So instead store the SHA-256 of the input files, and extend t/porting/regen.t to check that the input files haven't been changed subsequently.
* Output "read only" editor blocks from regen_perly.plNicholas Clark2011-01-231-1/+1
| | | | | | | | | Use safer_open() and read_only_bottom_close_and_rename() from regen_lib.pl Consistently use 3 argument open and lexical file handles. A side effect of this change is that the generated files are no longer made read-only on disk - if this is desirable, then probably better to change regen_lib.pl so that all generated files are made read-only.
* In regen scripts, print to explicit file handles instead of using select.Nicholas Clark2011-01-234-74/+50
| | | | | Also put explicit quotes on heredoc declarations to show whether they should interpolate, merge some heredocs, and remove & from calls to &tab(...)
* Move the duplicated subroutine tab() into regen_lib.plNicholas Clark2011-01-234-24/+6
|
* Change close_and_rename() to read_only_bottom_close_and_rename()Nicholas Clark2011-01-238-57/+33
| | | | | | | | | | All users of close_and_rename() were printing out the appropriate "ex: set ro:" string to the file handle immediately before closing it. So move that into the common function and rename it to reflect what it now does. [Except overload.pl, which should have been, given that it calls read_only_top()] Print a newline above the "ex: set ro:" line. This removes many newlines from the regen scripts, but does add newlines to a couple of generated files.
* In regen/*.pl, refactor the repeated code for close and rename if different.Nicholas Clark2011-01-238-64/+46
| | | | | | | Pass the final file name as an optional second argument of safer_open() and store it with the file handle. Add a function close_and_rename() which closes the file handle, then retrieves the final name, and renames the temporary file if the two differ.
* In regen_lib.pl, when opening, first unlink a previous file of that name.Nicholas Clark2011-01-233-5/+3
| | | | | | Previously regcomp.pl had an explicit unlink for the file it creates, but none of the other regen/*.pl scripts did. Also, remove commented out code relating to unlink.
* In regen_lib.pl use a meaningful key for storing the file's name.Nicholas Clark2011-01-231-2/+2
| | | | | | regen_lib.pl is actually using the hash slot of the typeglob, not the scalar slot. Typeglob syntax is particularly confusing and prone to errors, although in this case it doesn't make any behaviour difference.
* opcode.pl hasn't generated files named *-old since 2008, so don't delete them.Nicholas Clark2011-01-231-6/+0
| | | | | | Commit b6b9a09997c80269 removed the last vestiges of the code that generated any files named *-old, but the code to clean them up remained. It serves no purpose.
* regen/overload.pl should use rename_if_different() for lib/overload/numbers.pmNicholas Clark2011-01-231-2/+2
| | | | | | It was the only file generated by any of the regen/*.pl scripts which was always written out directly, instead of first creating a temporary file, and only moving that if successfully generated (and different).
* Move all the generated file header printing into read_only_top()Nicholas Clark2011-01-238-188/+99
| | | | | | | | | Previously all the scripts in regen/ had code to generate header comments (buffer-read-only, "do not edit this file", and optionally regeneration script, regeneration data, copyright years and filename). This change results in some minor reformatting of header blocks, and standardises the copyright line as "Larry Wall and others".
* In embed.pl, move the logic for perlapi.c's Tolkien quote out from do_not_edit()Nicholas Clark2011-01-221-12/+13
| | | | | | Previously do_not_edit() has a special case for this based on the filename parameter. Now the code to add the comment is next to the relevant call to do_not_edit().
* "Don't repeat yourself" in regen/opcode.plNicholas Clark2011-01-221-5/+4
|
* Remove references to Mac OS classic from comments the opcode descriptions.Nicholas Clark2011-01-191-4/+0
|
* regcomp.pl: Add capability for fields to be > 1 bitKarl Williamson2011-01-161-2/+24
| | | | | Currently, it doesn't generate a good dump structure if a field has more than one bit.
* add enum index in overload.h commentsDavid Mitchell2011-01-141-1/+2
| | | | makes debugging marginally easier!
* Merge the implementations of {end,set}{gr,pw}ent with endhostent.Nicholas Clark2011-01-101-1/+2
| | | | | Unlike set{host,net,proto,serv}ent, set{gr,pw}ent don't have stayopen parameter, hence their "signature" is the same as the ent*ent functions.
* Merge the implementations of pp_s{host,net,proto,serv}ent.Nicholas Clark2011-01-101-0/+1
|
* Merge the implementations of pp_e{host,net,proto,serv}ent.Nicholas Clark2011-01-101-0/+1
| | | | | | | PL_op_desc[] rather than PL_op_name(), as the OPs are internally named e*ent, but implement the ent*ent functions, and when unimplemented report themselves using the function name. No need for OP_DESC(), as the switch statement means that we can't encounter OP_CUSTOM.
* Generate "Unsupported socket function" stubs using PL_ppaddr.Nicholas Clark2011-01-091-16/+60
| | | | | | | | | | | | | | | Instead of having each socket op conditionally compile as either the implementation or a DIE() depending on #HAS_SOCKET 1: remove the conditional code from the ops themselves 2: only compile the ops if HAS_SOCKET is defined 3: general conditional code for the intialisation of PL_ppaddr - as appropriate either the ops, or Perl_unimplemented_op 4: Amend Perl_unimplemented_op to generate the appropriate DIE() for socket ops (ie not the "panic"... message) Whilst this complicates the support code in regen/opcode.pl, it's already a net saving of 5 lines in the C code.
* Rename pp_send to pp_syswrite, making send an alias for syswrite.Nicholas Clark2011-01-091-1/+1
| | | | | Previously syswrite was an alias for send. However, syswrite is always available, whereas send is not implemented if HAS_SOCKET is not defined.
* In opcode.h, use the alias macros in PL_ppaddr[]Nicholas Clark2011-01-091-1/+1
| | | | | | | | For OPs that share implementations, use #define aliases for the "original" names in PL_ppaddr[], instead of having regen/opcode.pl replace them with the name of the implementing OP body. Whilst this initially adds another layer of indirection, it will give more flexibility where conditional compilation of OPs is determined by the feature macros in config.h
* Remove commented-out code from regen/opcode.plNicholas Clark2011-01-091-13/+0
|
* regen/opcode.pl should only generate prototypes for pp_* functions that exist.Nicholas Clark2011-01-091-10/+7
| | | | | | | It now generates prototypes for all functions that implement OPs. Hence Perl_unimplemented_op no longer needs a special-case prototype. As it is now generating a prototype for Perl_do_kv, no need for regen/embed.pl to duplicate this. Convert the last two users of the macro do_kv() to Perl_do_kv(aTHX).
* Generate pp_* prototypes in pp_proto.h, and remove pp.symNicholas Clark2011-01-092-45/+25
| | | | | | | | | | | Eliminate the #define pp_foo Perl_pp_foo(pTHX) macros, and update the 13 locations that relied on them. regen/opcode.pl now generates prototypes for the PP functions directly, into pp_proto.h. It no longer writes pp.sym, and regen/embed.pl no longer reads this, removing the only ordering dependency in the regen scripts. opcode.pl is now responsible for prototypes for pp_* functions. (embed.pl remains responsible for ck_* functions, reading from regen/opcodes)
* embed.pl can read the names of ck_* functions direct from regen/opcodesNicholas Clark2011-01-092-11/+20
| | | | Previously regen/opcode.pl wrote them to pp.sym for regen/embed.pl to read.
* Extract the opcode data from regen/opcode.pl into regen/opcodesNicholas Clark2011-01-092-552/+551
| | | | | Whilst it is possible to open regen/opcode.pl and parse it to find the __END__ token, it's not the cleanest approach.
* Replace OP stubs in mathoms.c with #define aliases in opcode.hNicholas Clark2011-01-091-7/+14
| | | | | | | External code that references OPs by name will still link (and work). Unlike the other compatibility functions in mathoms.c, the OP stubs were simply making calls onwards to their replacements, so simply taking up space without adding anything.
* regen/overload.pl: add comments to overload.[ch]David Mitchell2011-01-031-4/+18
| | | | | | In the auto-generated overload.c and overload.h files, add a comment to each line mapping from the method name to the enumeration name and vice-versa.
* Merge the opcode bodies for pp_bind and pp_connect.Nicholas Clark2010-12-301-0/+1
|
* Remove OP_phoney_{IN,OUT}PUT_ONLY, as they are no longer used or supported.Nicholas Clark2010-12-281-2/+0
|
* Merge the opcode bodies for chop/chomp and schop/schomp.Nicholas Clark2010-12-271-0/+2
|
* Make entertry a LOGOP, not BASEOP/UNOPReini Urban2010-12-121-1/+1
| | | | | | | The initial parse-time UNOP is upgraded at ck_eval to an LOGOP - op_other holding the ptr to leavetry - which causes problems at run-time B optype inspection. The opclass info was always wrong, the Bytecode compiler broke with 5.12.
* Improve custom OP support.Ben Morrow2010-11-141-5/+0
| | | | | | | | | | | | | | | | | Change the custom op registrations from two separate hashes to one hash holding structure pointers, and add API functions to register ops and look them up. This will make it easier to add new properties of custom ops in the future. Copy entries across from the old hashes where necessary, to preserve compatibility. Add two new properties, in addition to the already-existing 'name' and 'description': 'class' and 'peep'. 'class' is one of the OA_*OP constants, and allows B and other introspection mechanisms to work with custom ops that aren't BASEOPs. 'peep' is a pointer to a function that will be called for ops of this type from Perl_rpeep. Adjust B.xs to take account of the new properties, and also to give custom ops their registered name rather than simply 'custom'.
* Add transr op typeFather Chrysostomos2010-11-021-1/+7
| | | | | for the upcoming y///r feature. There are not enough flag bits, hence the extra type.
* Allow push/pop/keys/etc to act on referencesDavid Golden2010-10-311-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All built-in functions that operate directly on array or hash containers now also accept hard references to arrays or hashes: |----------------------------+---------------------------| | Traditional syntax | Terse syntax | |----------------------------+---------------------------| | push @$arrayref, @stuff | push $arrayref, @stuff | | unshift @$arrayref, @stuff | unshift $arrayref, @stuff | | pop @$arrayref | pop $arrayref | | shift @$arrayref | shift $arrayref | | splice @$arrayref, 0, 2 | splice $arrayref, 0, 2 | | keys %$hashref | keys $hashref | | keys @$arrayref | keys $arrayref | | values %$hashref | values $hashref | | values @$arrayref | values $arrayref | | ($k,$v) = each %$hashref | ($k,$v) = each $hashref | | ($k,$v) = each @$arrayref | ($k,$v) = each $arrayref | |----------------------------+---------------------------| This allows these built-in functions to act on long dereferencing chains or on the return value of subroutines without needing to wrap them in C<@{}> or C<%{}>: push @{$obj->tags}, $new_tag; # old way push $obj->tags, $new_tag; # new way for ( keys %{$hoh->{genres}{artists}} ) {...} # old way for ( keys $hoh->{genres}{artists} ) {...} # new way For C<push>, C<unshift> and C<splice>, the reference will auto-vivify if it is not defined, just as if it were wrapped with C<@{}>. Calling C<keys> or C<values> directly on a reference gives a substantial performance improvement over explicit dereferencing. For C<keys>, C<values>, C<each>, when overloaded dereferencing is present, the overloaded dereference is used instead of dereferencing the underlying reftype. Warnings are issued about assumptions made in the following three ambiguous cases: (a) If both %{} and @{} overloading exists, %{} is used (b) If %{} overloading exists on a blessed arrayref, %{} is used (c) If @{} overloading exists on a blessed hashref, @{} is used
* warnings.pl -> regen/warnings.plFather Chrysostomos2010-10-131-2/+2
|
* regcomp.pl -> regen/regcomp.plFather Chrysostomos2010-10-131-1/+1
|
* reentr.pl -> regen/reentr.plFather Chrysostomos2010-10-131-2/+2
|
* overload.pl -> regen/overload.plFather Chrysostomos2010-10-131-2/+2
|
* opcode.pl -> regen/opcode.plFather Chrysostomos2010-10-131-6/+6
|
* keywords.pl -> regen/keywords.plFather Chrysostomos2010-10-131-2/+2
|