texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/DebugTexinfo/DebugTree.pm, tp/init/highlight


From: Patrice Dumas
Subject: branch master updated: * tp/DebugTexinfo/DebugTree.pm, tp/init/highlight_syntax.pm, tp/init/latex2html.pm, tp/init/tex4ht.pm: rename $root as $element if not a root element.
Date: Wed, 08 Sep 2021 10:59:10 -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 71e03b7  * tp/DebugTexinfo/DebugTree.pm, tp/init/highlight_syntax.pm, 
tp/init/latex2html.pm, tp/init/tex4ht.pm: rename $root as $element if not a 
root element.
71e03b7 is described below

commit 71e03b7a314334471cd09c6b88418a8c2796bb01
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Sep 8 16:59:02 2021 +0200

    * tp/DebugTexinfo/DebugTree.pm, tp/init/highlight_syntax.pm,
    tp/init/latex2html.pm, tp/init/tex4ht.pm: rename $root as
    $element if not a root element.
---
 ChangeLog                    |  6 ++++++
 tp/DebugTexinfo/DebugTree.pm | 22 +++++++++++-----------
 tp/init/highlight_syntax.pm  | 26 +++++++++++++-------------
 tp/init/latex2html.pm        | 10 +++++-----
 tp/init/tex4ht.pm            | 16 ++++++++--------
 5 files changed, 43 insertions(+), 37 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3bc6e3d..75e7991 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2021-09-08  Patrice Dumas  <pertusus@free.fr>
 
+       * tp/DebugTexinfo/DebugTree.pm, tp/init/highlight_syntax.pm,
+       tp/init/latex2html.pm, tp/init/tex4ht.pm: rename $root as
+       $element if not a root element.
+
+2021-09-08  Patrice Dumas  <pertusus@free.fr>
+
        * tp/Texinfo/Convert/LaTeX.pm: rename $root as $element if not
        a root element.
 
diff --git a/tp/DebugTexinfo/DebugTree.pm b/tp/DebugTexinfo/DebugTree.pm
index 415cfc5..5ebc00a 100644
--- a/tp/DebugTexinfo/DebugTree.pm
+++ b/tp/DebugTexinfo/DebugTree.pm
@@ -119,7 +119,7 @@ sub _print_tree($$;$$);
 sub _print_tree($$;$$)
 {
   my $self = shift;
-  my $root = shift;
+  my $element = shift;
   my $level = shift;
   my $argument = shift;
   $level = 0 if (!defined($level));
@@ -129,27 +129,27 @@ sub _print_tree($$;$$)
     $result .= '%';
     $level++;
   }
-  if ($root->{'cmdname'}) {
-    $result .= "\@$root->{'cmdname'} ";
+  if ($element->{'cmdname'}) {
+    $result .= "\@$element->{'cmdname'} ";
   }
-  if (defined($root->{'type'})) {
-    $result .= "$root->{'type'} ";
+  if (defined($element->{'type'})) {
+    $result .= "$element->{'type'} ";
   }
-  if (defined($root->{'text'})) {
-    my $text = $root->{'text'};
+  if (defined($element->{'text'})) {
+    my $text = $element->{'text'};
     $text =~ s/\n/\\n/g;
     $text =~ s/\f/\\f/g;
     $text =~ s/\r/\\r/g;
     $result .= "|$text|";
   }
   $result .= "\n";
-  if ($root->{'args'}) {
-    foreach my $arg (@{$root->{'args'}}) {
+  if ($element->{'args'}) {
+    foreach my $arg (@{$element->{'args'}}) {
       $result .= _print_tree ($self, $arg, $level +1, 1);
     }
   }
-  if ($root->{'contents'}) {
-    foreach my $content (@{$root->{'contents'}}) {
+  if ($element->{'contents'}) {
+    foreach my $content (@{$element->{'contents'}}) {
       $result .= _print_tree ($self, $content, $level+1);
     }
   }
diff --git a/tp/init/highlight_syntax.pm b/tp/init/highlight_syntax.pm
index 7ef8ddc..1d1b80c 100644
--- a/tp/init/highlight_syntax.pm
+++ b/tp/init/highlight_syntax.pm
@@ -132,8 +132,8 @@ sub highlight_process($$)
   my $collected_commands = 
Texinfo::Common::collect_commands_in_tree($document_root, 
\@highlighted_commands);
   foreach my $cmdname (@highlighted_commands) {
     if (scalar(@{$collected_commands->{$cmdname}}) > 0) {
-      foreach my $root (@{$collected_commands->{$cmdname}}) {
-        my $language = _get_language($self, $cmdname, $root);
+      foreach my $element (@{$collected_commands->{$cmdname}}) {
+        my $language = _get_language($self, $cmdname, $element);
         if (defined($language)) {
           if (not exists($languages{$language})) {
             $languages{$language} = {
@@ -142,7 +142,7 @@ sub highlight_process($$)
           }
           $languages{$language}->{'counter'}++;
           my $counter = $languages{$language}->{'counter'};
-          $languages{$language}->{'commands'}->[$counter-1] = [$root, 
$cmdname];
+          $languages{$language}->{'commands'}->[$counter-1] = [$element, 
$cmdname];
           $commands{$cmdname}->{'input_counter'}++;
         }
       }
@@ -177,10 +177,10 @@ sub highlight_process($$)
     my $highlight_lang_in_line_nr = 2;
 
     my $counter = 0;
-    foreach my $root_command (@{$languages{$language}->{'commands'}}) {
+    foreach my $element_command (@{$languages{$language}->{'commands'}}) {
 
-      my $root = $root_command->[0];
-      my $tree = {'contents' => [@{$root->{'contents'}}]};
+      my $element = $element_command->[0];
+      my $tree = {'contents' => [@{$element->{'contents'}}]};
       if ($tree->{'contents'}->[0]
           and $tree->{'contents'}->[0]->{'type'}
           and $tree->{'contents'}->[0]->{'type'} eq 
'empty_line_after_command') {
@@ -241,10 +241,10 @@ sub highlight_process($$)
         $separators_count++;
         if (defined($text)) {
           $got_count++;
-          my $root_command = 
$languages{$language}->{'commands'}->[$got_count-1];
-          my $root = $root_command->[0];
-          my $command = $root_command->[1];
-          $commands{$command}->{'results'}->{$root} = $text;
+          my $element_command = 
$languages{$language}->{'commands'}->[$got_count-1];
+          my $element = $element_command->[0];
+          my $command = $element_command->[1];
+          $commands{$command}->{'results'}->{$element} = $text;
           $text = undef;
         }
         #print STDERR "$language $got_count $language_fragments_nr \n";
@@ -263,9 +263,9 @@ sub highlight_process($$)
                             $language, $separators_count, 
$language_fragments_nr+1));
     }
     if (defined($text) and $text ne '') {
-      my $root_command = $languages{$language}->{'commands'}->[$got_count-1];
-      my $root = $root_command->[0];
-      my $command = $root_command->[1];
+      my $element_command = 
$languages{$language}->{'commands'}->[$got_count-1];
+      my $element = $element_command->[0];
+      my $command = $element_command->[1];
       $self->document_warn($self, sprintf(__(
                  "highlight_syntax.pm: %s: end of \@%s item %d not found"),
                                   $language, $command, $got_count));
diff --git a/tp/init/latex2html.pm b/tp/init/latex2html.pm
index 92b35d7..f13433f 100644
--- a/tp/init/latex2html.pm
+++ b/tp/init/latex2html.pm
@@ -212,14 +212,14 @@ sub l2h_process($$)
                                         $document_root, \@replaced_commands);
   my $counter = 0;
   if (scalar(@{$collected_commands})) {
-    foreach my $root (@{$collected_commands}) {
-      my $command = $root->{'cmdname'};
+    foreach my $element (@{$collected_commands}) {
+      my $command = $element->{'cmdname'};
       $counter++;
       my $tree;
       if ($command eq 'math') {
-        $tree = $root->{'args'}->[0];
+        $tree = $element->{'args'}->[0];
       } else {
-        $tree = {'contents' => [@{$root->{'contents'}}]};
+        $tree = {'contents' => [@{$element->{'contents'}}]};
         if ($tree->{'contents'}->[0]
             and $tree->{'contents'}->[0]->{'type'}
             and $tree->{'contents'}->[0]->{'type'} eq 
'empty_line_after_command') {
@@ -232,7 +232,7 @@ sub l2h_process($$)
       }
       my $text = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
       l2h_to_latex($self, $command, $text, $counter);
-      $commands_counters{$root} = $counter;
+      $commands_counters{$element} = $counter;
     }
   }
   $status = l2h_finish_to_latex($self);
diff --git a/tp/init/tex4ht.pm b/tp/init/tex4ht.pm
index f0b86bc..6386c23 100644
--- a/tp/init/tex4ht.pm
+++ b/tp/init/tex4ht.pm
@@ -119,10 +119,10 @@ sub tex4ht_prepare($$)
   my $collected_commands = Texinfo::Common::collect_commands_list_in_tree(
                                         $document_root, \@replaced_commands);
   my %format_collected_commands = ();
-  foreach my $root (@{$collected_commands}) {
-    my $command = $root->{'cmdname'};
+  foreach my $element (@{$collected_commands}) {
+    my $command = $element->{'cmdname'};
     my $format = $commands{$command}->{'style'};
-    push @{$format_collected_commands{$format}}, $root;
+    push @{$format_collected_commands{$format}}, $element;
     $commands{$command}->{'counter'}++;
   }
 
@@ -165,15 +165,15 @@ sub tex4ht_prepare($$)
           print $fh "\\csname tex4ht\\endcsname\n";
         }
       }
-      foreach my $root (@{$format_collected_commands{$format}}) {
+      foreach my $element (@{$format_collected_commands{$format}}) {
         $formats{$format}->{'counter'}++;
         my $counter = $formats{$format}->{'counter'};
-        my $command = $root->{'cmdname'};
+        my $command = $element->{'cmdname'};
         my $tree;
         if ($command eq 'math') {
-          $tree = $root->{'args'}->[0];
+          $tree = $element->{'args'}->[0];
         } else {
-          $tree = {'contents' => [@{$root->{'contents'}}]};
+          $tree = {'contents' => [@{$element->{'contents'}}]};
           if ($tree->{'contents'}->[0]
               and $tree->{'contents'}->[0]->{'type'}
               and $tree->{'contents'}->[0]->{'type'} eq 
'empty_line_after_command') {
@@ -185,7 +185,7 @@ sub tex4ht_prepare($$)
           }
         }
         my $text = Texinfo::Convert::Texinfo::convert_to_texinfo($tree);
-        $formats{$format}->{'commands'}->[$counter-1] = $root;
+        $formats{$format}->{'commands'}->[$counter-1] = $element;
 
         # write to tex file
         my ($before_comment_open, $after_comment_open, $before_comment_close,



reply via email to

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