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 (@set_flag_index_char


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (@set_flag_index_char_ignore): use only one data structure for txiindex*ignore sets order and association with symbols.
Date: Sun, 19 Feb 2023 17:34:28 -0500

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 195afdeaa8 * tp/Texinfo/ParserNonXS.pm (@set_flag_index_char_ignore): 
use only one data structure for txiindex*ignore sets order and association with 
symbols.
195afdeaa8 is described below

commit 195afdeaa86f992c2498f5ec4b6603231be8db67
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Feb 19 23:34:20 2023 +0100

    * tp/Texinfo/ParserNonXS.pm (@set_flag_index_char_ignore): use only
    one data structure for txiindex*ignore sets order and association
    with symbols.
---
 ChangeLog                 |  6 ++++++
 tp/Texinfo/ParserNonXS.pm | 19 ++++++++-----------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c0ef85394e..8cda61ad52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-02-19  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (@set_flag_index_char_ignore): use only
+       one data structure for txiindex*ignore sets order and association
+       with symbols.
+
 2023-02-19  Patrice Dumas  <pertusus@free.fr>
 
        * tp/tests/Makefile.onetst, tp/tests/other/list-of-tests: add a test
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 2874eac164..9d8ef49823 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -346,17 +346,14 @@ my %set_flag_command_equivalent = (
 );
 
 # could be moved to Texinfo::Common if needed more generally
-my %set_flag_index_char_ignore = (
- 'txiindexatsignignore' => '@',
- 'txiindexbackslashignore' => '\\',
- 'txiindexlessthanignore' => '<',
- 'txiindexhyphenignore' => '-',
+# same order as in XS parser
+my @set_flag_index_char_ignore = (
+   ['txiindexbackslashignore', '\\'],
+   ['txiindexhyphenignore', '-'],
+   ['txiindexlessthanignore', '<'],
+   ['txiindexatsignignore', '@'],
 );
 
-# same as in XS parser
-my @set_flag_index_char_ignore_order = ('txiindexbackslashignore',
-   'txiindexhyphenignore', 'txiindexlessthanignore', 'txiindexatsignignore');
-
 my %type_with_paragraph;
 foreach my $type ('before_item', 'before_node_section', 'document_root',
                   'brace_command_context') {
@@ -3231,9 +3228,9 @@ sub _enter_index_entry($$$$)
   $element->{'extra'} = {} if (!defined($element->{'extra'}));
 
   # gather set txiindex*ignore information
-  foreach my $set_variable (@set_flag_index_char_ignore_order) {
+  foreach my $set_variable_and_symbol (@set_flag_index_char_ignore) {
+    my ($set_variable, $ignored_char) = @{$set_variable_and_symbol};
     if (exists($self->{'values'}->{$set_variable})) {
-      my $ignored_char = $set_flag_index_char_ignore{$set_variable};
       $element->{'extra'}->{'index_ignore_chars'} = ''
          if (!defined($element->{'extra'}->{'index_ignore_chars'}));
       $element->{'extra'}->{'index_ignore_chars'} .= $ignored_char;



reply via email to

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