Branch: refs/heads/blead Home: https://github.com/Perl/perl5 Commit: 004d9852a629e2bded597a2bba544519c018c624 https://github.com/Perl/perl5/commit/004d9852a629e2bded597a2bba544519c018c624 Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024)
Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm Log Message: ----------- ParseXS: improve internal heredoc quoting There is a private function, Q(), which (among other things), deletes a leading /^#/ from each line. This allows for code like this in ParseXS.pm: print Q(<<"EOF"); #$extern #XS_EUPXS(XS_$self->{xsub_func_full_C_name}); /* prototype to pass -Wmissing-prototypes */ #XS_EUPXS(XS_$self->{xsub_func_full_C_name}) #[[ # dVAR; dXSARGS; EOF which presumably in Olden Times allowed dumb text editor highlighters to highlight the lines of the heredocs as code comments. Highlighters seem smarter these days, and '#' is a terrible choice of character, as lots of escaped lines start with '#if' etc. And it looks like a commented-out line of perl code. This commit changes it so that the escape is now a '|' preceded by optional whitespace. The whitespace has to be the same for all lines of the heredoc. That code above is now: print Q(<<"EOF"); |$extern |XS_EUPXS(XS_$self->{xsub_func_full_C_name}); /* prototype to pass -Wmissing-prototypes */ |XS_EUPXS(XS_$self->{xsub_func_full_C_name}) |[[ | dVAR; dXSARGS; EOF It's not perfect, but it makes some of the code easier to read. This commit should produce no changes to output. Commit: 912f0eac76dab2fb32170e489468fa24f1272e35 https://github.com/Perl/perl5/commit/912f0eac76dab2fb32170e489468fa24f1272e35 Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024) Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm Log Message: ----------- ParseXS: simplify one heredoc Almost all heredocs in ParseXS.pm use <<"EOF". There is one which uses <<"MAKE_FETCHMETHOD_WORK". Change it to "EOF" for consistency. Commit: f156da3c8ad4768347b166ed2e449f120e9aee3e https://github.com/Perl/perl5/commit/f156da3c8ad4768347b166ed2e449f120e9aee3e Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024) Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm Log Message: ----------- ParseXS: always use method calls. There were still a few places doing: foo($self, ...); This commit changes them to: $self->foo(...); This shouldn't really make any difference until someone starts sub-classing stuff, which is unlikely, but now at least not impossible, Commit: 2023ce8ee6f0e62cd63608215d0f5f97e4b5096f https://github.com/Perl/perl5/commit/2023ce8ee6f0e62cd63608215d0f5f97e4b5096f Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024) Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm Log Message: ----------- ParseXS: rename PushXSStack() push_parse_stack() $XSStack was recently renamed; this commit renames the corresponding method call. Commit: 8f5adcfe969ffe41ac1760016de8002d2ce9064f https://github.com/Perl/perl5/commit/8f5adcfe969ffe41ac1760016de8002d2ce9064f Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024) Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm Log Message: ----------- ParseXS: don't use print_section() for BOOT output The print_section() method reads input lines until the next keyword and outputs them. It's intended for use with keywords like CODE: which just copy lines from input to output verbatim (but with '#line' fixups). ParseXS.pm was using print_section() to output deferred BOOT: lines into the boot XSUB. This was hacky: it was faking up the contents of $self->{line} etc. Instead, output the lines directly and emit our own '#line' at the end (the only useful thing print_section() was contributing). Note that lines derived from BOOT: will already have had a '#line' prepended at the time the lines were read in. Commit: a94ce19dcc48e38ede95c456c76d775dbfe4a34e https://github.com/Perl/perl5/commit/a94ce19dcc48e38ede95c456c76d775dbfe4a34e Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024) Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm Log Message: ----------- ParseXS: store newlines in bootcode_later @{$self->{bootcode_early} and @{$self->{bootcode_later} both hold lines of code to insert later into the boot xsub. However the _early lines have newlines, while the _later ones don't. This commit changes it so that both sets of lines have newlines, for consistency's sake. Commit: 41ecb5c562e5e25efeeecea20bf76a71263f0569 https://github.com/Perl/perl5/commit/41ecb5c562e5e25efeeecea20bf76a71263f0569 Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024) Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Constants.pm Log Message: ----------- delete @ExtUtils::ParseXS::Constants::InitFileCode This 'constant' (actually a package var) doesn't really seem to serve any useful purpose - it's always set to (). All the other similar package 'constants' were removed in commits around v5.15.0-503-g0adb6a1992; perhaps this one was just accidentally missed? Also, the name of the object field it initialises has since been renamed; if this commit is reverted for any reason, the var should be renamed to: @ExtUtils::ParseXS::Constants::bootcode_early or some such. Commit: d3b231959544a7b6ff8d871b287094782cd30684 https://github.com/Perl/perl5/commit/d3b231959544a7b6ff8d871b287094782cd30684 Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024) Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm Log Message: ----------- ParseXS: add BOOT_handler() method. Most XS keywords FOO are processed by a method called FOO_handler(). BOOT: was an exception. This commit moves the code that was in process_file() which was handling BOOT: directly, into a new BOOT_handler() method. The lines of code themselves have just been cut and pasted, so there should be no functional changes. Commit: 62062f50c540c7f1e77400f81ec4b79d4bcf92b5 https://github.com/Perl/perl5/commit/62062f50c540c7f1e77400f81ec4b79d4bcf92b5 Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024) Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm Log Message: ----------- ParseXS: tidy some code in BOOT_handler() Make a chunk of code easier to read by 1) making the if condition no longer postfix, and 2) using sprintf rather than string concatenation. Should be no functional change. Commit: 7dbcf12b8e6797bf74f2808a44d82f70ff79df16 https://github.com/Perl/perl5/commit/7dbcf12b8e6797bf74f2808a44d82f70ff79df16 Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024) Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm M dist/ExtUtils-ParseXS/t/110-assign_func_args.t Log Message: ----------- ParseXS::Utilities: rename assign_func_args The method ExtUtils::ParseXS::Utilities::assign_func_args() doesn't actually do any assigning, and its name gives no clue as to what func its referring to. It actually generates a string containing a comma-separated list of args to pass to the auto-called C function, if any. So rename it to C_func_signature(). The new name is technically not 100% accurate, since the signature is a properly of the C function rather than of the caller, but it's close enough, and it mimics the name of the xsub_C_auto_function_signature object field, which suffers from the same inaccuracy. Commit: 370fb489eb0ef099cd43641b0201405ae8da4415 https://github.com/Perl/perl5/commit/370fb489eb0ef099cd43641b0201405ae8da4415 Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024) Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm Log Message: ----------- ParseXS: rename process_keyword > process_keywords The method process_keyword() actually processes as many matching keywords as it can find. So rename it. Commit: 2e3e2915783411f8d5f2144cc4c0e836a0e9c6e6 https://github.com/Perl/perl5/commit/2e3e2915783411f8d5f2144cc4c0e836a0e9c6e6 Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024) Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Constants.pm Log Message: ----------- ParseXS: add Constants::generic_xsub_keywords_alt Add the 'constant' package var $ExtUtils::ParseXS::Constants::generic_xsub_keywords_alt which represents a 'FOO|BAR|...' alternation of all the keywords which can appear *anywhere* within an XSUB (as opposed to keywords like CODE which can only appear in certain positions). This makes it less likely that any future such keywords when added, won't be added to *every* process_keywords() call. Commit: 9470c86ae53dc8465ab60a0603dc18a930b72018 https://github.com/Perl/perl5/commit/9470c86ae53dc8465ab60a0603dc18a930b72018 Author: David Mitchell <da...@iabyn.com> Date: 2024-08-21 (Wed, 21 Aug 2024) Changed paths: M dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm Log Message: ----------- ParseXS: add 'use warnings' It already has 'use strict', but not 'use warnings' for some reason. Adding it doesn't seem to break anything. Compare: https://github.com/Perl/perl5/compare/d67896a03348...9470c86ae53d To unsubscribe from these emails, change your notification settings at https://github.com/Perl/perl5/settings/notifications