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 (_handle_brace_comman


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_handle_brace_command, _handle_open_brace): Duplicate 'source_info' hashes to avoid disparity with XS test results.
Date: Sun, 02 Apr 2023 07:31:42 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new a22a328c03 * tp/Texinfo/ParserNonXS.pm (_handle_brace_command, 
_handle_open_brace): Duplicate 'source_info' hashes to avoid disparity with XS 
test results.
a22a328c03 is described below

commit a22a328c0377e9d0c747b6c777d4b6a4d32bd4e6
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Apr 2 12:31:34 2023 +0100

    * tp/Texinfo/ParserNonXS.pm
    (_handle_brace_command, _handle_open_brace):
    Duplicate 'source_info' hashes to avoid disparity with XS test results.
---
 ChangeLog                                        | 6 ++++++
 tp/Texinfo/ParserNonXS.pm                        | 4 ++--
 tp/t/results/linemacro/nested_linemacro_calls.pl | 7 +++++--
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1327a558c0..0e95e15275 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-04-02  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/ParserNonXS.pm
+       (_handle_brace_command, _handle_open_brace):
+       Duplicate 'source_info' hashes to avoid disparity with XS test results.
+
 2023-04-02  Gavin Smith <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/Common.pm (_relate_index_entries_to_table_items_in):
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index bd5474e109..fe0fdc6e3a 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -5679,7 +5679,7 @@ sub _handle_brace_command($$$$)
      if ($self->{'DEBUG'});
 
   my $command_e = { 'cmdname' => $command, 'parent' => $current,};
-  $command_e->{'source_info'} = $source_info;
+  $command_e->{'source_info'} = {%{$source_info}};
   push @{$current->{'contents'}}, $command_e;
   if ($in_index_commands{$command}
       and !_is_index_element($self, $current->{'parent'})) {
@@ -5856,7 +5856,7 @@ sub _handle_open_brace($$$$)
     my $balanced_braces = {'type' => 'balanced_braces',
                            'contents' => [],
                            'parent' => $current,
-                           'source_info' => $source_info};
+                           'source_info' => {%{$source_info}}};
     push @{$current->{'contents'}}, $balanced_braces;
     $current = $balanced_braces;
     my $open_brace = {'text' => '{', 'parent' => $current};
diff --git a/tp/t/results/linemacro/nested_linemacro_calls.pl 
b/tp/t/results/linemacro/nested_linemacro_calls.pl
index 1ccd88ab8e..0fc191544e 100644
--- a/tp/t/results/linemacro/nested_linemacro_calls.pl
+++ b/tp/t/results/linemacro/nested_linemacro_calls.pl
@@ -336,7 +336,11 @@ $result_trees{'nested_linemacro_calls'} = {
                                         'text' => ' ( remaining, type typed )}'
                                       }
                                     ],
-                                    'source_info' => {},
+                                    'source_info' => {
+                                      'file_name' => '',
+                                      'line_nr' => 11,
+                                      'macro' => 'inside'
+                                    },
                                     'type' => 'balanced_braces'
                                   }
                                 ],
@@ -617,7 +621,6 @@ $result_trees{'nested_linemacro_calls'} = {
   ],
   'type' => 'document_root'
 };
-$result_trees{'nested_linemacro_calls'}{'contents'}[0]{'contents'}[4]{'contents'}[0]{'contents'}[0]{'source_marks'}[0]{'element'}{'args'}[0]{'contents'}[2]{'contents'}[2]{'source_info'}
 = 
$result_trees{'nested_linemacro_calls'}{'contents'}[0]{'contents'}[4]{'contents'}[0]{'contents'}[0]{'source_marks'}[0]{'element'}{'args'}[0]{'contents'}[2]{'contents'}[2]{'contents'}[1]{'source_info'};
 
$result_trees{'nested_linemacro_calls'}{'contents'}[0]{'contents'}[4]{'contents'}[1]{'extra'}{'def_index_element'}
 = 
$result_trees{'nested_linemacro_calls'}{'contents'}[0]{'contents'}[4]{'contents'}[1]{'args'}[0]{'contents'}[2];
 
 $result_texis{'nested_linemacro_calls'} = '@linemacro inside {a, b}



reply via email to

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