texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/parsetexi/source_marks.c (relocat


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/source_marks.c (relocate_source_marks): return immediately if there are no source marks. Gavin report.
Date: Mon, 13 Feb 2023 16:51: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 66360b510a * tp/Texinfo/XS/parsetexi/source_marks.c 
(relocate_source_marks): return immediately if there are no source marks.  
Gavin report.
66360b510a is described below

commit 66360b510a1c134d46a77ff6eb8868f068ccc810
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Feb 13 22:50:50 2023 +0100

    * tp/Texinfo/XS/parsetexi/source_marks.c (relocate_source_marks):
    return immediately if there are no source marks.  Gavin report.
    
    * tp/Makefile.tres, tp/t/19def.t: add empty_main_def_arguments.
---
 tp/Makefile.tres                             |   1 +
 tp/Texinfo/XS/parsetexi/source_marks.c       |   2 +
 tp/t/19def.t                                 |   4 +
 tp/t/results/def/empty_main_def_arguments.pl | 125 +++++++++++++++++++++++++++
 4 files changed, 132 insertions(+)

diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index aa1def3b0a..90ad96ebad 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -408,6 +408,7 @@ test_files_generated_list = 
$(test_tap_files_generated_list) \
   t/results/def/empty_def_command.pl \
   t/results/def/empty_deftype.pl \
   t/results/def/empty_deftypeop_name.pl \
+  t/results/def/empty_main_def_arguments.pl \
   t/results/def/end_of_line_end_file.pl \
   t/results/def/end_of_line_protect_at_end.pl \
   t/results/def/end_of_lines_protected.pl \
diff --git a/tp/Texinfo/XS/parsetexi/source_marks.c 
b/tp/Texinfo/XS/parsetexi/source_marks.c
index 3abe644c2e..48089c0258 100644
--- a/tp/Texinfo/XS/parsetexi/source_marks.c
+++ b/tp/Texinfo/XS/parsetexi/source_marks.c
@@ -191,6 +191,8 @@ relocate_source_marks (SOURCE_MARK_LIST *source_mark_list, 
ELEMENT *new_e,
   int list_number = source_mark_list->number;
   int *indices_to_remove;
 
+  if (list_number == 0)
+    return;
   indices_to_remove = malloc (sizeof(int) * list_number);
   memset (indices_to_remove, 0, sizeof(int) * list_number);
 
diff --git a/tp/t/19def.t b/tp/t/19def.t
index 3a1b4c0876..b858013222 100644
--- a/tp/t/19def.t
+++ b/tp/t/19def.t
@@ -531,6 +531,10 @@ deffn with @}
 @deffnx{} {}
 @end deffn
 '],
+['empty_main_def_arguments',
+'@deffn NNN
+@end deffn
+'],
 ['empty_deftypeop_name',
 '@deftypeop Command@code{com} {Window@code{int}} expose@var{exp}
 @end deftypeop
diff --git a/tp/t/results/def/empty_main_def_arguments.pl 
b/tp/t/results/def/empty_main_def_arguments.pl
new file mode 100644
index 0000000000..1ba8760e18
--- /dev/null
+++ b/tp/t/results/def/empty_main_def_arguments.pl
@@ -0,0 +1,125 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors 
+   %result_indices %result_sectioning %result_nodes %result_menus
+   %result_floats %result_converted %result_converted_errors 
+   %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'empty_main_def_arguments'} = {
+  'contents' => [
+    {
+      'contents' => [
+        {
+          'cmdname' => 'deffn',
+          'contents' => [
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'extra' => {
+                        'def_role' => 'category'
+                      },
+                      'text' => 'NNN'
+                    }
+                  ],
+                  'info' => {
+                    'spaces_after_argument' => {
+                      'text' => '
+'
+                    }
+                  },
+                  'type' => 'block_line_arg'
+                }
+              ],
+              'extra' => {
+                'def_command' => 'deffn',
+                'def_parsed_hash' => {
+                  'category' => {}
+                },
+                'original_def_cmdname' => 'deffn'
+              },
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 1,
+                'macro' => ''
+              },
+              'type' => 'def_line'
+            },
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'text' => 'deffn'
+                    }
+                  ],
+                  'info' => {
+                    'spaces_after_argument' => {
+                      'text' => '
+'
+                    }
+                  },
+                  'type' => 'line_arg'
+                }
+              ],
+              'cmdname' => 'end',
+              'extra' => {
+                'text_arg' => 'deffn'
+              },
+              'info' => {
+                'spaces_before_argument' => {
+                  'text' => ' '
+                }
+              },
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 2,
+                'macro' => ''
+              }
+            }
+          ],
+          'info' => {
+            'spaces_before_argument' => {
+              'text' => ' '
+            }
+          },
+          'source_info' => {
+            'file_name' => '',
+            'line_nr' => 1,
+            'macro' => ''
+          }
+        }
+      ],
+      'type' => 'before_node_section'
+    }
+  ],
+  'type' => 'document_root'
+};
+$result_trees{'empty_main_def_arguments'}{'contents'}[0]{'contents'}[0]{'contents'}[0]{'extra'}{'def_parsed_hash'}{'category'}
 = 
$result_trees{'empty_main_def_arguments'}{'contents'}[0]{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0];
+
+$result_texis{'empty_main_def_arguments'} = '@deffn NNN
+@end deffn
+';
+
+
+$result_texts{'empty_main_def_arguments'} = 'NNN: 
+';
+
+$result_errors{'empty_main_def_arguments'} = [
+  {
+    'error_line' => 'warning: missing name for @deffn
+',
+    'file_name' => '',
+    'line_nr' => 1,
+    'macro' => '',
+    'text' => 'missing name for @deffn',
+    'type' => 'warning'
+  }
+];
+
+
+$result_floats{'empty_main_def_arguments'} = {};
+
+
+1;



reply via email to

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