texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/ParserNonXS.pm (_handle_line_command


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_handle_line_command), tp/Texinfo/XS/parsetexi/handle_commands.c (handle_line_command): use data command information and arg_spec more, where it makes sense even if there cannot be @item there.
Date: Sat, 04 Mar 2023 04:03:39 -0500

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new a6dfdf7d32 * tp/Texinfo/ParserNonXS.pm (_handle_line_command), 
tp/Texinfo/XS/parsetexi/handle_commands.c (handle_line_command): use data 
command information and arg_spec more, where it makes sense even if there 
cannot be @item there.
a6dfdf7d32 is described below

commit a6dfdf7d32cd71e14ceb13c5b0280608e04c29c2
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Mar 4 10:03:29 2023 +0100

    * tp/Texinfo/ParserNonXS.pm (_handle_line_command),
    tp/Texinfo/XS/parsetexi/handle_commands.c (handle_line_command): use
    data command information and arg_spec more, where it makes sense even
    if there cannot be @item there.
---
 ChangeLog                                 |  7 +++++++
 tp/Texinfo/ParserNonXS.pm                 |  2 +-
 tp/Texinfo/XS/parsetexi/handle_commands.c | 12 ++++++------
 3 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f22118f29b..5a6cde1d0b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-03-03  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_handle_line_command),
+       tp/Texinfo/XS/parsetexi/handle_commands.c (handle_line_command): use
+       data command information and arg_spec more, where it makes sense even
+       if there cannot be @item there.
+
 2023-03-03  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/parsetexi/end_line.c (end_line_misc_line),
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 3f18e5b276..22065cf24a 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -5416,7 +5416,7 @@ sub _handle_line_command($$$$$$)
 
     $current = $current->{'args'}->[-1];
     $self->_push_context('ct_line', $command)
-      unless ($def_commands{$command});
+      unless ($def_commands{$data_cmdname});
     $line = _start_empty_line_after_command($line, $current, $misc);
   }
   _register_global_command($self, $misc, $source_info)
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c 
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index c46aa0df39..f82a2cc0e0 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -291,7 +291,7 @@ handle_other_command (ELEMENT *current, char **line_inout,
 /* STATUS is set to GET_A_NEW_LINE if we should get a new line after this,
    to FINISHED_TOTALLY if we should stop processing completely. */
 /* data_cmd (used for the information on the command) and cmd (for the command 
name)
-   is different only for @item */
+   is different for the only multicategory command, @item */
 ELEMENT *
 handle_line_command (ELEMENT *current, char **line_inout,
                      enum command_id cmd, enum command_id data_cmd, int 
*status)
@@ -507,7 +507,7 @@ handle_line_command (ELEMENT *current, char **line_inout,
     {
       ELEMENT *arg;
 
-      /* text, line, or a number.
+      /* text, line, or specific.
          (This includes handling of "@end", which is LINE_text.) */
       if (cmd == CM_item || cmd == CM_itemx)
         {
@@ -655,12 +655,12 @@ handle_line_command (ELEMENT *current, char **line_inout,
       /* LINE_specific commands arguments are handled in a specific way.
          The only other line commands that have more than one argument is
          node, so the following condition only applies to node */
-      if (command_data (current->cmd).data != LINE_specific
-          && command_data (current->cmd).args_number > 1)
+      if (arg_spec != LINE_specific
+          && command_data (data_cmd).args_number > 1)
         {
           counter_push (&count_remaining_args,
                         current,
-                        command_data (current->cmd).args_number - 1);
+                        command_data (data_cmd).args_number - 1);
         }
       if (cmd == CM_author)
         {
@@ -706,7 +706,7 @@ handle_line_command (ELEMENT *current, char **line_inout,
 
       /* add 'line' to context_stack.  This will be the
          case while we read the argument on this line. */
-      if (!(command_data(cmd).flags & CF_def))
+      if (!(command_data(data_cmd).flags & CF_def))
         push_context (ct_line, cmd);
       start_empty_line_after_command (current, &line, misc);
     }



reply via email to

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