texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Tue, 27 Dec 2022 05:38:05 -0500 (EST)

branch: master
commit a05990ebfa8fa7489466fc9e5a0683efa9f2f5dc
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Dec 27 11:37:46 2022 +0100

    * tp/Texinfo/Convert/TexinfoMarkup.pm (%type_elements, _convert),
    tp/Texinfo/ParserNonXS.pm (_parse_texi),
    tp/Texinfo/XS/parsetexi/element_types.txt,
    tp/Texinfo/XS/parsetexi/parser.c (parse_texi),
    tp/Texinfo/Convert/*.pm, util/texinfo.dtd: keep text appearing after
    @bye in the Texinfo Tree, as text_after_end in postamble_after_end
    container.  Add postamble_after_end as ignorable type in converters.
---
 ChangeLog                                          | 10 ++++++++
 tp/TODO                                            |  2 --
 tp/Texinfo/Convert/DocBook.pm                      |  1 +
 tp/Texinfo/Convert/HTML.pm                         |  3 ++-
 tp/Texinfo/Convert/LaTeX.pm                        |  3 ++-
 tp/Texinfo/Convert/NodeNameNormalization.pm        |  4 +++-
 tp/Texinfo/Convert/Plaintext.pm                    |  3 ++-
 tp/Texinfo/Convert/TexinfoMarkup.pm                |  5 ++++
 tp/Texinfo/Convert/Text.pm                         |  4 +++-
 tp/Texinfo/Convert/TextContent.pm                  |  4 +++-
 tp/Texinfo/ParserNonXS.pm                          | 23 ++++++++++++++++++
 tp/Texinfo/XS/parsetexi/element_types.c            |  2 ++
 tp/Texinfo/XS/parsetexi/element_types.h            |  2 ++
 tp/Texinfo/XS/parsetexi/element_types.txt          |  2 ++
 tp/Texinfo/XS/parsetexi/parser.c                   | 27 ++++++++++++++++++++++
 .../float/numbering_captions_listoffloats.pl       | 21 ++++++++++++++++-
 tp/t/results/formatting/texi_bib_example.pl        | 11 +++++++++
 .../info_tests/paragraphindent_and_preamble.pl     | 11 +++++++++
 .../paragraphindent_in_preamble_and_in_document.pl | 11 +++++++++
 .../info_tests/paragraphindent_not_in_preamble.pl  | 11 +++++++++
 tp/t/results/info_tests/split_no_copying.pl        | 11 +++++++++
 .../info_tests/two_paragraphindent_in_preamble.pl  | 11 +++++++++
 ..._paragraphindent_in_preamble_and_in_document.pl | 11 +++++++++
 .../misc_commands/text_before_and_after_bye.pl     | 17 ++++++++++++++
 .../moresectioning/more_sections_than_nodes.pl     | 11 +++++++++
 tp/t/results/moresectioning/sectioning_frames.pl   | 11 +++++++++
 .../sectioning/contents_at_document_begin.pl       | 11 +++++++++
 .../results/sectioning/contents_at_end_document.pl | 11 +++++++++
 .../contents_at_end_document_after_node.pl         | 11 +++++++++
 tp/t/results/sectioning/contents_no_section.pl     | 11 +++++++++
 util/texinfo.dtd                                   |  5 +++-
 31 files changed, 271 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0aa25f591b..7dadb1ea5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-12-27  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/TexinfoMarkup.pm (%type_elements, _convert),
+       tp/Texinfo/ParserNonXS.pm (_parse_texi),
+       tp/Texinfo/XS/parsetexi/element_types.txt,
+       tp/Texinfo/XS/parsetexi/parser.c (parse_texi),
+       tp/Texinfo/Convert/*.pm, util/texinfo.dtd: keep text appearing after
+       @bye in the Texinfo Tree, as text_after_end in postamble_after_end
+       container.  Add postamble_after_end as ignorable type in converters.
+
 2022-12-27  Patrice Dumas  <pertusus@free.fr>
 
        * t/html_tests.t: fix incorrect braces nesting.
diff --git a/tp/TODO b/tp/TODO
index b947764e96..952bfb6163 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -57,8 +57,6 @@ expanded.  For example
  truc @value{closebrace}
  machin
 
-Text after @bye should be kept as is when redoing Texinfo.
-
 hyphenation: should only appear in toplevel.
 
 
diff --git a/tp/Texinfo/Convert/DocBook.pm b/tp/Texinfo/Convert/DocBook.pm
index 2908bbfcca..54e6445744 100644
--- a/tp/Texinfo/Convert/DocBook.pm
+++ b/tp/Texinfo/Convert/DocBook.pm
@@ -226,6 +226,7 @@ foreach my $type (
             'spaces_before_paragraph',
             'menu_entry_leading_text',
             'menu_entry_separator',
+            'postamble_after_end',
             'preamble_before_beginning',
             'preamble_before_setfilename',
             'spaces_at_end',
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index f04c492180..380ed8a22c 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -5955,7 +5955,8 @@ sub default_type_open($$)
 
 
 # Ignored commands
-foreach my $type ('ignorable_spaces_after_command', 
'preamble_before_beginning',
+foreach my $type ('ignorable_spaces_after_command', 'postamble_after_end',
+            'preamble_before_beginning',
             'preamble_before_setfilename',
             'spaces_at_end',
             'spaces_before_paragraph',
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 027ce1f102..b1cb349906 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -556,7 +556,8 @@ foreach my $type ('ignorable_spaces_after_command',
 # ignore 'command_as_argument_inserted' in order to use the default
 # setting for @itemize if there is no argument
 my %ignored_types;
-foreach my $type ('preamble_before_beginning',
+foreach my $type ('command_as_argument_inserted',
+            'postamble_after_end', 'preamble_before_beginning',
             'preamble_before_setfilename', 'command_as_argument_inserted') {
   $ignored_types{$type} = 1;
 }
diff --git a/tp/Texinfo/Convert/NodeNameNormalization.pm 
b/tp/Texinfo/Convert/NodeNameNormalization.pm
index c588abb6c4..2740caaaa4 100644
--- a/tp/Texinfo/Convert/NodeNameNormalization.pm
+++ b/tp/Texinfo/Convert/NodeNameNormalization.pm
@@ -80,7 +80,9 @@ foreach my $ignored_brace_command ('anchor', 'footnote', 
'shortcaption',
 }
 
 my %ignored_types;
-foreach my $type ('ignorable_spaces_after_command', 
'preamble_before_beginning',
+foreach my $type ('ignorable_spaces_after_command',
+            'postamble_after_end',
+            'preamble_before_beginning',
             'spaces_at_end',
             'spaces_before_paragraph',
             'space_at_end_menu_node',
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index d935e56901..0586ef07b6 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -286,7 +286,8 @@ foreach my $type ('ignorable_spaces_after_command',
 }
 
 my %ignored_types;
-foreach my $type ('preamble_before_beginning',
+foreach my $type ('postamble_after_end',
+            'preamble_before_beginning',
             'preamble_before_setfilename') {
   $ignored_types{$type} = 1;
 }
diff --git a/tp/Texinfo/Convert/TexinfoMarkup.pm 
b/tp/Texinfo/Convert/TexinfoMarkup.pm
index 31599f1f09..773ee3d204 100644
--- a/tp/Texinfo/Convert/TexinfoMarkup.pm
+++ b/tp/Texinfo/Convert/TexinfoMarkup.pm
@@ -250,6 +250,7 @@ my %type_elements = (
   'menu_comment' => 'menucomment',
   'menu_entry_description' => 'menudescription',
   'menu_entry_name' => 'menutitle',
+  'postamble_after_end' => 'postambleafterend',
   'preamble_before_beginning' => 'preamblebeforebeginning',
   'table_definition' => 'tableitem',
   'table_entry' => 'tableentry',
@@ -1670,6 +1671,10 @@ sub _convert($$;$)
   foreach my $format_element (@close_format_elements) {
     $result .= $self->txi_markup_close_element($format_element);
   }
+  if ($element->{'type'} and $element->{'type'} eq 'postamble_after_end') {
+    $self->{'pending_bye'} .= $result;
+    return '';
+  }
   if ($element->{'cmdname'}
       and exists($Texinfo::Commands::block_commands{$element->{'cmdname'}})) {
     if ($self->{'expanded_formats_hash'}->{$element->{'cmdname'}}) {
diff --git a/tp/Texinfo/Convert/Text.pm b/tp/Texinfo/Convert/Text.pm
index fc56b460d5..69a0c83fc9 100644
--- a/tp/Texinfo/Convert/Text.pm
+++ b/tp/Texinfo/Convert/Text.pm
@@ -156,7 +156,9 @@ foreach my $command ('verbatiminclude', 'sp') {
 }
 
 my %ignored_types;
-foreach my $type ('ignorable_spaces_after_command', 
'preamble_before_beginning',
+foreach my $type ('ignorable_spaces_after_command',
+            'postamble_after_end',
+            'preamble_before_beginning',
             'spaces_at_end',
             'spaces_before_paragraph',
             'spaces_after_close_brace') {
diff --git a/tp/Texinfo/Convert/TextContent.pm 
b/tp/Texinfo/Convert/TextContent.pm
index a26adf38e8..90fc98b582 100644
--- a/tp/Texinfo/Convert/TextContent.pm
+++ b/tp/Texinfo/Convert/TextContent.pm
@@ -49,7 +49,9 @@ foreach my $ignored_command (
 }
 
 my %ignored_types;
-foreach my $type ('ignorable_spaces_after_command', 
'preamble_before_beginning',
+foreach my $type ('ignorable_spaces_after_command',
+            'postamble_after_end',
+            'preamble_before_beginning',
             'spaces_before_paragraph',
             'spaces_after_close_brace') {
   $ignored_types{$type} = 1;
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index b6f3339077..58deeff6a2 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -6072,6 +6072,21 @@ sub _parse_texi($$$)
            .join('|', @context_stack)));
   }
 
+  # Gather text after @bye
+  my $element_after_bye = {'type' => 'postamble_after_end', 'contents' => [],
+                           'parent' => $current};
+  while (1) {
+    my $line;
+    ($line, $source_info) = _next_text($self, $source_info);
+    last if (!defined($line));
+    push @{$element_after_bye->{'contents'}},
+           {'text' => $line, 'type' => 'text_after_end',
+            'parent' => $element_after_bye};
+  }
+  if (scalar(@{$element_after_bye->{'contents'}})) {
+    push @{$current->{'contents'}}, $element_after_bye;
+  }
+
   # Setup labels info and nodes list based on 'targets'
   Texinfo::Convert::NodeNameNormalization::set_nodes_list_labels($self,
                                               $self->{'registrar'}, $self);
@@ -7298,6 +7313,10 @@ C<@verb>, C<@macro> body).
 Space within an index @-command before an @-command interrupting the
 index command.
 
+=item text_after_end
+
+Text appearing after @bye.
+
 =item text_before_beginning
 
 Text appearing before real content, including the C<\input texinfo.tex>.
@@ -7333,6 +7352,10 @@ root otherwise.
 C<document_root> first content should be C<before_node_section>, then nodes and
 sections @-commands elements, and also C<@bye> element.
 
+=item postamble_after_end
+
+This container holds everything appearing after @bye.
+
 =item preamble_before_beginning
 
 This container holds everything appearing before the first content, including
diff --git a/tp/Texinfo/XS/parsetexi/element_types.c 
b/tp/Texinfo/XS/parsetexi/element_types.c
index 480276f6c3..4db983cebc 100644
--- a/tp/Texinfo/XS/parsetexi/element_types.c
+++ b/tp/Texinfo/XS/parsetexi/element_types.c
@@ -12,6 +12,7 @@ char *element_type_names[] = {
 "spaces_at_end",
 "spaces_after_close_brace",
 "spaces_before_paragraph",
+"text_after_end",
 "text_before_beginning",
 "space_at_end_menu_node",
 "after_menu_description_line",
@@ -20,6 +21,7 @@ char *element_type_names[] = {
 "document_root",
 "root_line",
 "before_node_section",
+"postamble_after_end",
 "preamble_before_beginning",
 "preamble_before_setfilename",
 "paragraph",
diff --git a/tp/Texinfo/XS/parsetexi/element_types.h 
b/tp/Texinfo/XS/parsetexi/element_types.h
index 8518cff6e1..3bae0c8a87 100644
--- a/tp/Texinfo/XS/parsetexi/element_types.h
+++ b/tp/Texinfo/XS/parsetexi/element_types.h
@@ -15,6 +15,7 @@ ET_ignorable_spaces_after_command,
 ET_spaces_at_end,
 ET_spaces_after_close_brace,
 ET_spaces_before_paragraph,
+ET_text_after_end,
 ET_text_before_beginning,
 ET_space_at_end_menu_node,
 ET_after_menu_description_line,
@@ -23,6 +24,7 @@ ET_spaces_inserted,
 ET_document_root,
 ET_root_line,
 ET_before_node_section,
+ET_postamble_after_end,
 ET_preamble_before_beginning,
 ET_preamble_before_setfilename,
 ET_paragraph,
diff --git a/tp/Texinfo/XS/parsetexi/element_types.txt 
b/tp/Texinfo/XS/parsetexi/element_types.txt
index 8921fda521..44ae135114 100644
--- a/tp/Texinfo/XS/parsetexi/element_types.txt
+++ b/tp/Texinfo/XS/parsetexi/element_types.txt
@@ -30,6 +30,7 @@ ignorable_spaces_after_command
 spaces_at_end
 spaces_after_close_brace
 spaces_before_paragraph
+text_after_end
 text_before_beginning
 space_at_end_menu_node
 after_menu_description_line
@@ -40,6 +41,7 @@ spaces_inserted
 document_root
 root_line
 before_node_section
+postamble_after_end
 preamble_before_beginning
 preamble_before_setfilename
 paragraph
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index f9fd09e6b1..4ac79e9abe 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -2143,5 +2143,32 @@ finished_totally:
 
   /* TODO: Check for "unclosed stacks". */
 
+  /* Gather text after @bye */
+  {
+    ELEMENT *element_after_bye;
+    element_after_bye = new_element (ET_postamble_after_end);
+
+    while (1)
+      {
+        ELEMENT *e;
+        free (allocated_line);
+        line = allocated_line = next_text ();
+        if (!allocated_line)
+          break; /* Out of input. */
+
+        e = new_element (ET_text_after_end);
+        text_append (&e->text, line);
+        add_to_element_contents (element_after_bye, e);
+      }
+    if (element_after_bye->contents.number == 0)
+      {
+        destroy_element (element_after_bye);
+      }
+    else
+      {
+        add_to_element_contents (current, element_after_bye);
+      }
+  }
+
   return current;
 }
diff --git a/tp/t/results/float/numbering_captions_listoffloats.pl 
b/tp/t/results/float/numbering_captions_listoffloats.pl
index 34b17c9d76..0cc2ac244a 100644
--- a/tp/t/results/float/numbering_captions_listoffloats.pl
+++ b/tp/t/results/float/numbering_captions_listoffloats.pl
@@ -4826,6 +4826,21 @@ $result_trees{'numbering_captions_listoffloats'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        },
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -5203,6 +5218,8 @@ A ref to float without type @ref{label but no type}.
 @listoffloats th@\'eor@`eme
 
 @bye
+
+
 ';
 
 
@@ -7226,6 +7243,8 @@ And (<pxref label="text-in-chapter"><xrefnodename>text in 
chapter</xrefnodename>
 
 </unnumbered>
 <bye></bye>
-';
+<postambleafterend>
+
+</postambleafterend>';
 
 1;
diff --git a/tp/t/results/formatting/texi_bib_example.pl 
b/tp/t/results/formatting/texi_bib_example.pl
index 2bc0b41b71..16a390f58d 100644
--- a/tp/t/results/formatting/texi_bib_example.pl
+++ b/tp/t/results/formatting/texi_bib_example.pl
@@ -4049,6 +4049,16 @@ $result_trees{'texi_bib_example'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -4362,6 +4372,7 @@ Massachusetts, 1994.
 @end itemize
 
 @bye
+
 ';
 
 
diff --git a/tp/t/results/info_tests/paragraphindent_and_preamble.pl 
b/tp/t/results/info_tests/paragraphindent_and_preamble.pl
index 981220d98f..2965046445 100644
--- a/tp/t/results/info_tests/paragraphindent_and_preamble.pl
+++ b/tp/t/results/info_tests/paragraphindent_and_preamble.pl
@@ -256,6 +256,16 @@ $result_trees{'paragraphindent_and_preamble'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -281,6 +291,7 @@ First para.
 Second para.
 
 @bye
+
 ';
 
 
diff --git 
a/tp/t/results/info_tests/paragraphindent_in_preamble_and_in_document.pl 
b/tp/t/results/info_tests/paragraphindent_in_preamble_and_in_document.pl
index 50ed8ed733..eec945b9d3 100644
--- a/tp/t/results/info_tests/paragraphindent_in_preamble_and_in_document.pl
+++ b/tp/t/results/info_tests/paragraphindent_in_preamble_and_in_document.pl
@@ -305,6 +305,16 @@ 
$result_trees{'paragraphindent_in_preamble_and_in_document'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -334,6 +344,7 @@ Second para.
 Third para after second paragraphindent.
 
 @bye
+
 ';
 
 
diff --git a/tp/t/results/info_tests/paragraphindent_not_in_preamble.pl 
b/tp/t/results/info_tests/paragraphindent_not_in_preamble.pl
index 1af7f2a799..975f85f4d5 100644
--- a/tp/t/results/info_tests/paragraphindent_not_in_preamble.pl
+++ b/tp/t/results/info_tests/paragraphindent_not_in_preamble.pl
@@ -256,6 +256,16 @@ $result_trees{'paragraphindent_not_in_preamble'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -281,6 +291,7 @@ Before paragraphindent.
 After paragraphindent.
 
 @bye
+
 ';
 
 
diff --git a/tp/t/results/info_tests/split_no_copying.pl 
b/tp/t/results/info_tests/split_no_copying.pl
index 7cadf3d798..e15480baa6 100644
--- a/tp/t/results/info_tests/split_no_copying.pl
+++ b/tp/t/results/info_tests/split_no_copying.pl
@@ -336,6 +336,16 @@ $result_trees{'split_no_copying'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -365,6 +375,7 @@ This is the top node.
 First chapter.
 
 @bye
+
 ';
 
 
diff --git a/tp/t/results/info_tests/two_paragraphindent_in_preamble.pl 
b/tp/t/results/info_tests/two_paragraphindent_in_preamble.pl
index dda5df3b37..69528e0b95 100644
--- a/tp/t/results/info_tests/two_paragraphindent_in_preamble.pl
+++ b/tp/t/results/info_tests/two_paragraphindent_in_preamble.pl
@@ -291,6 +291,16 @@ $result_trees{'two_paragraphindent_in_preamble'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -318,6 +328,7 @@ First para.
 Second para.
 
 @bye
+
 ';
 
 
diff --git 
a/tp/t/results/info_tests/two_paragraphindent_in_preamble_and_in_document.pl 
b/tp/t/results/info_tests/two_paragraphindent_in_preamble_and_in_document.pl
index 7974ed1cb5..8f468b979c 100644
--- a/tp/t/results/info_tests/two_paragraphindent_in_preamble_and_in_document.pl
+++ b/tp/t/results/info_tests/two_paragraphindent_in_preamble_and_in_document.pl
@@ -340,6 +340,16 @@ 
$result_trees{'two_paragraphindent_in_preamble_and_in_document'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -371,6 +381,7 @@ Second para.
 Third para after third paragraphindent.
 
 @bye
+
 ';
 
 
diff --git a/tp/t/results/misc_commands/text_before_and_after_bye.pl 
b/tp/t/results/misc_commands/text_before_and_after_bye.pl
index 1e3ceebc24..248c00d1d9 100644
--- a/tp/t/results/misc_commands/text_before_and_after_bye.pl
+++ b/tp/t/results/misc_commands/text_before_and_after_bye.pl
@@ -29,12 +29,29 @@ $result_trees{'text_before_and_after_bye'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        },
+        {
+          'text' => 'after bye
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
 };
 
 $result_texis{'text_before_and_after_bye'} = 'Before bye @bye on bye line
+
+after bye
 ';
 
 
diff --git a/tp/t/results/moresectioning/more_sections_than_nodes.pl 
b/tp/t/results/moresectioning/more_sections_than_nodes.pl
index a7a9ee0735..d92bad7801 100644
--- a/tp/t/results/moresectioning/more_sections_than_nodes.pl
+++ b/tp/t/results/moresectioning/more_sections_than_nodes.pl
@@ -1084,6 +1084,16 @@ $result_trees{'more_sections_than_nodes'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -1158,6 +1168,7 @@ $result_texis{'more_sections_than_nodes'} = '\\input 
texinfo @c -*-texinfo-*-
 @appendix appendix
 
 @bye
+
 ';
 
 
diff --git a/tp/t/results/moresectioning/sectioning_frames.pl 
b/tp/t/results/moresectioning/sectioning_frames.pl
index 398a54b4ed..62d1cca8bc 100644
--- a/tp/t/results/moresectioning/sectioning_frames.pl
+++ b/tp/t/results/moresectioning/sectioning_frames.pl
@@ -2258,6 +2258,16 @@ $result_trees{'sectioning_frames'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -2423,6 +2433,7 @@ unnumbered chapter text.
 
 @contents
 @bye
+
 ';
 
 
diff --git a/tp/t/results/sectioning/contents_at_document_begin.pl 
b/tp/t/results/sectioning/contents_at_document_begin.pl
index 5bc8b7ff05..5aab473cde 100644
--- a/tp/t/results/sectioning/contents_at_document_begin.pl
+++ b/tp/t/results/sectioning/contents_at_document_begin.pl
@@ -165,6 +165,16 @@ $result_trees{'contents_at_document_begin'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -182,6 +192,7 @@ $result_texis{'contents_at_document_begin'} = '\\input 
texinfo @c -*-texinfo-*-
 @chapter chap
 
 @bye
+
 ';
 
 
diff --git a/tp/t/results/sectioning/contents_at_end_document.pl 
b/tp/t/results/sectioning/contents_at_end_document.pl
index 4951302be1..d7ec321b66 100644
--- a/tp/t/results/sectioning/contents_at_end_document.pl
+++ b/tp/t/results/sectioning/contents_at_end_document.pl
@@ -164,6 +164,16 @@ $result_trees{'contents_at_end_document'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -181,6 +191,7 @@ $result_texis{'contents_at_end_document'} = '\\input 
texinfo @c -*-texinfo-*-
 @contents
 
 @bye
+
 ';
 
 
diff --git a/tp/t/results/sectioning/contents_at_end_document_after_node.pl 
b/tp/t/results/sectioning/contents_at_end_document_after_node.pl
index af02a23bc4..3dd72dd140 100644
--- a/tp/t/results/sectioning/contents_at_end_document_after_node.pl
+++ b/tp/t/results/sectioning/contents_at_end_document_after_node.pl
@@ -333,6 +333,16 @@ $result_trees{'contents_at_end_document_after_node'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -361,6 +371,7 @@ $result_texis{'contents_at_end_document_after_node'} = 
'\\input texinfo @c -*-te
 @contents
 
 @bye
+
 ';
 
 
diff --git a/tp/t/results/sectioning/contents_no_section.pl 
b/tp/t/results/sectioning/contents_no_section.pl
index 2f545da5d5..8b180543e0 100644
--- a/tp/t/results/sectioning/contents_no_section.pl
+++ b/tp/t/results/sectioning/contents_no_section.pl
@@ -145,6 +145,16 @@ $result_trees{'contents_no_section'} = {
         }
       ],
       'cmdname' => 'bye'
+    },
+    {
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'text_after_end'
+        }
+      ],
+      'type' => 'postamble_after_end'
     }
   ],
   'type' => 'document_root'
@@ -161,6 +171,7 @@ $result_texis{'contents_no_section'} = '\\input texinfo @c 
-*-texinfo-*-
 @contents
 
 @bye
+
 ';
 
 
diff --git a/util/texinfo.dtd b/util/texinfo.dtd
index 0f370b77ed..35fab97f10 100644
--- a/util/texinfo.dtd
+++ b/util/texinfo.dtd
@@ -239,7 +239,8 @@
 
 <!-- TOP Level Element -->
 <!ELEMENT texinfo (filename?, preamblebeforebeginning?, (%metainformation;
-                    | %section.all; | %main.content;)*, bye?)>
+                    | %section.all; | %main.content;)*,
+                   bye?, postambleafterend?)>
 <!ATTLIST texinfo xml:lang (%languagecodes;) 'en'>
 
 <!-- meta-information -->
@@ -290,6 +291,8 @@
 
 <!-- preamble before texinfo code beginning (empty lines and \input) -->
 <!ELEMENT preamblebeforebeginning (#PCDATA)>
+<!-- everything appearing after @bye -->
+<!ELEMENT postambleafterend (#PCDATA)>
 
 <!-- ToC -->
 <!ELEMENT contents      EMPTY>



reply via email to

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