texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Fri, 26 Apr 2024 18:11:20 -0400 (EDT)

branch: master
commit 4a236d102de88c4e2c7c5179539ea64acbd18edb
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Apr 22 11:12:04 2024 +0200

    * tp/Texinfo/command_data.txt (nodedescription): add
    contain_basic_inline flag.
---
 ChangeLog                                              |  5 +++++
 tp/Texinfo/ParserNonXS.pm                              |  8 ++++++++
 tp/Texinfo/XS/parsetexi/handle_commands.c              |  7 +++++++
 tp/Texinfo/XS/parsetexi/parser.c                       |  8 +++++---
 tp/Texinfo/command_data.txt                            |  2 +-
 tp/t/results/menu/nodedescription_descriptions.pl      | 10 +++++++++-
 tp/t/results/menu/nodedescriptionblock_descriptions.pl |  7 +++++++
 7 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c7ccb9c16a..2cf869cb96 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-04-22  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/command_data.txt (nodedescription): add
+       contain_basic_inline flag.
+
 2024-04-21  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/parsetexi/parser.c (check_valid_nesting): fix
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index b8bf781009..a2ddda08c2 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -5348,6 +5348,14 @@ sub _handle_other_command($$$$$)
       my $top_context_command = $self->_top_context_command();
       if (not defined($top_context_command)
           or not $heading_spec_commands{$top_context_command}) {
+      #my $line_context;
+      #if (defined($self->{'nesting_context'}->{'basic_inline_stack_on_line'})
+      #    and @{$self->{'nesting_context'}->{'basic_inline_stack_on_line'}} > 
0) {
+      #  $line_context
+      #    = $self->{'nesting_context'}->{'basic_inline_stack_on_line'}->[-1];
+      #}
+      #if (!defined($line_context)
+      #    or !$heading_spec_commands{$line_context}) {
         $self->_line_error(
           sprintf(__("\@%s should only appear in heading or footing"),
                 $command), $source_info);
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c 
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index 7ee0a3619f..20a98e7252 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -348,6 +348,13 @@ handle_other_command (ELEMENT *current, char **line_inout,
       command_e->cmd = cmd;
       add_to_element_contents (current, command_e);
       if (command_data(cmd).flags & CF_in_heading_spec
+          /*
+          && (nesting_context.basic_inline_stack_on_line.top <= 0
+              || !(command_data(
+          top_command(&nesting_context.basic_inline_stack_on_line)).flags
+                    & CF_heading_spec)))
+
+           */
           && !(command_data(current_context_command()).flags & 
CF_heading_spec))
         {
           line_error ("@%s should only appear in heading or footing",
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 4e11414587..4035ade2a2 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -1253,9 +1253,11 @@ check_valid_nesting (ELEMENT *current, enum command_id 
cmd)
     }
   else
     {
-      /* Default to valid nesting, for example for commands for which
-         it is not defined which commands can occur within them (e.g.
-         @tab?). */
+      /* Default to valid nesting, for commands for which it is not
+         defined which commands can occur within them (e.g. @tab, the
+         remaining of brace commands (context, arguments, other)
+         that are not treated especially, most line command and block
+         commands that have an argument */
       ok = 1;
     }
 
diff --git a/tp/Texinfo/command_data.txt b/tp/Texinfo/command_data.txt
index 2904d9b374..674cb5afb9 100644
--- a/tp/Texinfo/command_data.txt
+++ b/tp/Texinfo/command_data.txt
@@ -256,7 +256,7 @@ exdent                  line,formatted_line,close_paragraph 
           LINE_line
 # or nobrace skipspace, depending on the context
 item_LINE               line,formatted_line,close_paragraph    LINE_line
 itemx                   line,formatted_line,close_paragraph    LINE_line
-nodedescription         line,close_paragraph                               
LINE_line
+nodedescription         line,close_paragraph,contain_basic_inline          
LINE_line
 # in index entries
 subentry                line,in_index,contain_basic_inline          LINE_line
 # for printed output.  @vskip 0pt plus 1filll
diff --git a/tp/t/results/menu/nodedescription_descriptions.pl 
b/tp/t/results/menu/nodedescription_descriptions.pl
index 6f40a5c646..059785ba60 100644
--- a/tp/t/results/menu/nodedescription_descriptions.pl
+++ b/tp/t/results/menu/nodedescription_descriptions.pl
@@ -1864,7 +1864,15 @@ $result_menus{'nodedescription_descriptions'}[5] = 
$result_menus{'nodedescriptio
 $result_menus{'nodedescription_descriptions'}[6] = 
$result_menus{'nodedescription_descriptions'}[1]{'extra'}{'menu_directions'}{'next'}{'extra'}{'menu_directions'}{'next'}{'extra'}{'menu_directions'}{'next'}{'extra'}{'menu_directions'}{'next'}{'extra'}{'menu_directions'}{'next'};
 $result_menus{'nodedescription_descriptions'}[7] = 
$result_menus{'nodedescription_descriptions'}[1]{'extra'}{'menu_directions'}{'next'}{'extra'}{'menu_directions'}{'next'}{'extra'}{'menu_directions'}{'next'}{'extra'}{'menu_directions'}{'next'}{'extra'}{'menu_directions'}{'next'}{'extra'}{'menu_directions'}{'next'};
 
-$result_errors{'nodedescription_descriptions'} = [];
+$result_errors{'nodedescription_descriptions'} = [
+  {
+    'error_line' => 'warning: @verb should not appear on @nodedescription line
+',
+    'line_nr' => 18,
+    'text' => '@verb should not appear on @nodedescription line',
+    'type' => 'warning'
+  }
+];
 
 
 $result_floats{'nodedescription_descriptions'} = {};
diff --git a/tp/t/results/menu/nodedescriptionblock_descriptions.pl 
b/tp/t/results/menu/nodedescriptionblock_descriptions.pl
index b379f43e77..a8abd58721 100644
--- a/tp/t/results/menu/nodedescriptionblock_descriptions.pl
+++ b/tp/t/results/menu/nodedescriptionblock_descriptions.pl
@@ -1824,6 +1824,13 @@ $result_menus{'nodedescriptionblock_descriptions'}[4] = 
$result_menus{'nodedescr
 $result_menus{'nodedescriptionblock_descriptions'}[5] = 
$result_menus{'nodedescriptionblock_descriptions'}[1]{'extra'}{'menu_directions'}{'next'}{'extra'}{'menu_directions'}{'next'}{'extra'}{'menu_directions'}{'next'}{'extra'}{'menu_directions'}{'next'};
 
 $result_errors{'nodedescriptionblock_descriptions'} = [
+  {
+    'error_line' => 'warning: @verb should not appear on @nodedescription line
+',
+    'line_nr' => 16,
+    'text' => '@verb should not appear on @nodedescription line',
+    'type' => 'warning'
+  },
   {
     'error_line' => 'warning: multiple node @nodedescriptionblock
 ',



reply via email to

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