texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/Convert/Texinfo.pm (convert_to_texin


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/Texinfo.pm (convert_to_texinfo): use confess instead of die.
Date: Mon, 03 Jan 2022 05:31:31 -0500

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new e5136116dd * tp/Texinfo/Convert/Texinfo.pm (convert_to_texinfo): use 
confess instead of die.
e5136116dd is described below

commit e5136116dd687a119b52348adfe7f8c97c2a6098
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Jan 3 11:31:21 2022 +0100

    * tp/Texinfo/Convert/Texinfo.pm (convert_to_texinfo): use confess
    instead of die.
    
    * tp/Makefile.am (test_files, dist_init_DATA): add distributed files.
---
 ChangeLog                     |  7 +++++++
 man/pod2texi.1                |  2 +-
 tp/Makefile.am                |  2 ++
 tp/Texinfo/Convert/Texinfo.pm |  7 ++++---
 tp/t/test_utils.pl            | 14 ++++++++++++--
 5 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6c55ddcb7f..6297fe5052 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-01-03  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/Texinfo.pm (convert_to_texinfo): use confess
+       instead of die.
+
+       * tp/Makefile.am (test_files, dist_init_DATA): add distributed files.
+
 2022-01-03  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/HTML.pm (convert): output special elements
diff --git a/man/pod2texi.1 b/man/pod2texi.1
index 75851d2434..13816f13f2 100644
--- a/man/pod2texi.1
+++ b/man/pod2texi.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "POD2TEXI 1"
-.TH POD2TEXI 1 "2021-09-04" "perl v5.32.1" "User Contributed Perl 
Documentation"
+.TH POD2TEXI 1 "2022-01-01" "perl v5.32.1" "User Contributed Perl 
Documentation"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/tp/Makefile.am b/tp/Makefile.am
index a5685e21fa..57765fc43f 100644
--- a/tp/Makefile.am
+++ b/tp/Makefile.am
@@ -115,6 +115,7 @@ initdir = $(datadir)/texinfo/init
 dist_init_DATA = \
  init/book.pm \
  init/chm.pm \
+ init/epub3.pm \
  init/html32.pm \
  init/tex4ht.pm \
  init/latex2html.pm \
@@ -220,6 +221,7 @@ test_files = \
  t/input_files/simplest.texi \
  t/input_files/split_chapter_index.texi \
  t/input_files/split_nocopying.texi \
+ t/input_files/simplest_no_node_section.texi \
  t/input_files/test_refs.texi \
  t/input_files/test_two_include.texi \
  t/input_files/top_node_up_explicit.texi \
diff --git a/tp/Texinfo/Convert/Texinfo.pm b/tp/Texinfo/Convert/Texinfo.pm
index 5f856bf231..08a2bdc493 100644
--- a/tp/Texinfo/Convert/Texinfo.pm
+++ b/tp/Texinfo/Convert/Texinfo.pm
@@ -23,6 +23,8 @@ package Texinfo::Convert::Texinfo;
 use 5.00405;
 use strict;
 
+use Carp qw(cluck confess);
+
 # commands definitions
 use Texinfo::Common;
 
@@ -102,8 +104,8 @@ sub convert_to_texinfo($;$)
   my $element = shift;
   my $expand_replaced = shift;
 
-  die "convert_to_texinfo: element undef\n" if (!defined($element));
-  die "convert_to_texinfo: bad element type (".ref($element).") $element\n"
+  confess "convert_to_texinfo: element undef" if (!defined($element));
+  confess "convert_to_texinfo: bad element type (".ref($element).") $element"
      if (ref($element) ne 'HASH');
   my $result = '';
 
@@ -225,7 +227,6 @@ sub _expand_cmd_args_to_texi($;$) {
     if ($cmdname eq 'verb') {
       $result .= $cmd->{'extra'}->{'delimiter'};
     }
-    #die "Shouldn't have args: $cmdname\n";
     $result .= '}' if ($braces);
   } else {
     $result .= $cmd->{'extra'}->{'spaces_before_argument'}
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index f907c44d2e..1fe8301f81 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -877,21 +877,31 @@ sub test($$)
   # take the initial values to record only if there is something new
   # do a copy to compare the values and not the references
   my $initial_index_names = dclone(\%Texinfo::Common::index_names);
-  print STDERR "  TEST $test_name\n" if ($self->{'DEBUG'});
   my $result;
   if (!$test_file) {
+    print STDERR "  TEST $test_name\n" if ($self->{'DEBUG'});
     $result = $parser->parse_texi_text($test_text, 1);
     if (defined($test_input_file_name)) {
       $parser->{'info'}->{'input_file_name'} = $test_input_file_name;
     }
   } else {
+    print STDERR "  TEST $test_name ($test_file)\n" if ($self->{'DEBUG'});
     $result = $parser->parse_texi_file($test_file);
   }
+  my $registrar = $parser->registered_errors();
+
+  if (not defined($result)) {
+    print STDERR "ERROR: parsing result undef\n";
+    my ($parser_errors, $parser_error_count) = $registrar->errors();
+    foreach my $error_message (@$parser_errors) {
+      warn $error_message->{'error_line'} if ($error_message->{'type'} eq 
'error');
+    }
+  }
+
   my $parser_informations = $parser->global_informations();
 
   Texinfo::Common::set_output_encodings($main_configuration, 
$parser_informations);
 
-  my $registrar = $parser->registered_errors();
   my ($labels, $targets_list, $nodes_list) = $parser->labels_information();
   my $refs = $parser->internal_references_information();
   Texinfo::Structuring::associate_internal_references($registrar,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]