texinfo-commits
[Top][All Lists]
Advanced

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

[7402] Remove contained_indices hash when an index is merged into anothe


From: gavinsmith0123
Subject: [7402] Remove contained_indices hash when an index is merged into another index
Date: Wed, 21 Sep 2016 13:52:27 +0000 (UTC)

Revision: 7402
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7402
Author:   gavin
Date:     2016-09-21 13:52:27 +0000 (Wed, 21 Sep 2016)
Log Message:
-----------
Remove contained_indices hash when an index is merged into another index

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Parser.pm
    trunk/tp/t/results/converters_tests/printindex_merged_indices_code_style.pl
    trunk/tp/t/results/indices/complex_recursive_synindex.pl
    trunk/tp/t/results/indices/def_syn_indices.pl
    trunk/tp/t/results/indices/default_cp_index_and_one_letter_syncodeindex.pl
    trunk/tp/t/results/indices/double_syncodeindex.pl
    trunk/tp/t/results/indices/print_merged_index.pl
    trunk/tp/t/results/indices/recursive_synindex.pl
    trunk/tp/t/results/indices/same_index_entry_merged_indices.pl
    trunk/tp/t/results/indices/syncode_index_print_both.pl
    trunk/tp/t/results/indices/syncodeindex_to_plain.pl
    trunk/tp/t/results/info_tests/colon_in_index_entry.pl
    trunk/tp/t/results/macro/macro_in_index_commands.pl
    trunk/tp/t/results/value/value_in_index_commands.pl

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-09-21 12:21:55 UTC (rev 7401)
+++ trunk/ChangeLog     2016-09-21 13:52:27 UTC (rev 7402)
@@ -1,3 +1,16 @@
+2016-09-21  Gavin Smith  <address@hidden>
+
+       * tp/Texinfo/Parser.pm (_parse_line_command_args) <@synindex>:
+       Remove 'contained_indices' hash when an index is merged into 
+       another index.  This simplifies the result in the following 
+       situation: Index B is merged into index A, then index C is 
+       merged into index B.  Previously, index C would not be in the 
+       'contained_indices' of index B: it would only be in those of 
+       index A.  Had index C been merged into index B first, index C 
+       would have been recorded as being in both.  Eliminating the 
+       'contained_indices' hash on the intermediate indices removes the 
+       dependency on the order that the '@synindex' commands occurred.
+
 2016-09-20  Gavin Smith  <address@hidden>
 
        * tp/Texinfo/Parser.pm (_parse_line_command_args): Add a comma 

Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm  2016-09-21 12:21:55 UTC (rev 7401)
+++ trunk/tp/Texinfo/Parser.pm  2016-09-21 13:52:27 UTC (rev 7402)
@@ -5743,10 +5743,11 @@
           $in_code = 1 if ($command eq 'syncodeindex');
           $self->{'merged_indices'}->{$index_from} = $current_to;
           $index_from_info->{'in_code'} = $in_code;
-          foreach my $contained_index (keys 
%{$index_from_info->{'contained_indices'}}) {
+          foreach my $contained_index (keys 
%{$index_from_info->{'ontained_indices'}}) {
             $index_to_info->{'contained_indices'}->{$contained_index} = 1;
             $self->{'index_names'}->{$contained_index}->{'merged_in'} = 
$current_to;
           }
+          delete $index_from_info->{'contained_indices'};
           $index_from_info->{'merged_in'} = $current_to;
           $index_to_info->{'contained_indices'}->{$index_from} = 1;
           $args = [$index_from, $index_to];
@@ -6249,9 +6250,9 @@
 
 =item contained_indices
 
-An hash reference holding names of indices that are merged to the index,
+An hash reference holding names of indices that are merged into the index,
 including itself.  It also contains indirectly merged indices.  This key 
-is present even if the index is itself later merged to another index.
+is removed if the index is itself later merged to another index.
 
 =item index_entries
 

Modified: 
trunk/tp/t/results/converters_tests/printindex_merged_indices_code_style.pl
===================================================================
--- trunk/tp/t/results/converters_tests/printindex_merged_indices_code_style.pl 
2016-09-21 12:21:55 UTC (rev 7401)
+++ trunk/tp/t/results/converters_tests/printindex_merged_indices_code_style.pl 
2016-09-21 13:52:27 UTC (rev 7402)
@@ -906,25 +906,16 @@
 $result_indices{'printindex_merged_indices_code_style'} = {
   'index_names' => {
     'cdi' => {
-      'contained_indices' => {
-        'cdi' => 1
-      },
       'in_code' => 0,
       'merged_in' => 'fn',
       'name' => 'cdi'
     },
     'cp' => {
-      'contained_indices' => {
-        'cp' => 1
-      },
       'in_code' => 0,
       'merged_in' => 'fn',
       'name' => 'cp'
     },
     'ddi' => {
-      'contained_indices' => {
-        'ddi' => 1
-      },
       'in_code' => 1,
       'merged_in' => 'fn',
       'name' => 'ddi'
@@ -962,9 +953,6 @@
       'name' => 'tp'
     },
     'vr' => {
-      'contained_indices' => {
-        'vr' => 1
-      },
       'in_code' => 0,
       'merged_in' => 'fn',
       'name' => 'vr'

Modified: trunk/tp/t/results/indices/complex_recursive_synindex.pl
===================================================================
--- trunk/tp/t/results/indices/complex_recursive_synindex.pl    2016-09-21 
12:21:55 UTC (rev 7401)
+++ trunk/tp/t/results/indices/complex_recursive_synindex.pl    2016-09-21 
13:52:27 UTC (rev 7402)
@@ -1520,9 +1520,6 @@
 $result_indices{'complex_recursive_synindex'} = {
   'index_names' => {
     'aaa' => {
-      'contained_indices' => {
-        'aaa' => 1
-      },
       'in_code' => 0,
       'merged_in' => 'bbb',
       'name' => 'aaa'
@@ -1539,9 +1536,6 @@
       'name' => 'bbb'
     },
     'ccc' => {
-      'contained_indices' => {
-        'ccc' => 1
-      },
       'in_code' => 0,
       'merged_in' => 'bbb',
       'name' => 'ccc'
@@ -1554,17 +1548,11 @@
       'name' => 'cp'
     },
     'ddd' => {
-      'contained_indices' => {
-        'ddd' => 1
-      },
       'in_code' => 0,
       'merged_in' => 'bbb',
       'name' => 'ddd'
     },
     'eee' => {
-      'contained_indices' => {
-        'eee' => 1
-      },
       'in_code' => 0,
       'merged_in' => 'bbb',
       'name' => 'eee'

Modified: trunk/tp/t/results/indices/def_syn_indices.pl
===================================================================
--- trunk/tp/t/results/indices/def_syn_indices.pl       2016-09-21 12:21:55 UTC 
(rev 7401)
+++ trunk/tp/t/results/indices/def_syn_indices.pl       2016-09-21 13:52:27 UTC 
(rev 7402)
@@ -2005,9 +2005,6 @@
 $result_indices{'def_syn_indices'} = {
   'index_names' => {
     'abc' => {
-      'contained_indices' => {
-        'abc' => 1
-      },
       'in_code' => 0,
       'merged_in' => 'pg',
       'name' => 'abc'
@@ -2020,18 +2017,11 @@
       'name' => 'codeidx'
     },
     'cp' => {
-      'contained_indices' => {
-        'cp' => 1
-      },
       'in_code' => 1,
       'merged_in' => 'fn',
       'name' => 'cp'
     },
     'defg' => {
-      'contained_indices' => {
-        'abc' => 1,
-        'defg' => 1
-      },
       'in_code' => 0,
       'merged_in' => 'pg',
       'name' => 'defg'
@@ -2046,9 +2036,6 @@
       'name' => 'fn'
     },
     'ky' => {
-      'contained_indices' => {
-        'ky' => 1
-      },
       'in_code' => 1,
       'merged_in' => 'pg',
       'name' => 'ky'
@@ -2071,9 +2058,6 @@
       'name' => 'tp'
     },
     'truc' => {
-      'contained_indices' => {
-        'truc' => 1
-      },
       'in_code' => 0,
       'merged_in' => 'fn',
       'name' => 'truc'

Modified: 
trunk/tp/t/results/indices/default_cp_index_and_one_letter_syncodeindex.pl
===================================================================
--- trunk/tp/t/results/indices/default_cp_index_and_one_letter_syncodeindex.pl  
2016-09-21 12:21:55 UTC (rev 7401)
+++ trunk/tp/t/results/indices/default_cp_index_and_one_letter_syncodeindex.pl  
2016-09-21 13:52:27 UTC (rev 7402)
@@ -376,9 +376,6 @@
 $result_indices{'default_cp_index_and_one_letter_syncodeindex'} = {
   'index_names' => {
     'cp' => {
-      'contained_indices' => {
-        'cp' => 1
-      },
       'in_code' => 1,
       'merged_in' => 'fn',
       'name' => 'cp'

Modified: trunk/tp/t/results/indices/double_syncodeindex.pl
===================================================================
--- trunk/tp/t/results/indices/double_syncodeindex.pl   2016-09-21 12:21:55 UTC 
(rev 7401)
+++ trunk/tp/t/results/indices/double_syncodeindex.pl   2016-09-21 13:52:27 UTC 
(rev 7402)
@@ -486,9 +486,6 @@
 $result_indices{'double_syncodeindex'} = {
   'index_names' => {
     'cp' => {
-      'contained_indices' => {
-        'cp' => 1
-      },
       'in_code' => 1,
       'merged_in' => 'fn',
       'name' => 'cp'

Modified: trunk/tp/t/results/indices/print_merged_index.pl
===================================================================
--- trunk/tp/t/results/indices/print_merged_index.pl    2016-09-21 12:21:55 UTC 
(rev 7401)
+++ trunk/tp/t/results/indices/print_merged_index.pl    2016-09-21 13:52:27 UTC 
(rev 7402)
@@ -226,9 +226,6 @@
       'name' => 'cp'
     },
     'fn' => {
-      'contained_indices' => {
-        'fn' => 1
-      },
       'in_code' => 1,
       'merged_in' => 'cp',
       'name' => 'fn'

Modified: trunk/tp/t/results/indices/recursive_synindex.pl
===================================================================
--- trunk/tp/t/results/indices/recursive_synindex.pl    2016-09-21 12:21:55 UTC 
(rev 7401)
+++ trunk/tp/t/results/indices/recursive_synindex.pl    2016-09-21 13:52:27 UTC 
(rev 7402)
@@ -218,9 +218,6 @@
 $result_indices{'recursive_synindex'} = {
   'index_names' => {
     'aaa' => {
-      'contained_indices' => {
-        'aaa' => 1
-      },
       'in_code' => 0,
       'merged_in' => 'bbb',
       'name' => 'aaa'

Modified: trunk/tp/t/results/indices/same_index_entry_merged_indices.pl
===================================================================
--- trunk/tp/t/results/indices/same_index_entry_merged_indices.pl       
2016-09-21 12:21:55 UTC (rev 7401)
+++ trunk/tp/t/results/indices/same_index_entry_merged_indices.pl       
2016-09-21 13:52:27 UTC (rev 7402)
@@ -762,9 +762,6 @@
       'name' => 'tp'
     },
     'vr' => {
-      'contained_indices' => {
-        'vr' => 1
-      },
       'in_code' => 1,
       'merged_in' => 'fn',
       'name' => 'vr'

Modified: trunk/tp/t/results/indices/syncode_index_print_both.pl
===================================================================
--- trunk/tp/t/results/indices/syncode_index_print_both.pl      2016-09-21 
12:21:55 UTC (rev 7401)
+++ trunk/tp/t/results/indices/syncode_index_print_both.pl      2016-09-21 
13:52:27 UTC (rev 7402)
@@ -519,9 +519,6 @@
       'name' => 'cp'
     },
     'fn' => {
-      'contained_indices' => {
-        'fn' => 1
-      },
       'in_code' => 1,
       'merged_in' => 'cp',
       'name' => 'fn'

Modified: trunk/tp/t/results/indices/syncodeindex_to_plain.pl
===================================================================
--- trunk/tp/t/results/indices/syncodeindex_to_plain.pl 2016-09-21 12:21:55 UTC 
(rev 7401)
+++ trunk/tp/t/results/indices/syncodeindex_to_plain.pl 2016-09-21 13:52:27 UTC 
(rev 7402)
@@ -547,9 +547,6 @@
       'name' => 'fn'
     },
     'ky' => {
-      'contained_indices' => {
-        'ky' => 1
-      },
       'in_code' => 1,
       'merged_in' => 'cp',
       'name' => 'ky'

Modified: trunk/tp/t/results/info_tests/colon_in_index_entry.pl
===================================================================
--- trunk/tp/t/results/info_tests/colon_in_index_entry.pl       2016-09-21 
12:21:55 UTC (rev 7401)
+++ trunk/tp/t/results/info_tests/colon_in_index_entry.pl       2016-09-21 
13:52:27 UTC (rev 7402)
@@ -939,9 +939,6 @@
       'name' => 'tp'
     },
     'vr' => {
-      'contained_indices' => {
-        'vr' => 1
-      },
       'in_code' => 0,
       'merged_in' => 'cp',
       'name' => 'vr'

Modified: trunk/tp/t/results/macro/macro_in_index_commands.pl
===================================================================
--- trunk/tp/t/results/macro/macro_in_index_commands.pl 2016-09-21 12:21:55 UTC 
(rev 7401)
+++ trunk/tp/t/results/macro/macro_in_index_commands.pl 2016-09-21 13:52:27 UTC 
(rev 7402)
@@ -1340,9 +1340,6 @@
       'name' => 'codeidx'
     },
     'cp' => {
-      'contained_indices' => {
-        'cp' => 1
-      },
       'in_code' => 1,
       'merged_in' => 'fn',
       'name' => 'cp'

Modified: trunk/tp/t/results/value/value_in_index_commands.pl
===================================================================
--- trunk/tp/t/results/value/value_in_index_commands.pl 2016-09-21 12:21:55 UTC 
(rev 7401)
+++ trunk/tp/t/results/value/value_in_index_commands.pl 2016-09-21 13:52:27 UTC 
(rev 7402)
@@ -1167,9 +1167,6 @@
       'name' => 'codeidx'
     },
     'cp' => {
-      'contained_indices' => {
-        'cp' => 1
-      },
       'in_code' => 1,
       'merged_in' => 'fn',
       'name' => 'cp'




reply via email to

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