texinfo-commits
[Top][All Lists]
Advanced

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

[8212] remove FIX_TEXINFO


From: gavinsmith0123
Subject: [8212] remove FIX_TEXINFO
Date: Sun, 23 Sep 2018 07:38:35 -0400 (EDT)

Revision: 8212
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8212
Author:   gavin
Date:     2018-09-23 07:38:35 -0400 (Sun, 23 Sep 2018)
Log Message:
-----------
remove FIX_TEXINFO

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

Removed Paths:
-------------
    trunk/tp/t/fix_texinfo.t

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2018-09-23 10:40:27 UTC (rev 8211)
+++ trunk/ChangeLog     2018-09-23 11:38:35 UTC (rev 8212)
@@ -1,3 +1,16 @@
+2018-09-23  Gavin Smith  <address@hidden>
+
+       * tp/Texinfo/Convert/PlainTexinfo.pm: Do not pass a 
+       'FIX_TEXINFO' value into Texinfo.pm.
+       * tp/Texinfo/Convert/Texinfo.pm (convert, _expand_cmd_args_to_texi):
+       Remove '$fix' argument.
+       * tp/t/fix_texinfo.t: Remove test.
+
+       * doc/texinfo.texi (Other Customization Variables): Remove 
+       'FIX_TEXINFO'.
+
+       * NEWS: 'FIX_TEXINFO' customization variable has been removed.
+
 2018-09-22  Gavin Smith  <address@hidden>
 
        * tp/Texinfo/Parser.pm (_end_line): Reparent an empty argument 

Modified: trunk/tp/Texinfo/Convert/PlainTexinfo.pm
===================================================================
--- trunk/tp/Texinfo/Convert/PlainTexinfo.pm    2018-09-23 10:40:27 UTC (rev 
8211)
+++ trunk/tp/Texinfo/Convert/PlainTexinfo.pm    2018-09-23 11:38:35 UTC (rev 
8212)
@@ -63,8 +63,7 @@
   my $self = shift;
   my $root = shift;
   
-  return Texinfo::Convert::Texinfo::convert($root, 
-                                            $self->get_conf('FIX_TEXINFO'));
+  return Texinfo::Convert::Texinfo::convert($root);
 }
 
 1;

Modified: trunk/tp/Texinfo/Convert/Texinfo.pm
===================================================================
--- trunk/tp/Texinfo/Convert/Texinfo.pm 2018-09-23 10:40:27 UTC (rev 8211)
+++ trunk/tp/Texinfo/Convert/Texinfo.pm 2018-09-23 11:38:35 UTC (rev 8212)
@@ -61,17 +61,14 @@
   $ignored_types{$a} = 1;
 }
 
-sub convert ($;$);
 # Following subroutines deal with transforming a texinfo tree into texinfo
 # text.  Should give the text that was used parsed, except for a few cases.
-# Second argument is undocumented for now, as it may change, for instance
-# become a hash if more has to be given.
 
 # expand a tree to the corresponding texinfo.
-sub convert ($;$)
+sub convert
 {
   my $root = shift;
-  my $fix = shift;
+
   die "convert: root undef\n" if (!defined($root));
   die "convert: bad root type (".ref($root).") $root\n" 
      if (ref($root) ne 'HASH');
@@ -82,14 +79,11 @@
   if (defined($root->{'text'})) {
     $result .= $root->{'text'};
   } else {
-    if ($fix and $root->{'extra'} and $root->{'extra'}->{'invalid_nesting'}) {
-      return '';
-    }
     if ($root->{'cmdname'} 
        or ($root->{'type'} and ($root->{'type'} eq 'def_line'
                                 or $root->{'type'} eq 'menu_entry'
                                 or $root->{'type'} eq 'menu_comment'))) {
-      $result .= _expand_cmd_args_to_texi($root, $fix);
+      $result .= _expand_cmd_args_to_texi($root);
     }
     if ($root->{'type'}
         and ($root->{'type'} eq 'bracketed'
@@ -104,7 +98,7 @@
       die "bad contents type(" . ref($root->{'contents'})
           . ") $root->{'contents'}\n" if (ref($root->{'contents'}) ne 'ARRAY');
       foreach my $child (@{$root->{'contents'}}) {
-        $result .= convert($child, $fix);
+        $result .= convert($child);
       }
     }
     if ($root->{'extra'}
@@ -114,9 +108,8 @@
     $result .= '}' if ($root->{'type'}
                        and ($root->{'type'} eq 'bracketed'
                             or $root->{'type'} eq 'bracketed_def_content'));
-    if ($root->{'cmdname'} and (defined($block_commands{$root->{'cmdname'}}))
-        and ($block_commands{$root->{'cmdname'}} eq 'raw' 
-          or ($fix and !($root->{'extra'} and 
$root->{'extra'}->{'end_command'})))) {
+    if ($root->{'cmdname'} and defined($block_commands{$root->{'cmdname'}})
+        and $block_commands{$root->{'cmdname'}} eq 'raw') {
       $result .= '@end '.$root->{'cmdname'};
       $result .= "\n" if ($block_commands{$root->{'cmdname'}} ne 'raw');
     } 
@@ -142,9 +135,9 @@
 
 
 # expand a command argument as texinfo.
-sub _expand_cmd_args_to_texi ($;$) {
+sub _expand_cmd_args_to_texi {
   my $cmd = shift;
-  my $fix = shift;
+
   my $cmdname = $cmd->{'cmdname'};
   $cmdname = '' if (!$cmd->{'cmdname'}); 
   my $result = '';
@@ -163,7 +156,7 @@
      $result .= $cmd->{'extra'}->{'spaces_before_argument'}
        if $cmd->{'extra'} and $cmd->{'extra'}->{'spaces_before_argument'};
      foreach my $arg (@{$cmd->{'args'}}) {
-        $result .= convert($arg, $fix);
+        $result .= convert($arg);
     }
   # for misc_commands with type special
   } elsif (($cmd->{'extra'} or $cmdname eq 'macro' or $cmdname eq 'rmacro') 
@@ -180,13 +173,10 @@
       if ($arg->{'extra'} and $arg->{'extra'}->{'spaces_before_argument'}) {
         $result .= $arg->{'extra'}->{'spaces_before_argument'};
       }
-      $result .= convert($arg, $fix);
+      $result .= convert($arg);
       $result .= ',';
     }
     $result =~ s/,$//;
-  } elsif ($fix and $misc_commands{$cmdname}
-      and $misc_commands{$cmdname} eq 'skipline') {
-    $result .="\n";
   } elsif (defined($cmd->{'args'})) {
     my $braces;
     $braces = 1 if ($cmd->{'args'}->[0]->{'type'} 
@@ -210,7 +200,7 @@
       if ($arg->{'extra'} and $arg->{'extra'}->{'spaces_before_argument'}) {
         $result .= $arg->{'extra'}->{'spaces_before_argument'};
       }
-      $result .= convert($arg, $fix);
+      $result .= convert($arg);
     }
     if ($cmdname eq 'verb') {
       $result .= $cmd->{'extra'}->{'delimiter'};
@@ -222,7 +212,7 @@
       if $cmd->{'extra'} and $cmd->{'extra'}->{'spaces_before_argument'};
   }
   $result .= '{'.$cmd->{'type'}.'}' if ($cmdname eq 'value');
-  $result .= convert($cmd->{'extra'}->{'comment_at_end'}, $fix)
+  $result .= convert($cmd->{'extra'}->{'comment_at_end'})
      if $cmd->{'extra'} and $cmd->{'extra'}->{'comment_at_end'};
   return $result;
 }

Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm  2018-09-23 10:40:27 UTC (rev 8211)
+++ trunk/tp/Texinfo/Parser.pm  2018-09-23 11:38:35 UTC (rev 8212)
@@ -6811,11 +6811,6 @@
 Also filled for C<@set>, C<@clickstyle>, C<@unmacro> or C<@comment>
 arguments.
 
-=item spaces_after_command
-
-For @-commands followed by spaces, a reference to the corresponding
-text element.
-
 =item spaces_before_argument
 
 For @-commands with opening brace followed by spaces held in a 

Deleted: trunk/tp/t/fix_texinfo.t
===================================================================
--- trunk/tp/t/fix_texinfo.t    2018-09-23 10:40:27 UTC (rev 8211)
+++ trunk/tp/t/fix_texinfo.t    2018-09-23 11:38:35 UTC (rev 8212)
@@ -1,45 +0,0 @@
-use strict;
-
-use lib '.';
-use Texinfo::ModulePath (undef, undef, 'updirs' => 2);
-
-use Test::More;
-
-BEGIN { plan tests => 4; }
-
-use Texinfo::Parser;
-use Texinfo::Convert::Texinfo;
-
-
-sub run_test($$$)
-{
-  my $in = shift;
-  my $out = shift;
-  my $name = shift;
-
-  my $tree = Texinfo::Parser::parse_texi_text (undef, $in);
-  my $result = Texinfo::Convert::Texinfo::convert($tree, 1);
-    if (defined($out)) {
-    is ($result, $out, $name);
-  } else {
-    print "$name:\n";
-    print STDERR $result;
-  }
-}
-
-run_test ('@deffn a b c d ', '@deffn a b c d @end deffn'."\n", 
-          'deffn line not closed');
-
-run_test ('address@hidden
address@hidden @asis
address@hidden it
address@hidden table
-}', 'address@hidden
-}', 'table in code');
-
-run_test ('@address@hidden', '@anchor{}', 'ref in anchor');
-
-run_test ('@page on page line
-', 
-'@page
-', 'garbage on page line');




reply via email to

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