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 (parser), tp/Texinfo/


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (parser), tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser): set only parser keys from parser_document_parsing_options, which in practice means do not accept a registrar in options.
Date: Sat, 19 Oct 2024 17:47:34 -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 33b935d2e4 * tp/Texinfo/ParserNonXS.pm (parser), 
tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser): set only parser keys from 
parser_document_parsing_options, which in practice means do not accept a 
registrar in options.
33b935d2e4 is described below

commit 33b935d2e418f6123440ae8beb0d0b0cff88a647
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Oct 19 23:47:27 2024 +0200

    * tp/Texinfo/ParserNonXS.pm (parser),
    tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser): set only parser keys
    from parser_document_parsing_options, which in practice means do not
    accept a registrar in options.
    
    * tp/Texinfo/Common.pm: remove %parser_configuration and
    %parser_settable_configuration.
---
 ChangeLog                            | 10 ++++++++++
 tp/Texinfo/Common.pm                 | 16 +---------------
 tp/Texinfo/ParserNonXS.pm            | 21 ++++++++-------------
 tp/Texinfo/XS/parsetexi/Parsetexi.pm | 18 +++++-------------
 4 files changed, 24 insertions(+), 41 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 45405e4e4e..98c18fec2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-10-19  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (parser),
+       tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser): set only parser keys
+       from parser_document_parsing_options, which in practice means do not
+       accept a registrar in options.
+
+       * tp/Texinfo/Common.pm: remove %parser_configuration and
+       %parser_settable_configuration.
+
 2024-10-19  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm, tp/Texinfo/XS/parsetexi/Parsetexi.pm:
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 69aa6fb850..8574b61399 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -162,13 +162,6 @@ my %parser_customization = (
 our %default_parser_customization_values = (%common_parser_customization,
                                             %parser_customization);
 
-# can be passed to the parser function, but not document parsing nor
-# customization, and can only be passed through code.
-my %parser_configuration = (
-  'registrar' => undef,        # Texinfo::Report object used for error
-                               # reporting.
-);
-
 # can be modified through command-line, but not customization options
 our %parser_document_state_configuration = (
   # parsed document parsing information still relevant after parsing
@@ -193,13 +186,6 @@ our %parser_document_parsing_options = (
                        %parser_document_state_configuration,
                        %parser_inner_options);
 
-# configurable parser keys
-our %parser_settable_configuration = (
-  %parser_document_parsing_options,
-  %parser_configuration,
-);
-
-
 # check that settable commands are contained in global commands
 # from command_data.txt
 if (0) {
@@ -2103,7 +2089,7 @@ and C<plaintext>.
 =back
 
 TODO: undocumented
-%null_device_file %default_parser_customization_values 
%parser_settable_configuration %multiple_at_command_options 
%unique_at_command_options %converter_cmdline_options 
%default_main_program_customization_options %converter_customization_options 
%document_settable_at_commands %def_map %command_structuring_level 
%level_to_structuring_command %encoding_name_conversion_map 
%text_brace_no_arg_commands
+%null_device_file %default_parser_customization_values 
%multiple_at_command_options %unique_at_command_options 
%converter_cmdline_options %default_main_program_customization_options 
%converter_customization_options %document_settable_at_commands %def_map 
%command_structuring_level %level_to_structuring_command 
%encoding_name_conversion_map %text_brace_no_arg_commands
 
 =head1 @-COMMAND INFORMATION
 
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 24a9fc9c87..26b02006ea 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -182,8 +182,7 @@ my %parser_document_state_initialization = (
 
   'sections_level_modifier' => 0, # modified by raise/lowersections
 
-  'input_file_encoding' => 'utf-8', # perl encoding name used for the input
-                                    # file
+  'input_file_encoding' => 'utf-8', # encoding name used for the input file
 );
 
 my %parsing_state_initialization = (
@@ -258,6 +257,10 @@ my %parser_state_initialization = 
(%parser_document_state_initialization,
 # conf                    Customization and document state configuration
 #                         based on defaults and parser argument.
 
+# other keys for the parser state initialized at parser creation
+# registrar          # Texinfo::Report object used for error
+#                    # reporting.
+
 # A source information is an hash reference with the keys:
 # line_nr        the line number.
 # file_name      the file name, a binary string.
@@ -583,7 +586,7 @@ foreach my $begin_paragraph_context ('base') {
 
 # initialization entry point.  Set up a parser.
 # The last argument, optional, is a hash provided by the user to change
-# the default values for what is present in %parser_settable_configuration.
+# the default values for what is present in %parser_document_parsing_options.
 sub parser(;$)
 {
   my $conf = shift;
@@ -598,9 +601,7 @@ sub parser(;$)
   my $parser = {};
   bless $parser;
 
-  # Reset conf from argument, restricting to parser_document_parsing_options,
-  # and set directly parser keys if in parser_settable_configuration and not in
-  # parser_document_parsing_options.
+  # Reset conf from argument, restricting to parser_document_parsing_options
   $parser->{'set'} = {};
   if (defined($conf)) {
     foreach my $key (keys(%$conf)) {
@@ -613,10 +614,6 @@ sub parser(;$)
         if ($initialization_overrides{$key}) {
           $parser->{'set'}->{$key} = $parser_conf->{$key};
         }
-      } elsif (exists($Texinfo::Common::parser_settable_configuration{$key})) {
-        # we keep instead of copying on purpose, to reuse the objects
-        # Should only be registrar
-        $parser->{$key} = $conf->{$key};
       } else {
         warn "ignoring parser configuration value \"$key\"\n";
       }
@@ -634,9 +631,7 @@ sub parser(;$)
     $parser->{'expanded_formats_hash'}->{$expanded_format} = 1;
   }
 
-  if (not defined($parser->{'registrar'})) {
-    $parser->{'registrar'} = Texinfo::Report::new();
-  }
+  $parser->{'registrar'} = Texinfo::Report::new();
 
   # variables set to the parser initialization values only.  What is
   # found in the document has no effect.  Also used to initialize some
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.pm 
b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
index 4ebb78046c..a137dba630 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
@@ -49,7 +49,7 @@ use Texinfo::Document;
 
 # Initialize the parser
 # The last argument, optional, is a hash provided by the user to change
-# the default values for what is present in %parser_settable_configuration.
+# the default values for what is present in %parser_document_parsing_options.
 sub parser (;$)
 {
   my $conf = shift;
@@ -64,9 +64,7 @@ sub parser (;$)
   my $parser = {};
   bless $parser;
 
-  # Reset conf from argument, restricting to parser_document_parsing_options,
-  # and set directly parser keys if in parser_settable_configuration and not in
-  # parser_document_parsing_options.
+  # Reset conf from argument, restricting to parser_document_parsing_options
   if (defined($conf)) {
     foreach my $key (keys(%$conf)) {
       if (exists($Texinfo::Common::parser_document_parsing_options{$key})) {
@@ -75,10 +73,6 @@ sub parser (;$)
         } else {
           $parser_conf->{$key} = $conf->{$key};
         }
-      } elsif (exists($Texinfo::Common::parser_settable_configuration{$key})) {
-        # we keep instead of copying on purpose, to reuse the objects
-        # Should only be registrar
-        $parser->{$key} = $conf->{$key};
       } else {
         # no warning here as in pure Perl as it is warned below
         #warn "ignoring parser configuration value \"$key\"\n";
@@ -154,8 +148,8 @@ sub parser (;$)
           parser_conf_set_accept_internalvalue(1);
           $store_conf = 0;
         }
-      } elsif ($key eq 'registrar' or $key eq 'DEBUG') {
-        # no action needed, already taken into account or only for Perl code
+      } elsif ($key eq 'DEBUG') {
+        # no action needed, already taken into account
       } else {
         warn "ignoring parser configuration value \"$key\"\n";
       }
@@ -169,9 +163,7 @@ sub parser (;$)
     $parser->{'conf'} = $parser_conf;
   }
 
-  if (not $parser->{'registrar'}) {
-    $parser->{'registrar'} = Texinfo::Report::new();
-  }
+  $parser->{'registrar'} = Texinfo::Report::new();
 
   return $parser;
 }



reply via email to

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