texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser),


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser), tp/Texinfo/XS/parsetexi/Parsetexi.xs (parser_store_EXPANDED_FORMATS): iterate over EXPANDED_FORMATS in Parsetexi.xs.
Date: Mon, 20 May 2024 03:43:46 -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 cd38040f4f * tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser), 
tp/Texinfo/XS/parsetexi/Parsetexi.xs (parser_store_EXPANDED_FORMATS): iterate 
over EXPANDED_FORMATS in Parsetexi.xs.
cd38040f4f is described below

commit cd38040f4f09881a781ad0f8712b9f63ec888c29
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon May 20 09:43:48 2024 +0200

    * tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser),
    tp/Texinfo/XS/parsetexi/Parsetexi.xs (parser_store_EXPANDED_FORMATS):
    iterate over EXPANDED_FORMATS in Parsetexi.xs.
---
 ChangeLog                            |  6 ++++++
 tp/Texinfo/XS/parsetexi/Parsetexi.pm |  6 +-----
 tp/Texinfo/XS/parsetexi/Parsetexi.xs | 22 ++++++++++++++++++----
 3 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8f3a60c2c9..e5f639961a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-20  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser),
+       tp/Texinfo/XS/parsetexi/Parsetexi.xs (parser_store_EXPANDED_FORMATS):
+       iterate over EXPANDED_FORMATS in Parsetexi.xs.
+
 2024-05-20  Patrice Dumas  <pertusus@free.fr>
 
        Replace parser_expanded_formats by const.expanded_formats
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.pm 
b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
index c7cee35e10..6bcafec6a8 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
@@ -102,11 +102,7 @@ sub parser (;$$)
       } elsif ($key eq 'values') {
         parser_store_values($conf->{'values'});
       } elsif ($key eq 'EXPANDED_FORMATS') {
-        conf_clear_expanded_formats();
-
-        for my $f (@{$conf->{$key}}) {
-          conf_add_expanded_format($f);
-        }
+        parser_store_EXPANDED_FORMATS($conf->{'EXPANDED_FORMATS'});
       } elsif ($key eq 'documentlanguage') {
         if (defined ($conf->{$key})) {
           parser_set_documentlanguage_override($conf->{$key});
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.xs 
b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
index 07c63c18cb..c7aca34291 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.xs
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
@@ -152,11 +152,25 @@ parser_store_INCLUDE_DIRECTORIES (SV *directories)
           }
 
 void
-conf_clear_expanded_formats ()
+parser_store_EXPANDED_FORMATS (SV *expanded_formats)
+      CODE:
+        conf_clear_expanded_formats ();
+        if (SvOK (expanded_formats))
+          {
+            SSize_t i;
+            AV *expanded_formats_av = (AV *)SvRV (expanded_formats);
+            SSize_t expanded_formats_nr = av_top_index (expanded_formats_av) 
+1;
 
-void
-conf_add_expanded_format (format)
-     char *format = (char *)SvPVutf8_nolen ($arg);
+            for (i = 0; i < expanded_formats_nr; i++)
+              {
+                SV **format_sv = av_fetch (expanded_formats_av, i, 0);
+                if (format_sv && SvOK (*format_sv))
+                  {
+                    char *format = SvPVutf8_nolen (*format_sv);
+                    conf_add_expanded_format (format);
+                  }
+              }
+          }
 
 void
 conf_set_show_menu (int i)



reply via email to

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