texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/ParserNonXS.pm (%parsing_state_initi


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (%parsing_state_initialization) (get_parser_info, _end_line_misc_line, _handle_close_brace): store 'input_encoding_name' directly in $document->{'global_info'}.
Date: Tue, 21 May 2024 02:10:16 -0400

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 c4880f2786 * tp/Texinfo/ParserNonXS.pm (%parsing_state_initialization) 
(get_parser_info, _end_line_misc_line, _handle_close_brace): store 
'input_encoding_name' directly in $document->{'global_info'}.
c4880f2786 is described below

commit c4880f2786bbdc77aa15d7f0b772ddb973a31a16
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue May 21 08:10:13 2024 +0200

    * tp/Texinfo/ParserNonXS.pm (%parsing_state_initialization)
    (get_parser_info, _end_line_misc_line, _handle_close_brace): store
    'input_encoding_name' directly in $document->{'global_info'}.
---
 ChangeLog                 |  6 ++++++
 tp/Texinfo/ParserNonXS.pm | 17 ++++++-----------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 01735dafce..f3404a9bc2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-21  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (%parsing_state_initialization)
+       (get_parser_info, _end_line_misc_line, _handle_close_brace): store
+       'input_encoding_name' directly in $document->{'global_info'}.
+
 2024-05-20  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/parsetexi/macro.c (new_macro): inline lookup_free_slot
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 923047536f..490f8773df 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -208,8 +208,6 @@ my %parsing_state_initialization = (
                          # is no @-command associated with the context.
   'input_file_encoding' => 'utf-8', # perl encoding name used for the input
                                     # file
-  'input_encoding_name' => 'utf-8', # current input encoding name, based on
-                                    # mime type encoding names
 );
 
 my %parser_state_initialization = (%parser_document_state_initialization,
@@ -880,10 +878,6 @@ sub get_parser_info($)
   if (defined($perl_encoding)) {
     $document->{'global_info'}->{'input_perl_encoding'} = $perl_encoding
   }
-  if (defined($self->{'input_encoding_name'})) {
-    $document->{'global_info'}->{'input_encoding_name'}
-                               = $self->{'input_encoding_name'};
-  }
 
   my $global_commands = $document->{'commands_info'};
 
@@ -3622,8 +3616,8 @@ sub _end_line_misc_line($$$)
         }
       } elsif ($command eq 'verbatiminclude') {
         $current->{'extra'}->{'input_encoding_name'}
-                        = $self->{'input_encoding_name'}
-          if (defined($self->{'input_encoding_name'}));
+               = $document->{'global_info'}->{'input_encoding_name'}
+          if (defined($document->{'global_info'}->{'input_encoding_name'}));
         # gather included file for 'included_files'.  No errors, they
         # should be output by converters
         my ($file_path, $file_name_encoding) = _encode_file_name($self, $text);
@@ -3676,8 +3670,8 @@ sub _end_line_misc_line($$$)
                  __("unhandled encoding name `%s'"), $text);
           } else {
             if ($input_encoding) {
+              $document->{'global_info'}->{'input_encoding_name'} = 
$input_encoding;
               $current->{'extra'}->{'input_encoding_name'} = $input_encoding;
-              $self->{'input_encoding_name'} = $input_encoding;
             }
 
             $self->{'input_file_encoding'} = $perl_encoding;
@@ -6343,10 +6337,11 @@ sub _handle_close_brace($$$)
         $self->_line_error(
            __("\@image missing filename argument"), $source_info);
       }
-      if (defined($self->{'input_encoding_name'})) {
+      my $document = $self->{'document'};
+      if (defined($document->{'global_info'}->{'input_encoding_name'})) {
         $image->{'extra'} = {} if (!$image->{'extra'});
         $image->{'extra'}->{'input_encoding_name'}
-           = $self->{'input_encoding_name'};
+           = $document->{'global_info'}->{'input_encoding_name'};
       }
     } elsif($current->{'parent'}->{'cmdname'} eq 'dotless') {
       my $dotless = $current->{'parent'};



reply via email to

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