texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Mon, 23 Dec 2024 18:27:40 -0500 (EST)

branch: master
commit 1376f7d3da0dcc8792595e94b2b9135e6a564046
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Dec 19 21:21:30 2024 +0100

    * tp/texi2any.pl: keep track of total errors number by using the
    handle_errors return value.  Use handle_errors for document errors.
    
    * tp/texi2any.pl (handle_errors): change a variable name.
---
 ChangeLog      |  7 +++++++
 tp/texi2any.pl | 27 +++++++++++++++++----------
 2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 821fa9695b..3eb226367e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-12-19  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/texi2any.pl: keep track of total errors number by using the
+       handle_errors return value.  Use handle_errors for document errors.
+
+       * tp/texi2any.pl (handle_errors): change a variable name.
+
 2024-12-19  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/utils.c (remove_from_strings_list): add.
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 5286791137..1f09b3c1e9 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -1445,11 +1445,11 @@ sub _exit($$)
 sub handle_errors(@)
 {
   my $errors = shift;
-  my $new_error_count = shift;
+  my $additional_error_count = shift;
   my $error_count = shift;
   my $opened_files = shift;
 
-  $error_count += $new_error_count if ($new_error_count);
+  $error_count += $additional_error_count if ($additional_error_count);
   _handle_errors($errors);
 
   _exit($error_count, $opened_files);
@@ -1754,18 +1754,24 @@ while(@input_files) {
   }
 
   if (!defined($tree)) {
-    handle_errors($document->parser_errors(), $error_count, \%opened_files);
+    $error_count
+      = handle_errors($document->parser_errors(), $error_count,
+                      \%opened_files);
     goto NEXT;
   }
 
   if ($output_format eq 'parse') {
-    handle_errors($document->parser_errors(), $error_count, \%opened_files);
+    $error_count
+      = handle_errors($document->parser_errors(), $error_count,
+                      \%opened_files);
     goto NEXT;
   }
 
   my $document_information = $document->global_information();
   if (get_conf('TRACE_INCLUDES')) {
-    handle_errors($document->parser_errors(), $error_count, \%opened_files);
+    $error_count
+     = handle_errors($document->parser_errors(), $error_count,
+                     \%opened_files);
     my $included_file_paths = $document_information->{'included_files'};
     if (defined($included_file_paths)) {
       foreach my $included_file (@$included_file_paths) {
@@ -1868,7 +1874,8 @@ while(@input_files) {
   }
   if (get_conf('DUMP_TEXI')
       or $formats_table{$output_format}->{'texi2dvi_format'}) {
-    handle_errors($document->parser_errors(), $error_count, \%opened_files);
+    $error_count = handle_errors($document->parser_errors(), $error_count,
+                                 \%opened_files);
     goto NEXT;
   }
 
@@ -1951,11 +1958,10 @@ while(@input_files) {
   $error_count += $new_error_count if ($new_error_count);
   # document/structuring errors
   my ($document_errors, $document_error_count) = $document->errors();
-  $error_count += $document_error_count if ($document_error_count);
   push @$errors, @$document_errors;
 
-  _handle_errors($errors);
-  _exit($error_count, \%opened_files);
+  $error_count = handle_errors($errors, $document_error_count,
+                               $error_count, \%opened_files);
 
   if ($output_format eq 'structure') {
     goto NEXT;
@@ -2016,7 +2022,8 @@ while(@input_files) {
                     $converter->output_files_information());
   $error_count = merge_opened_files($error_count, \%opened_files,
                                     $converter_opened_files);
-  handle_errors($converter_registrar->errors(), $error_count, \%opened_files);
+  $error_count = handle_errors($converter_registrar->errors(),
+                               $error_count, \%opened_files);
   my $converter_unclosed_files
        = Texinfo::Convert::Utils::output_files_unclosed_files(
                                $converter->output_files_information());



reply via email to

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