texinfo-commits
[Top][All Lists]
Advanced

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

[8168] small changes


From: gavinsmith0123
Subject: [8168] small changes
Date: Sat, 15 Sep 2018 10:15:01 -0400 (EDT)

Revision: 8168
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8168
Author:   gavin
Date:     2018-09-15 10:15:00 -0400 (Sat, 15 Sep 2018)
Log Message:
-----------
small changes

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Convert/TexinfoXML.pm
    trunk/tp/Texinfo/Parser.pm

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2018-09-15 14:00:13 UTC (rev 8167)
+++ trunk/ChangeLog     2018-09-15 14:15:00 UTC (rev 8168)
@@ -1,5 +1,15 @@
 2018-09-15  Gavin Smith  <address@hidden>
 
+       * tp/Texinfo/Parser.pm (_isolate_last_space): Remove useless 
+       argument.  Callers updated.
+       (module documentation section): Remove mention of 
+       'space_at_end_block_command'.
+       * tp/Texinfo/Convert/TexinfoXML.pm (_index_entry): Remove code 
+       stripping final whitespace.
+       (_convert): Remove a commented-out statement for debugging.
+
+2018-09-15  Gavin Smith  <address@hidden>
+
        * tp/Texinfo/Parser.pm (_isolate_last_space): For all element
        types except 'menu_entry_node', store trailing spaces as a 
        'spaces_after_argument' value.  This was already done for

Modified: trunk/tp/Texinfo/Convert/TexinfoXML.pm
===================================================================
--- trunk/tp/Texinfo/Convert/TexinfoXML.pm      2018-09-15 14:00:13 UTC (rev 
8167)
+++ trunk/tp/Texinfo/Convert/TexinfoXML.pm      2018-09-15 14:15:00 UTC (rev 
8168)
@@ -521,7 +521,6 @@
     $self->{'document_context'}->[-1]->{'monospace'}->[-1] = 1
       if ($index_entry->{'in_code'});
     $result .= $self->_convert({'contents' => $index_entry->{'content'}});
-    $result =~ s/\s*$//;
     pop @{$self->{'document_context'}};
     $result .= $self->close_element('indexterm');
     return $result;
@@ -1008,7 +1007,6 @@
             and !($root->{'parent'}->{'extra'}
                   and ($root->{'parent'}->{'extra'}->{'no_section'}
                        or $root->{'parent'}->{'extra'}->{'no_node'}))) {
-          #print STDERR "$root->{'parent'} $root->{'parent'}->{'type'}\n";
           $self->{'pending_bye'} = $self->open_element($command)
                     .$self->close_element($command)."\n";
           return '';

Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm  2018-09-15 14:00:13 UTC (rev 8167)
+++ trunk/tp/Texinfo/Parser.pm  2018-09-15 14:15:00 UTC (rev 8168)
@@ -2181,13 +2181,10 @@
 }
 
 # isolate last space in a command to help expansion disregard unuseful spaces.
-sub _isolate_last_space($$;$)
+sub _isolate_last_space
 {
-  my ($self, $current, $type) = @_;
+  my ($self, $current) = @_;
 
-  my $end_spaces;
-  $type = 'spaces_at_end' if (!defined($type));
-
   return if (!$current->{'contents'} or address@hidden>{'contents'}});
 
   # Store a final comment command in the 'extra' hash.
@@ -2209,9 +2206,8 @@
         $current->{'contents'}->[-1]->{'type'} = 'space_at_end_menu_node';
       } else {
         $current->{'contents'}->[-1]->{'text'} =~ s/(\s+)$//;
-        $end_spaces = $1;
-        my $new_spaces = { 'text' => $end_spaces, 'parent' => $current,
-          'type' => $type };
+        my $new_spaces = { 'text' => $1, 'parent' => $current,
+          'type' => 'space_at_end_menu_node' };
         push @{$current->{'contents'}}, $new_spaces;
       }
     }
@@ -2220,18 +2216,17 @@
       and $current->{'contents'}->[-1]->{'text'} =~ /\s+$/) {
     # Store final spaces in 'spaces_after_argument'.
     if ($current->{'contents'}->[-1]->{'text'} !~ /\S/) {
-      $end_spaces = $current->{'contents'}->[-1]->{'text'};
+      my $end_spaces = $current->{'contents'}->[-1]->{'text'};
       pop @{$current->{'contents'}};
       $current->{'extra'}->{'spaces_after_argument'} = $end_spaces;
     } else {
       $current->{'contents'}->[-1]->{'text'} =~ s/(\s+)$//;
-      $end_spaces = $1;
       $current->{'extra'}->{'spaces_after_argument'} = $1;
     }
   }
 }
 
-# $NODE->{'contents'} is the Texinfo fo the specification of a node.
+# $NODE->{'contents'} is the Texinfo for the specification of a node.
 # Returned object is a hash with two fields:
 #
 #     manual_content - Texinfo tree for a manual name extracted from the
@@ -2878,7 +2873,7 @@
       _isolate_last_space($self, $current);
 
     } else {
-      _isolate_last_space($self, $current, 'space_at_end_block_command');
+      _isolate_last_space($self, $current);
       _register_command_arg($self, $current, 'block_command_line_contents');
     } 
     # @float args
@@ -3500,7 +3495,7 @@
           Texinfo::Convert::Texinfo::convert($current)), $line_nr);
       }
     } elsif ($arg->{'type'} eq 'menu_entry_node') {
-      _isolate_last_space($self, $arg, 'space_at_end_menu_node');
+      _isolate_last_space($self, $arg);
       my $parsed_entry_node = _parse_node_manual($arg);
       if (! defined($parsed_entry_node)) {
         if ($self->{'SHOW_MENU'}) {
@@ -6615,10 +6610,6 @@
 comma-separated argument for some brace commands, or at the end of
 bracketed content on a C<@multitable> line or definition line.
 
-=item space_at_end_block_command
-
-Space at the end of a block @-command line.
-
 =item empty_spaces_after_close_brace
 
 Spaces appearing after a closing brace, for some rare commands for which




reply via email to

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