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): always close a line or block line command a raw line command is on.
Date: Sun, 05 Mar 2023 05:04:01 -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 fce4ace496 * tp/Texinfo/ParserNonXS.pm (_handle_line_command), 
tp/Texinfo/XS/parsetexi/handle_commands.c (handle_line_command): always close a 
line or block line command a raw line command is on.
fce4ace496 is described below

commit fce4ace496ae830c651313d68332676ff98e990b
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Mar 5 11:03:50 2023 +0100

    * tp/Texinfo/ParserNonXS.pm (_handle_line_command),
    tp/Texinfo/XS/parsetexi/handle_commands.c (handle_line_command):
    always close a line or block line command a raw line command is on.
---
 ChangeLog                                      |  6 +++
 tp/Texinfo/ParserNonXS.pm                      | 11 ++--
 tp/Texinfo/XS/parsetexi/handle_commands.c      |  9 +++-
 tp/t/results/value/set_in_item_missing_line.pl | 70 +++++++++++++-------------
 tp/t/results/value/set_on_item_line.pl         | 42 ++++++++--------
 5 files changed, 77 insertions(+), 61 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 309b54bf54..11acd3f8cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-03-05  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_handle_line_command),
+       tp/Texinfo/XS/parsetexi/handle_commands.c (handle_line_command):
+       always close a line or block line command a raw line command is on.
+
 2023-03-05  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line): minor
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 703773426a..e8c786cf7d 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -5206,10 +5206,13 @@ sub _handle_line_command($$$$$$)
     }
     _register_global_command($self, $command_e, $source_info)
       if $command_e;
-    # the end of line is ignored for special commands
-    if ($arg_spec ne 'special' or !$has_comment) {
-      $current = _end_line($self, $current, $source_info);
-    }
+
+    # This does nothing for the command being processed, as there is
+    # no line context setup nor line_args, it closes the line or block
+    # line @-commands the raw line command is on.  For c/comment
+    # this corresponds to legitimate constructs, not for other raw
+    # line commands.
+    $current = _end_line($self, $current, $source_info);
 
     if ($command eq 'bye') {
       return ($current, $line, $FINISHED_TOTALLY);
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c 
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index c2cbcd6362..777655e888 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -491,8 +491,13 @@ handle_line_command (ELEMENT *current, char **line_inout,
       if (command_e)
         register_global_command (command_e);
 
-      if (arg_spec != LINE_special || !has_comment)
-        current = end_line (current);
+      /* This does nothing for the command being processed, as there is
+         no line context setup nor line_args, but it closes a line or block
+         line @-commands the raw line command is on.  For c/comment
+         this corresponds to legitimate constructs, not for other raw line
+         commands.
+       */
+      current = end_line (current);
 
       if (cmd == CM_bye)
         {
diff --git a/tp/t/results/value/set_in_item_missing_line.pl 
b/tp/t/results/value/set_in_item_missing_line.pl
index 60a8674a23..38a65619bc 100644
--- a/tp/t/results/value/set_in_item_missing_line.pl
+++ b/tp/t/results/value/set_in_item_missing_line.pl
@@ -227,11 +227,37 @@ $result_trees{'set_in_item_missing_line'} = {
                                 'arg_line' => ' cn@c
 '
                               }
-                            },
-                            {
-                              'text' => ' ',
-                              'type' => 'ignorable_spaces_after_command'
-                            },
+                            }
+                          ],
+                          'type' => 'line_arg'
+                        }
+                      ],
+                      'cmdname' => 'item',
+                      'info' => {
+                        'spaces_before_argument' => {
+                          'text' => ' '
+                        }
+                      },
+                      'source_info' => {
+                        'file_name' => '',
+                        'line_nr' => 7,
+                        'macro' => ''
+                      }
+                    }
+                  ],
+                  'type' => 'table_term'
+                }
+              ],
+              'type' => 'table_entry'
+            },
+            {
+              'contents' => [
+                {
+                  'contents' => [
+                    {
+                      'args' => [
+                        {
+                          'contents' => [
                             {
                               'text' => 'jj'
                             }
@@ -253,7 +279,7 @@ $result_trees{'set_in_item_missing_line'} = {
                       },
                       'source_info' => {
                         'file_name' => '',
-                        'line_nr' => 7,
+                        'line_nr' => 8,
                         'macro' => ''
                       }
                     }
@@ -326,7 +352,7 @@ $result_texis{'set_in_item_missing_line'} = '@table @code
 
 @table @code
 @item cxx @set cn@c
- jj
+@item jj
 @end table
 ';
 
@@ -334,7 +360,8 @@ $result_texis{'set_in_item_missing_line'} = '@table @code
 $result_texts{'set_in_item_missing_line'} = 'xx 
 jj
 
-cxx jj
+cxx 
+jj
 ';
 
 $result_errors{'set_in_item_missing_line'} = [
@@ -355,33 +382,6 @@ $result_errors{'set_in_item_missing_line'} = [
     'macro' => '',
     'text' => '@set should only appear at the beginning of a line',
     'type' => 'warning'
-  },
-  {
-    'error_line' => 'warning: @item should not appear in @item
-',
-    'file_name' => '',
-    'line_nr' => 8,
-    'macro' => '',
-    'text' => '@item should not appear in @item',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => 'warning: @item should not appear on @item line
-',
-    'file_name' => '',
-    'line_nr' => 8,
-    'macro' => '',
-    'text' => '@item should not appear on @item line',
-    'type' => 'warning'
-  },
-  {
-    'error_line' => '@item outside of table or list
-',
-    'file_name' => '',
-    'line_nr' => 8,
-    'macro' => '',
-    'text' => '@item outside of table or list',
-    'type' => 'error'
   }
 ];
 
diff --git a/tp/t/results/value/set_on_item_line.pl 
b/tp/t/results/value/set_on_item_line.pl
index 3677c301b6..9ade68cebe 100644
--- a/tp/t/results/value/set_on_item_line.pl
+++ b/tp/t/results/value/set_on_item_line.pl
@@ -58,17 +58,8 @@ $result_trees{'set_on_item_line'} = {
                                 'arg_line' => ' ca b@c
 '
                               }
-                            },
-                            {
-                              'text' => 'item text'
                             }
                           ],
-                          'info' => {
-                            'spaces_after_argument' => {
-                              'text' => '
-'
-                            }
-                          },
                           'type' => 'line_arg'
                         }
                       ],
@@ -91,6 +82,10 @@ $result_trees{'set_on_item_line'} = {
                   'contents' => [
                     {
                       'contents' => [
+                        {
+                          'text' => 'item text
+'
+                        },
                         {
                           'text' => 'in item
 '
@@ -131,17 +126,8 @@ $result_trees{'set_on_item_line'} = {
                                 'arg_line' => ' cj@c
 '
                               }
-                            },
-                            {
-                              'text' => 'line'
                             }
                           ],
-                          'info' => {
-                            'spaces_after_argument' => {
-                              'text' => '
-'
-                            }
-                          },
                           'type' => 'line_arg'
                         }
                       ],
@@ -159,6 +145,20 @@ $result_trees{'set_on_item_line'} = {
                     }
                   ],
                   'type' => 'table_term'
+                },
+                {
+                  'contents' => [
+                    {
+                      'contents' => [
+                        {
+                          'text' => 'line
+'
+                        }
+                      ],
+                      'type' => 'paragraph'
+                    }
+                  ],
+                  'type' => 'table_definition'
                 }
               ],
               'type' => 'table_entry'
@@ -545,9 +545,11 @@ line
 ';
 
 
-$result_texts{'set_on_item_line'} = 'item text
+$result_texts{'set_on_item_line'} = '
+item text
 in item
-cjj line
+cjj 
+line
 cvvv 
 
 



reply via email to

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