texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp TODO Texinfo/Parser.pm t/08misc_comm...


From: Patrice Dumas
Subject: texinfo/tp TODO Texinfo/Parser.pm t/08misc_comm...
Date: Sat, 07 Jan 2012 12:12:05 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        12/01/07 12:12:05

Modified files:
        tp             : TODO 
        tp/Texinfo     : Parser.pm 
        tp/t           : 08misc_commands.t 80include.t 
        tp/t/results/include: include_with_setfilename.pl 
        tp/t/results/misc_commands: setfilename.pl 

Log message:
        Improve @setfilename tests.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.239&r2=1.240
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.350&r2=1.351
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/08misc_commands.t?cvsroot=texinfo&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/80include.t?cvsroot=texinfo&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/include/include_with_setfilename.pl?cvsroot=texinfo&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/misc_commands/setfilename.pl?cvsroot=texinfo&r1=1.19&r2=1.20

Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.239
retrieving revision 1.240
diff -u -b -r1.239 -r1.240
--- TODO        7 Jan 2012 09:43:02 -0000       1.239
+++ TODO        7 Jan 2012 12:12:04 -0000       1.240
@@ -98,6 +98,8 @@
 'sourcemark'?
 
 In a similar way, keep the information about aliases in the tree?
+And about @setfilename in included files which is for now completly
+removed (consistently with documentation).
 
 Right now VERBOSE is almost not used.
 

Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.350
retrieving revision 1.351
diff -u -b -r1.350 -r1.351
--- Texinfo/Parser.pm   7 Jan 2012 09:43:02 -0000       1.350
+++ Texinfo/Parser.pm   7 Jan 2012 12:12:04 -0000       1.351
@@ -948,7 +948,10 @@
     push @{$self->{'extra'}->{$command}}, $current;
     return 1;
   } elsif ($global_unique_commands{$command}) {
-    if (exists ($self->{'extra'}->{$current->{'cmdname'}})) {
+    # setfilename ignored in an included file
+    if ($command eq 'setfilename'
+        and scalar(@{$self->{'input'}}) > 1) {
+    } elsif (exists ($self->{'extra'}->{$current->{'cmdname'}})) {
       $self->line_warn (sprintf($self->__('Multiple @%s'), 
         $current->{'cmdname'}), $line_nr); 
     } else {
@@ -2993,6 +2996,7 @@
     # Also ignore @setfilename in included file, as said in the manual.
     if ($included_file or ($command eq 'setfilename'
                            and scalar(@{$self->{'input'}}) > 1)) {
+      # keep the information with sourcemark
       pop @{$current->{'contents'}};
     # columnfractions 
     } elsif ($command eq 'setfilename'

Index: t/08misc_commands.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/08misc_commands.t,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- t/08misc_commands.t 28 Sep 2011 21:44:21 -0000      1.25
+++ t/08misc_commands.t 7 Jan 2012 12:12:04 -0000       1.26
@@ -91,13 +91,6 @@
 
 A @click{} (result).
 '],
-['setfilename',
-'@setfilename address@hidden comment
address@hidden file_and_spaces   
address@hidden file_space_comment @c comment
address@hidden @ @verb{: name :}@ 
-
-', {'test_formats' => ['xml']}],
 ['bye',
 '@bye
 '],
@@ -231,6 +224,13 @@
 );
 
 my @converted_test_cases = (
+['setfilename',
+'@setfilename address@hidden comment
address@hidden file_and_spaces   
address@hidden file_space_comment @c comment
address@hidden @ @verb{: name :}@ 
+
+'],
 ['definfoenclose',
 '
 definfoenclose phoo,//,\\  @definfoenclose phoo,//,\\
@@ -443,6 +443,7 @@
 
 my %info_tests = (
   'comment_space_command_on_line' => 1,
+  'setfilename' => 1,
 );
 
 my %xml_tests = (

Index: t/80include.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/80include.t,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- t/80include.t       27 Oct 2011 19:17:05 -0000      1.9
+++ t/80include.t       7 Jan 2012 12:12:04 -0000       1.10
@@ -73,6 +73,7 @@
 address@hidden@}
 @end-file-name{info}
 '],
+# the difference with the previous is that there are @-commands, like @@
 ['macro_and_commands_in_early_commands',
 '@macro begin-file
 macro_i--n_pass@@
@@ -124,8 +125,11 @@
 
 After.'],
 ['include_with_setfilename',
+# for now the plaintext expansion do not test anything as the setfilename in
+# included files is removed from the tree.  But this may change in the future.
 '@include included_file_with_setfilename.texi 
-'],
address@hidden main_file.info
+', {'test_formats' => ['info']}],
 ['include_setfilename_on_setfilename_line',
 '@setfilename file @setfilename other file @include are you joking!
 '],

Index: t/results/include/include_with_setfilename.pl
===================================================================
RCS file: 
/sources/texinfo/texinfo/tp/t/results/include/include_with_setfilename.pl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- t/results/include/include_with_setfilename.pl       3 Jul 2011 14:50:56 
-0000       1.10
+++ t/results/include/include_with_setfilename.pl       7 Jan 2012 12:12:04 
-0000       1.11
@@ -23,6 +23,44 @@
       ],
       'parent' => {},
       'type' => 'paragraph'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'extra' => {
+                'command' => {}
+              },
+              'parent' => {},
+              'text' => ' ',
+              'type' => 'empty_spaces_after_command'
+            },
+            {
+              'parent' => {},
+              'text' => 'main_file.info'
+            },
+            {
+              'parent' => {},
+              'text' => '
+',
+              'type' => 'spaces_at_end'
+            }
+          ],
+          'parent' => {},
+          'type' => 'misc_line_arg'
+        }
+      ],
+      'cmdname' => 'setfilename',
+      'extra' => {
+        'text_arg' => 'main_file.info'
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 2,
+        'macro' => ''
+      },
+      'parent' => {}
     }
   ],
   'type' => 'text_root'
@@ -30,9 +68,16 @@
 $result_trees{'include_with_setfilename'}{'contents'}[0]{'parent'} = 
$result_trees{'include_with_setfilename'};
 
$result_trees{'include_with_setfilename'}{'contents'}[1]{'contents'}[0]{'parent'}
 = $result_trees{'include_with_setfilename'}{'contents'}[1];
 $result_trees{'include_with_setfilename'}{'contents'}[1]{'parent'} = 
$result_trees{'include_with_setfilename'};
+$result_trees{'include_with_setfilename'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
 = $result_trees{'include_with_setfilename'}{'contents'}[2];
+$result_trees{'include_with_setfilename'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'include_with_setfilename'}{'contents'}[2]{'args'}[0];
+$result_trees{'include_with_setfilename'}{'contents'}[2]{'args'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'include_with_setfilename'}{'contents'}[2]{'args'}[0];
+$result_trees{'include_with_setfilename'}{'contents'}[2]{'args'}[0]{'contents'}[2]{'parent'}
 = $result_trees{'include_with_setfilename'}{'contents'}[2]{'args'}[0];
+$result_trees{'include_with_setfilename'}{'contents'}[2]{'args'}[0]{'parent'} 
= $result_trees{'include_with_setfilename'}{'contents'}[2];
+$result_trees{'include_with_setfilename'}{'contents'}[2]{'parent'} = 
$result_trees{'include_with_setfilename'};
 
 $result_texis{'include_with_setfilename'} = '
 In included file.
address@hidden main_file.info
 ';
 
 
@@ -43,4 +88,25 @@
 $result_errors{'include_with_setfilename'} = [];
 
 
+
+$result_converted{'info'}->{'include_with_setfilename'} = 'This is 
main_file.info, produced by tp version from .
+
+In included file.
+
+
+Tag Table:
+
+End Tag Table
+';
+
+$result_converted_errors{'info'}->{'include_with_setfilename'} = [
+  {
+    'error_line' => 'warning: Document without nodes.
+',
+    'text' => 'Document without nodes.',
+    'type' => 'warning'
+  }
+];
+
+
 1;

Index: t/results/misc_commands/setfilename.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/misc_commands/setfilename.pl,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- t/results/misc_commands/setfilename.pl      17 Sep 2011 21:24:00 -0000      
1.19
+++ t/results/misc_commands/setfilename.pl      7 Jan 2012 12:12:04 -0000       
1.20
@@ -286,6 +286,33 @@
 
 
 
+$result_converted{'plaintext'}->{'setfilename'} = '';
+
+
+$result_converted{'html_text'}->{'setfilename'} = '
+';
+
+
+$result_converted{'info'}->{'setfilename'} = 'This is file_comment, produced 
by tp version from .
+
+
+
+Tag Table:
+
+End Tag Table
+';
+
+$result_converted_errors{'info'}->{'setfilename'} = [
+  {
+    'error_line' => 'warning: Document without nodes.
+',
+    'text' => 'Document without nodes.',
+    'type' => 'warning'
+  }
+];
+
+
+
 $result_converted{'xml'}->{'setfilename'} = '<setfilename 
file="file_comment">file_comment</setfilename><!-- comment -->
 <setfilename file="file_and_spaces">file_and_spaces   </setfilename>
 <setfilename file="file_space_comment">file_space_comment </setfilename><!-- 
comment -->



reply via email to

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