summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-03-15 03:06:35 +0000
committerNorbert Preining <norbert@preining.info>2024-03-15 03:06:35 +0000
commit12679ab7d3c2a210f4123163671b532b8b55d5f9 (patch)
tree0060d13467186ad977f4e73488ee20dd6c0017ab /systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS
parent62170822e034fdd3f81de7274835d0d3b0467100 (diff)
CTAN sync 202403150306
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS')
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Constants.pm2
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/CountLines.pm2
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Eval.pm2
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Utilities.pm81
4 files changed, 80 insertions, 7 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Constants.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Constants.pm
index d7668c4733..012ba557cb 100644
--- a/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Constants.pm
+++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Constants.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
use Symbol;
-our $VERSION = '3.43';
+our $VERSION = '3.51';
=head1 NAME
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/CountLines.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/CountLines.pm
index c592621e03..cca6e74c4a 100644
--- a/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/CountLines.pm
+++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/CountLines.pm
@@ -1,7 +1,7 @@
package ExtUtils::ParseXS::CountLines;
use strict;
-our $VERSION = '3.43';
+our $VERSION = '3.51';
our $SECTION_END_MARKER;
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Eval.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Eval.pm
index c509531d2f..a7c3920e82 100644
--- a/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Eval.pm
+++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Eval.pm
@@ -2,7 +2,7 @@ package ExtUtils::ParseXS::Eval;
use strict;
use warnings;
-our $VERSION = '3.43';
+our $VERSION = '3.51';
=head1 NAME
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Utilities.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Utilities.pm
index 6cc8a0e408..b2674b3605 100644
--- a/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Utilities.pm
+++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/ExtUtils/ParseXS/Utilities.pm
@@ -5,7 +5,7 @@ use Exporter;
use File::Spec;
use ExtUtils::ParseXS::Constants ();
-our $VERSION = '3.43';
+our $VERSION = '3.51';
our (@ISA, @EXPORT_OK);
@ISA = qw(Exporter);
@@ -21,6 +21,7 @@ our (@ISA, @EXPORT_OK);
analyze_preprocessor_statements
set_cond
Warn
+ WarnHint
current_line_number
blurt
death
@@ -654,18 +655,85 @@ sub current_line_number {
=item * Purpose
+Print warnings with line number details at the end.
+
=item * Arguments
+List of text to output.
+
=item * Return Value
+None.
+
=back
=cut
sub Warn {
+ my ($self)=shift;
+ $self->WarnHint(@_,undef);
+}
+
+=head2 C<WarnHint()>
+
+=over 4
+
+=item * Purpose
+
+Prints warning with line number details. The last argument is assumed
+to be a hint string.
+
+=item * Arguments
+
+List of strings to warn, followed by one argument representing a hint.
+If that argument is defined then it will be split on newlines and output
+line by line after the main warning.
+
+=item * Return Value
+
+None.
+
+=back
+
+=cut
+
+sub WarnHint {
+ warn _MsgHint(@_);
+}
+
+=head2 C<_MsgHint()>
+
+=over 4
+
+=item * Purpose
+
+Constructs an exception message with line number details. The last argument is
+assumed to be a hint string.
+
+=item * Arguments
+
+List of strings to warn, followed by one argument representing a hint.
+If that argument is defined then it will be split on newlines and concatenated
+line by line (parenthesized) after the main message.
+
+=item * Return Value
+
+The constructed string.
+
+=back
+
+=cut
+
+
+sub _MsgHint {
my $self = shift;
+ my $hint = pop;
my $warn_line_number = $self->current_line_number();
- print STDERR "@_ in $self->{filename}, line $warn_line_number\n";
+ my $ret = join("",@_) . " in $self->{filename}, line $warn_line_number\n";
+ if ($hint) {
+ $ret .= " ($_)\n" for split /\n/, $hint;
+ }
+ return $ret;
}
=head2 C<blurt()>
@@ -703,8 +771,13 @@ sub blurt {
=cut
sub death {
- my $self = shift;
- $self->Warn(@_);
+ my ($self) = (@_);
+ my $message = _MsgHint(@_,"");
+ if ($self->{die_on_error}) {
+ die $message;
+ } else {
+ warn $message;
+ }
exit 1;
}