texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp Texinfo/Parser.pm Texinfo/Convert/Pl...


From: Patrice Dumas
Subject: texinfo/tp Texinfo/Parser.pm Texinfo/Convert/Pl...
Date: Sun, 06 Feb 2011 15:24:27 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/02/06 15:24:27

Modified files:
        tp/Texinfo     : Parser.pm 
        tp/Texinfo/Convert: Plaintext.pm 
        tp/t/results/coverage: arg_in_brace_no_arg_command.pl 

Log message:
        Warn for @-command without args with args.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.190&r2=1.191
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.70&r2=1.71
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/coverage/arg_in_brace_no_arg_command.pl?cvsroot=texinfo&r1=1.3&r2=1.4

Patches:
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.190
retrieving revision 1.191
diff -u -b -r1.190 -r1.191
--- Texinfo/Parser.pm   6 Feb 2011 10:06:59 -0000       1.190
+++ Texinfo/Parser.pm   6 Feb 2011 15:24:27 -0000       1.191
@@ -3605,6 +3605,12 @@
             my $closed_command = $current->{'parent'}->{'cmdname'};
             print STDERR "CLOSING address@hidden>{'parent'}->{'cmdname'}\n" if 
($self->{'DEBUG'});
             delete $current->{'parent'}->{'remaining_args'};
+            if (defined($brace_commands{$closed_command}) 
+                 and $brace_commands{$closed_command} == 0
+                 and @{$current->{'contents'}}) {
+              $self->line_warn (sprintf($self->__("Command address@hidden does 
not accept arguments"), 
+                                        $closed_command), $line_nr);
+            }
             if ($current->{'parent'}->{'cmdname'} eq 'anchor') {
               $current->{'parent'}->{'line_nr'} = $line_nr;
               my $parsed_anchor = _parse_node_manual($current);

Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -b -r1.70 -r1.71
--- Texinfo/Convert/Plaintext.pm        6 Feb 2011 00:32:41 -0000       1.70
+++ Texinfo/Convert/Plaintext.pm        6 Feb 2011 15:24:27 -0000       1.71
@@ -1802,6 +1802,10 @@
   }
   if ($root->{'extra'} and $root->{'extra'}->{'index_entry'}) {
     my $location = $self->_add_location($root);
+    # FIXME: remove a 'lines' from $location if at the very end of a node
+    # since it will lead to the next node otherwise.
+    #if ($root->{'cmdname'} and $root->{'cmdname'} =~ /index/) {
+    #}
     $self->{'index_entries_line_location'}->{$root} = $location;
     print STDERR "INDEX ENTRY lines_count $location->{'lines'}, index_entry 
$location->{'index_entry'}\n" 
        if ($self->{'DEBUG'});

Index: t/results/coverage/arg_in_brace_no_arg_command.pl
===================================================================
RCS file: 
/sources/texinfo/texinfo/tp/t/results/coverage/arg_in_brace_no_arg_command.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- t/results/coverage/arg_in_brace_no_arg_command.pl   7 Dec 2010 20:34:27 
-0000       1.3
+++ t/results/coverage/arg_in_brace_no_arg_command.pl   6 Feb 2011 15:24:27 
-0000       1.4
@@ -48,7 +48,17 @@
 $result_texts{'arg_in_brace_no_arg_command'} = 'TeX
 ';
 
-$result_errors{'arg_in_brace_no_arg_command'} = [];
+$result_errors{'arg_in_brace_no_arg_command'} = [
+  {
+    'error_line' => ':1: warning: Command @TeX does not accept arguments
+',
+    'file_name' => '',
+    'line_nr' => 1,
+    'macro' => '',
+    'text' => 'Command @TeX does not accept arguments',
+    'type' => 'warning'
+  }
+];
 
 
 1;



reply via email to

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