texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/maintain/regenerate_perl_options_info.pl: us


From: Patrice Dumas
Subject: branch master updated: * tp/maintain/regenerate_perl_options_info.pl: use more simple quotes. set a hash for conversion options and use it to retrieve the information in generated get_converter_regular_options.
Date: Wed, 02 Oct 2024 17:27:48 -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 884f4a26bb * tp/maintain/regenerate_perl_options_info.pl: use more 
simple quotes. set a hash for conversion options and use it to retrieve the 
information in generated get_converter_regular_options.
884f4a26bb is described below

commit 884f4a26bb9e6df7a0b3bb0f7385343808f717a3
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Aug 4 12:15:27 2024 +0200

    * tp/maintain/regenerate_perl_options_info.pl: use more simple quotes.
    set a hash for conversion options and use it to retrieve the
    information in generated get_converter_regular_options.
---
 ChangeLog                                   |  6 ++++++
 tp/maintain/regenerate_perl_options_info.pl | 13 +++++++------
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 55a66e9567..f3f34d1b6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,12 @@
        (get_converter_info_from_sv): do not error out on
        deprecated_config_directories customization hash directory key.
 
+2024-08-04  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/maintain/regenerate_perl_options_info.pl: use more simple quotes.
+       set a hash for conversion options and use it to retrieve the
+       information in generated get_converter_regular_options.
+
 2024-08-04  Patrice Dumas  <pertusus@free.fr>
 
        * doc/texi2any_api.texi (Managing Customization Variables): put the
diff --git a/tp/maintain/regenerate_perl_options_info.pl 
b/tp/maintain/regenerate_perl_options_info.pl
index c636b81476..9b5c4910bf 100755
--- a/tp/maintain/regenerate_perl_options_info.pl
+++ b/tp/maintain/regenerate_perl_options_info.pl
@@ -111,31 +111,32 @@ foreach my $category (sort(keys(%option_categories))) {
   print OUT "our %${category}_options = (\n";
   foreach my $option_info (@{$option_categories{$category}}) {
     my ($option, $value, $type) = @$option_info;
-    print OUT '  '.sprintf('%-34s', '"'.$option.'"')." => $value,\n";
+    print OUT '  '.sprintf('%-34s', "'$option'")." => $value,\n";
   }
   print OUT ");\n\n";
 }
 
 print OUT "\n\n#################################################\n\n";
 
+print OUT "my %regular_options_types;\n\n";
+
 my @sorted_formats = sort(keys(%converter_defaults));
 
-my $function_lines = '';
 foreach my $format (@sorted_formats) {
   my $hash = "%converter_${format}_regular_options_defaults";
   print OUT "my $hash = (\n";
   foreach my $option_spec (@{$converter_defaults{$format}}) {
     my ($option, $value) = @$option_spec;
-    print OUT '  '.sprintf('%-34s', '"'.$option.'"')." => $value,\n";
+    print OUT '  '.sprintf('%-34s', "'$option'")." => $value,\n";
   }
   print OUT ");\n\n";
-  $function_lines .= "  elsif (\$input eq '$format') \n   {return \\$hash;}\n"
+
+  print OUT "\$regular_options_types{'$format'} = \\$hash;\n\n";
 }
 
 print OUT "sub get_converter_regular_options {\n";
 print OUT "  my \$input = shift;\n";
-print OUT "  if (0) {}\n";
-print OUT $function_lines;
+print OUT "  return \$regular_options_types{\$input}\n";
 print OUT "}\n\n";
 
 print OUT "1;\n";



reply via email to

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