texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp Texinfo/Convert/Plaintext.pm t/resul...


From: Patrice Dumas
Subject: texinfo/tp Texinfo/Convert/Plaintext.pm t/resul...
Date: Sun, 21 Nov 2010 20:18:55 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        10/11/21 20:18:54

Modified files:
        tp/Texinfo/Convert: Plaintext.pm 
        tp/t/results/coverage_braces: nested_args.pl 

Log message:
        Handle @*ref.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/coverage_braces/nested_args.pl?cvsroot=texinfo&r1=1.14&r2=1.15

Patches:
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- Texinfo/Convert/Plaintext.pm        21 Nov 2010 19:18:35 -0000      1.13
+++ Texinfo/Convert/Plaintext.pm        21 Nov 2010 20:18:54 -0000      1.14
@@ -602,7 +602,48 @@
     } elsif ($command eq 'anchor') {
       # TODO
     } elsif ($ref_commands{$command}) {
-      # TODO
+      if ($root->{'extra'} and $root->{'extra'}->{'brace_command_contents'}
+          and scalar(@{$root->{'extra'}->{'brace_command_contents'}})) {
+        my @args = @{$root->{'extra'}->{'brace_command_contents'}};
+        $args[0] = [{'text' => ''}] if (!defined($args[0]));
+        if ($command eq 'inforef' and scalar(@args) == 3) {
+          $args[3] = $args[2];
+          $args[2] = undef;
+        }
+        my @contents;
+        if ($command eq 'xref') {
+          $contents[0] = {'text' => '*Note '};
+        } else {
+          $contents[0] = {'text' => '*note '};
+        }
+        my $name;
+        if (defined($args[1])) {
+          $name = $args[1];
+        } elsif (defined($args[2])) {
+          $name = $args[2];
+        }
+        my $file;
+        if (defined($args[3])) {
+          $file = [{'text' => '('},
+                   {'type' => 'code',
+                    'contents' => address@hidden,
+                   {'text' => ')'},];
+        } elsif (defined($args[4])) {
+          $file = [{'text' => '()'}];
+        }
+        if ($name) {
+          push @contents, (@$name, {'text' => ': '});
+          if ($file) {
+            push @contents, @$file;
+          }
+          push @contents, ({'type' => 'code',
+                            'contents' => address@hidden);
+          push @contents, {'text' => '.'} if ($command eq 'pxref');
+        } else {
+          push @contents, (@{$args[0]}, {'text' => '::'});
+        }
+        unshift @{$self->{'current_contents'}->[-1]}, @contents;
+      }
     } elsif ($explained_commands{$command}) {
       my @contents;
       if ($root->{'extra'} and $root->{'extra'}->{'brace_command_contents'}

Index: t/results/coverage_braces/nested_args.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/coverage_braces/nested_args.pl,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- t/results/coverage_braces/nested_args.pl    20 Nov 2010 16:58:04 -0000      
1.14
+++ t/results/coverage_braces/nested_args.pl    21 Nov 2010 20:18:54 -0000      
1.15
@@ -122,4 +122,8 @@
 $result_errors{'nested_args'} = [];
 
 
+
+$result_converted{'plaintext'}->{'nested_args'} = '*Note descr in b: @ `in 
samp\'
+';
+
 1;



reply via email to

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