texinfo-commits
[Top][All Lists]
Advanced

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

[7395] don't save line number for definfoenclose command


From: gavinsmith0123
Subject: [7395] don't save line number for definfoenclose command
Date: Tue, 20 Sep 2016 11:16:49 +0000 (UTC)

Revision: 7395
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7395
Author:   gavin
Date:     2016-09-20 11:16:48 +0000 (Tue, 20 Sep 2016)
Log Message:
-----------
don't save line number for definfoenclose command

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Parser.pm
    trunk/tp/t/results/macro/macro_in_misc_commands.pl
    trunk/tp/t/results/misc_commands/definfoenclose.pl
    trunk/tp/t/results/value/value_in_misc_commands.pl

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-09-20 08:22:31 UTC (rev 7394)
+++ trunk/ChangeLog     2016-09-20 11:16:48 UTC (rev 7395)
@@ -1,3 +1,11 @@
+2016-09-20  Gavin Smith  <address@hidden>
+
+       * tp/Texinfo/Parser.pm (_parse_texi): Don't store the line 
+       number for a command defined with @definfoenclose, even if it 
+       was previously a built-in command.
+       (_parse_line_command_args) <@definfoenclose>: Add a comment 
+       warning about redefining a built-in command.
+
 2016-09-19  Gavin Smith  <address@hidden>
 
        * tp/Texinfo/Documentlanguages.pm: Regenerate by running

Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm  2016-09-20 08:22:31 UTC (rev 7394)
+++ trunk/tp/Texinfo/Parser.pm  2016-09-20 11:16:48 UTC (rev 7395)
@@ -4863,7 +4863,8 @@
                                             'parent' => $current,
                                             'contents' => [] };
           $current->{'contents'}->[-1]->{'line_nr'} = $line_nr
-            if ($keep_line_nr_brace_commands{$command});
+            if ($keep_line_nr_brace_commands{$command}
+                and !$self->{'definfoenclose'}->{$command});
           _mark_and_warn_invalid($self, $command, $invalid_parent,
                                  $line_nr, $current->{'contents'}->[-1]);
           $current = $current->{'contents'}->[-1];
@@ -5657,6 +5658,10 @@
       $args = [$1, $2, $3 ];
       $self->{'definfoenclose'}->{$1} = [ $2, $3 ];
       print STDERR "DEFINFOENCLOSE address@hidden: $2, $3\n" if 
($self->{'DEBUG'});
+
+      # Warning: there is a risk of mixing of data between a built-in 
+      # command and a user command defined with @definfoenclose.
+      # %keep_line_nr_brace_commands is one example of this.
     } else {
       $self->line_error(sprintf($self->
                               __("bad argument to address@hidden"), $command), 
$line_nr);

Modified: trunk/tp/t/results/macro/macro_in_misc_commands.pl
===================================================================
--- trunk/tp/t/results/macro/macro_in_misc_commands.pl  2016-09-20 08:22:31 UTC 
(rev 7394)
+++ trunk/tp/t/results/macro/macro_in_misc_commands.pl  2016-09-20 11:16:48 UTC 
(rev 7395)
@@ -1372,11 +1372,6 @@
                 'begin' => '(strong:',
                 'end' => ':)'
               },
-              'line_nr' => {
-                'file_name' => '',
-                'line_nr' => 80,
-                'macro' => 'strongmacro'
-              },
               'parent' => {},
               'type' => 'definfoenclose_command'
             },

Modified: trunk/tp/t/results/misc_commands/definfoenclose.pl
===================================================================
--- trunk/tp/t/results/misc_commands/definfoenclose.pl  2016-09-20 08:22:31 UTC 
(rev 7394)
+++ trunk/tp/t/results/misc_commands/definfoenclose.pl  2016-09-20 11:16:48 UTC 
(rev 7395)
@@ -318,11 +318,6 @@
             'begin' => '(strong:',
             'end' => ':)'
           },
-          'line_nr' => {
-            'file_name' => '',
-            'line_nr' => 14,
-            'macro' => ''
-          },
           'parent' => {},
           'type' => 'definfoenclose_command'
         },

Modified: trunk/tp/t/results/value/value_in_misc_commands.pl
===================================================================
--- trunk/tp/t/results/value/value_in_misc_commands.pl  2016-09-20 08:22:31 UTC 
(rev 7394)
+++ trunk/tp/t/results/value/value_in_misc_commands.pl  2016-09-20 11:16:48 UTC 
(rev 7395)
@@ -968,11 +968,6 @@
                 'begin' => '(strong:',
                 'end' => ':)'
               },
-              'line_nr' => {
-                'file_name' => '',
-                'line_nr' => 51,
-                'macro' => ''
-              },
               'parent' => {},
               'type' => 'definfoenclose_command'
             },




reply via email to

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