texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Common.pm, tp/Texinfo/ParserNonXS.pm


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Common.pm, tp/Texinfo/ParserNonXS.pm, tp/Texinfo/XS/parsetexi/command_data.txt, tp/Texinfo/XS/parsetexi/commands.c (close_preformatted_command), tp/Texinfo/XS/parsetexi/commands.h, tp/Texinfo/XS/parsetexi/parser.c (begin_paragraph, process_remaining_on_line): add close_paragraph flag in command_data.txt. Remove %close_paragraph_commands from Texinfo::Common. Remove the close_paragraph_command function.
Date: Sun, 02 Oct 2022 18:28:29 -0400

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 547ce9de00 * tp/Texinfo/Common.pm, tp/Texinfo/ParserNonXS.pm, 
tp/Texinfo/XS/parsetexi/command_data.txt, tp/Texinfo/XS/parsetexi/commands.c 
(close_preformatted_command), tp/Texinfo/XS/parsetexi/commands.h, 
tp/Texinfo/XS/parsetexi/parser.c (begin_paragraph, process_remaining_on_line): 
add close_paragraph flag in command_data.txt.  Remove %close_paragraph_commands 
from Texinfo::Common.  Remove the close_paragraph_command function.
547ce9de00 is described below

commit 547ce9de002d7213b11195d3c891086303c9b48e
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Oct 3 00:28:18 2022 +0200

    * tp/Texinfo/Common.pm, tp/Texinfo/ParserNonXS.pm,
    tp/Texinfo/XS/parsetexi/command_data.txt,
    tp/Texinfo/XS/parsetexi/commands.c (close_preformatted_command),
    tp/Texinfo/XS/parsetexi/commands.h, tp/Texinfo/XS/parsetexi/parser.c
    (begin_paragraph, process_remaining_on_line): add close_paragraph
    flag in command_data.txt.  Remove %close_paragraph_commands from
    Texinfo::Common.  Remove the close_paragraph_command function.
---
 ChangeLog                                |  10 ++
 tp/Texinfo/Common.pm                     |  51 ++-----
 tp/Texinfo/ParserNonXS.pm                |   4 +-
 tp/Texinfo/XS/parsetexi/command_data.txt | 254 +++++++++++++++----------------
 tp/Texinfo/XS/parsetexi/commands.c       |  56 +------
 tp/Texinfo/XS/parsetexi/commands.h       |   8 +-
 tp/Texinfo/XS/parsetexi/parser.c         |   4 +-
 7 files changed, 157 insertions(+), 230 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b56d3cc409..f6205a8a5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-10-02  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Common.pm, tp/Texinfo/ParserNonXS.pm,
+       tp/Texinfo/XS/parsetexi/command_data.txt,
+       tp/Texinfo/XS/parsetexi/commands.c (close_preformatted_command),
+       tp/Texinfo/XS/parsetexi/commands.h, tp/Texinfo/XS/parsetexi/parser.c
+       (begin_paragraph, process_remaining_on_line): add close_paragraph
+       flag in command_data.txt.  Remove %close_paragraph_commands from
+       Texinfo::Common.  Remove the close_paragraph_command function.
+
 2022-10-02  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Common.pm, tp/Texinfo/Convert/DocBook.pm,
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index b5dbabee04..422787f1cc 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -586,38 +586,12 @@ foreach my $def_command(keys %def_map) {
 }
 
 our %texinfo_output_formats;
-foreach my $format_raw_command('html', 'tex', 'xml', 'docbook', 'latex') {
-  $texinfo_output_formats{$format_raw_command} = $format_raw_command;
-}
-
-foreach my $output_format_command ('info', 'plaintext') {
+foreach my $output_format_command ('info', 'plaintext',
+       grep {$Texinfo::Commands::block_commands{$_} eq 'format_raw'}
+            keys(%Texinfo::Commands::block_commands)) {
   $texinfo_output_formats{$output_format_command} = $output_format_command;
 }
 
-# commands that forces closing an opened paragraph.
-our %close_paragraph_commands;
-
-foreach my $block_command (keys(%Texinfo::Commands::block_commands)) {
-  $close_paragraph_commands{$block_command} = 1
-     unless ($Texinfo::Commands::block_commands{$block_command} eq 'raw'
-             or $Texinfo::Commands::block_commands{$block_command} eq 
'conditional'
-             or $Texinfo::Commands::block_commands{$block_command} eq 
'format_raw');
-}
-
-$close_paragraph_commands{'verbatim'} = 1;
-
-foreach my $close_paragraph_command ('titlefont', 'insertcopying', 'sp',
-  'verbatiminclude', 'need', 'page', 'item', 'itemx', 'tab', 'headitem',
-  'printindex', 'listoffloats', 'center', 'dircategory', 'contents',
-  'shortcontents', 'summarycontents', 'caption', 'shortcaption',
-  'setfilename', 'exdent') {
-  $close_paragraph_commands{$close_paragraph_command} = 1;
-}
-
-foreach my $close_paragraph_command (keys(%Texinfo::Commands::def_commands)) {
-  $close_paragraph_commands{$close_paragraph_command} = 1;
-}
-
 my %unformatted_block_commands;
 foreach my $unformatted_block_command ('ignore', 'macro', 'rmacro') {
   $unformatted_block_commands{$unformatted_block_command} = 1;
@@ -692,13 +666,6 @@ our %level_to_structuring_command;
 }
 
 
-foreach my $sectioning_command (keys (%command_structuring_level)) {
-  if ($sectioning_command =~ /heading/) {
-    $close_paragraph_commands{$sectioning_command} = 1;
-  }
-}
-
-
 # line commands which arguments may be formatted as text.
 # index commands may be too, but index command may be added with
 # @def*index so they are not added here.
@@ -1499,8 +1466,14 @@ foreach my $type (@inline_types) {
   $inline_types{$type} = 1;
 }
 
-my %not_inline_commands = (%Texinfo::Commands::root_commands, 
%Texinfo::Commands::block_commands,
-     grep {$Texinfo::Commands::brace_commands{$_} eq 'context'} 
keys(%Texinfo::Commands::brace_commands));
+my %not_inline_commands;
+foreach my $command (
+     keys(%Texinfo::Commands::root_commands),
+     keys(%Texinfo::Commands::block_commands),
+     grep {$Texinfo::Commands::brace_commands{$_} eq 'context'}
+           keys(%Texinfo::Commands::brace_commands)) {
+  $not_inline_commands{$command} = 1;
+}
 
 # Return 1 if inline in a running text, 0 if right in top-level or block
 # environment, and undef otherwise.
@@ -2499,7 +2472,7 @@ Hashes are defined as C<our> variables, and are therefore 
available
 outside of the module.
 
 TODO: undocumented
-%null_device_file %default_parser_customization_values 
%document_settable_multiple_at_commands %document_settable_unique_at_commands 
%default_converter_command_line_options 
%default_main_program_customization_options %default_converter_customization 
@variable_string_settables %document_settable_at_commands %def_map 
%close_paragraph_commands %command_structuring_level 
%level_to_structuring_command
+%null_device_file %default_parser_customization_values 
%document_settable_multiple_at_commands %document_settable_unique_at_commands 
%default_converter_command_line_options 
%default_main_program_customization_options %default_converter_customization 
@variable_string_settables %document_settable_at_commands %def_map 
%command_structuring_level %level_to_structuring_command
 
 =over
 
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index b70cc742e3..e02f1f3ee4 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -268,12 +268,11 @@ my %line_commands             = 
%Texinfo::Commands::line_commands;
 my %brace_commands            = %Texinfo::Commands::brace_commands;
 my %commands_args_number      = %Texinfo::Commands::commands_args_number;
 my %accent_commands           = %Texinfo::Commands::accent_commands;
-my %context_brace_commands    = %Texinfo::Common::context_brace_commands;
 my %contain_plain_text_commands = 
%Texinfo::Commands::contain_plain_text_commands;
 my %contain_simple_text_commands = 
%Texinfo::Commands::contain_simple_text_commands;
 my %block_commands            = %Texinfo::Commands::block_commands;
 my %blockitem_commands        = %Texinfo::Commands::blockitem_commands;
-my %close_paragraph_commands  = %Texinfo::Common::close_paragraph_commands;
+my %close_paragraph_commands  = %Texinfo::Commands::close_paragraph_commands;
 my %def_commands              = %Texinfo::Commands::def_commands;
 my %def_alias_commands        = %Texinfo::Commands::def_alias_commands;
 my %preformatted_commands     = %Texinfo::Commands::preformatted_commands;
@@ -286,6 +285,7 @@ my %heading_spec_commands     = 
%Texinfo::Commands::heading_spec_commands;
 my %in_heading_spec_commands  = %Texinfo::Commands::in_heading_spec_commands;
 my %variadic_commands         = %Texinfo::Commands::variadic_commands;
 my %default_index_commands    = %Texinfo::Commands::default_index_commands;
+
 my %def_map                   = %Texinfo::Common::def_map;
 my %def_aliases               = %Texinfo::Common::def_aliases;
 my %in_index_commands         = %Texinfo::Common::in_index_commands;
diff --git a/tp/Texinfo/XS/parsetexi/command_data.txt 
b/tp/Texinfo/XS/parsetexi/command_data.txt
index 783ee596a3..4d73721519 100644
--- a/tp/Texinfo/XS/parsetexi/command_data.txt
+++ b/tp/Texinfo/XS/parsetexi/command_data.txt
@@ -94,23 +94,23 @@ alias                   line                            
LINE_specific  2
 # number of arguments is not known in advance.
 columnfractions         line                            LINE_specific
 # file names
-setfilename             line,global_unique              LINE_text
-verbatiminclude         line                            LINE_text
-include                 line                            LINE_text
+setfilename             line,close_paragraph,global_unique   LINE_text
+verbatiminclude         line,close_paragraph                 LINE_text
+include                 line                                 LINE_text
 
 raisesections           line                            LINE_skipline
 lowersections           line                            LINE_skipline
-contents                line,global                     LINE_skipline
-shortcontents           line,global                     LINE_skipline
-summarycontents         line,global                     LINE_skipline
-insertcopying           line,global                     LINE_skipline
+contents                line,close_paragraph,global     LINE_skipline
+shortcontents           line,close_paragraph,global     LINE_skipline
+summarycontents         line,close_paragraph,global     LINE_skipline
+insertcopying           line,close_paragraph,global     LINE_skipline
 # arg should be an @-command
 clickstyle              line,global                     LINE_special
 # more relevant in preamble
 documentencoding        line,global                     LINE_text
 novalidate              line,global_unique              LINE_skipline
 # Position with regard with direntry is significant
-dircategory             line                            LINE_line
+dircategory             line,close_paragraph            LINE_line
 # arg like 200mm,150mm or 11.5in
 pagesizes               line,global_unique              LINE_line
 finalout                line                            LINE_skipline
@@ -180,9 +180,9 @@ evenfootingmarks        line,global_unique              
LINE_specific  1
 oddfootingmarks         line,global_unique              LINE_specific  1
 
 # formatting
-center                  line                            LINE_line
-printindex              line,global                     LINE_specific  1
-listoffloats            line,global                     LINE_line
+center                  line,close_paragraph            LINE_line
+printindex              line,close_paragraph,global     LINE_specific  1
+listoffloats            line,close_paragraph,global     LINE_line
 # especially in titlepage
 #  shorttitle
 shorttitlepage          line,global_unique              LINE_line
@@ -191,19 +191,19 @@ author                  line,global                     
LINE_line
 subtitle                line,global                     LINE_line
 title                   line,global_unique              LINE_line
 # numerical arg
-sp                      line                            LINE_specific  1
-page                    line                            LINE_skipline
+sp                      line,close_paragraph            LINE_specific  1
+page                    line,close_paragraph            LINE_skipline
 # one numerical/real arg
-need                    line                            LINE_specific  1
+need                    line,close_paragraph            LINE_specific  1
 
 # not valid for info (should be in @iftex)
 vskip                   line                            LINE_lineraw
 
-exdent                  line                            LINE_line
+exdent                  line,close_paragraph            LINE_line
 
 # or nobrace skipspace, depending on the context
-item_LINE               line                            LINE_line
-itemx                   line                            LINE_line
+item_LINE               line,close_paragraph            LINE_line
+itemx                   line,close_paragraph            LINE_line
 
 subentry                line                            LINE_line
 
@@ -216,9 +216,9 @@ subentry                line                            
LINE_line
 # formatting
 noindent                nobrace                         NOBRACE_skipspace
 indent                  nobrace                         NOBRACE_skipspace
-headitem                nobrace                         NOBRACE_skipspace
-item                    nobrace                         NOBRACE_skipspace
-tab                     nobrace                         NOBRACE_skipspace
+headitem                nobrace,close_paragraph         NOBRACE_skipspace
+item                    nobrace,close_paragraph         NOBRACE_skipspace
+tab                     nobrace,close_paragraph         NOBRACE_skipspace
 # only valid in heading or footing
 thischapter             nobrace,in_heading_spec         NOBRACE_other
 thischaptername         nobrace,in_heading_spec         NOBRACE_other
@@ -378,13 +378,13 @@ w                       brace,contain_simple_text       
BRACE_special
 
 # other brace commands, leading and trailing spaces kept in main text
 dmn                     brace,contain_plain_text        BRACE_other         1
-titlefont               brace,global                    BRACE_other         1
+titlefont               brace,close_paragraph,global    BRACE_other         1
 
 # context brace commands - commands that enclose full texts
 # not in the main document context.  They can contain multiple paragraphs.
 footnote                brace,global                    BRACE_context
-caption                 brace                           BRACE_context
-shortcaption            brace                           BRACE_context
+caption                 brace,close_paragraph           BRACE_context
+shortcaption            brace,close_paragraph           BRACE_context
 # Commands that enclose math content, and, because of that, are not in the
 # main document context.
 math                    brace,math                      BRACE_context
@@ -419,107 +419,107 @@ image                   brace                           
BRACE_arguments     5
 # commands delimiting blocks, with an @end.
 
 # def* commands
-deffn                   block,def                       BLOCK_def
-defvr                   block,def                       BLOCK_def
-deftypefn               block,def                       BLOCK_def
-deftypeop               block,def                       BLOCK_def
-deftypevr               block,def                       BLOCK_def
-defcv                   block,def                       BLOCK_def
-deftypecv               block,def                       BLOCK_def
-defop                   block,def                       BLOCK_def
-deftp                   block,def                       BLOCK_def
+deffn                   block,def,close_paragraph       BLOCK_def
+defvr                   block,def,close_paragraph       BLOCK_def
+deftypefn               block,def,close_paragraph       BLOCK_def
+deftypeop               block,def,close_paragraph       BLOCK_def
+deftypevr               block,def,close_paragraph       BLOCK_def
+defcv                   block,def,close_paragraph       BLOCK_def
+deftypecv               block,def,close_paragraph       BLOCK_def
+defop                   block,def,close_paragraph       BLOCK_def
+deftp                   block,def,close_paragraph       BLOCK_def
 #   shortcuts
-defun                   block,def,def_alias             BLOCK_def
-defmac                  block,def,def_alias             BLOCK_def
-defspec                 block,def,def_alias             BLOCK_def
-defvar                  block,def,def_alias             BLOCK_def
-defopt                  block,def,def_alias             BLOCK_def
-deftypefun              block,def,def_alias             BLOCK_def
-deftypevar              block,def,def_alias             BLOCK_def
-defivar                 block,def,def_alias             BLOCK_def
-deftypeivar             block,def,def_alias             BLOCK_def
-defmethod               block,def,def_alias             BLOCK_def
-deftypemethod           block,def,def_alias             BLOCK_def
+defun                   block,def,def_alias,close_paragraph    BLOCK_def
+defmac                  block,def,def_alias,close_paragraph    BLOCK_def
+defspec                 block,def,def_alias,close_paragraph    BLOCK_def
+defvar                  block,def,def_alias,close_paragraph    BLOCK_def
+defopt                  block,def,def_alias,close_paragraph    BLOCK_def
+deftypefun              block,def,def_alias,close_paragraph    BLOCK_def
+deftypevar              block,def,def_alias,close_paragraph    BLOCK_def
+defivar                 block,def,def_alias,close_paragraph    BLOCK_def
+deftypeivar             block,def,def_alias,close_paragraph    BLOCK_def
+defmethod               block,def,def_alias,close_paragraph    BLOCK_def
+deftypemethod           block,def,def_alias,close_paragraph    BLOCK_def
 
 # def*x
-deffnx                  line,def                        LINE_line
-defvrx                  line,def                        LINE_line
-deftypefnx              line,def                        LINE_line
-deftypeopx              line,def                        LINE_line
-deftypevrx              line,def                        LINE_line
-defcvx                  line,def                        LINE_line
-deftypecvx              line,def                        LINE_line
-defopx                  line,def                        LINE_line
-deftpx                  line,def                        LINE_line
+deffnx                  line,def,close_paragraph        LINE_line
+defvrx                  line,def,close_paragraph        LINE_line
+deftypefnx              line,def,close_paragraph        LINE_line
+deftypeopx              line,def,close_paragraph        LINE_line
+deftypevrx              line,def,close_paragraph        LINE_line
+defcvx                  line,def,close_paragraph        LINE_line
+deftypecvx              line,def,close_paragraph        LINE_line
+defopx                  line,def,close_paragraph        LINE_line
+deftpx                  line,def,close_paragraph        LINE_line
 #   shortcuts
-defunx                  line,def,def_alias              LINE_line
-defmacx                 line,def,def_alias              LINE_line
-defspecx                line,def,def_alias              LINE_line
-defvarx                 line,def,def_alias              LINE_line
-defoptx                 line,def,def_alias              LINE_line
-deftypefunx             line,def,def_alias              LINE_line
-deftypevarx             line,def,def_alias              LINE_line
-defivarx                line,def,def_alias              LINE_line
-deftypeivarx            line,def,def_alias              LINE_line
-defmethodx              line,def,def_alias              LINE_line
-deftypemethodx          line,def,def_alias              LINE_line
-
-multitable              block,blockitem                 BLOCK_multitable
+defunx                  line,def,def_alias,close_paragraph     LINE_line
+defmacx                 line,def,def_alias,close_paragraph     LINE_line
+defspecx                line,def,def_alias,close_paragraph     LINE_line
+defvarx                 line,def,def_alias,close_paragraph     LINE_line
+defoptx                 line,def,def_alias,close_paragraph     LINE_line
+deftypefunx             line,def,def_alias,close_paragraph     LINE_line
+deftypevarx             line,def,def_alias,close_paragraph     LINE_line
+defivarx                line,def,def_alias,close_paragraph     LINE_line
+deftypeivarx            line,def,def_alias,close_paragraph     LINE_line
+defmethodx              line,def,def_alias,close_paragraph     LINE_line
+deftypemethodx          line,def,def_alias,close_paragraph     LINE_line
+
+multitable              block,close_paragraph,blockitem BLOCK_multitable
 
 # menu commands in which menu entry and menu comments appear
-menu                    block                           BLOCK_menu
-detailmenu              block,global                    BLOCK_menu
-direntry                block                           BLOCK_menu
+menu                    block,close_paragraph           BLOCK_menu
+detailmenu              block,close_paragraph,global    BLOCK_menu
+direntry                block,close_paragraph           BLOCK_menu
 
 # align commands
-raggedright             block
-flushleft               block
-flushright              block
-indentedblock           block
-smallindentedblock      block
+raggedright             block,close_paragraph
+flushleft               block,close_paragraph
+flushright              block,close_paragraph
+indentedblock           block,close_paragraph
+smallindentedblock      block,close_paragraph
 
-cartouche               block
-group                   block
+cartouche               block,close_paragraph
+group                   block,close_paragraph
 
 # region commands
-titlepage               block,global_unique             BLOCK_region
-copying                 block,global_unique             BLOCK_region
-documentdescription     block,global_unique             BLOCK_region
+titlepage               block,close_paragraph,global_unique       BLOCK_region
+copying                 block,close_paragraph,global_unique       BLOCK_region
+documentdescription     block,close_paragraph,global_unique       BLOCK_region
 
 # preformatted commands
-example                 block,preformatted,preformatted_code,variadic   
BLOCK_preformatted
-smallexample            block,preformatted,preformatted_code            
BLOCK_preformatted
-lisp                    block,preformatted,preformatted_code            
BLOCK_preformatted
-smalllisp               block,preformatted,preformatted_code            
BLOCK_preformatted
-display                 block,preformatted              BLOCK_preformatted
-smalldisplay            block,preformatted              BLOCK_preformatted
-format                  block,preformatted              BLOCK_preformatted
-smallformat             block,preformatted              BLOCK_preformatted
+example           
block,close_paragraph,preformatted,preformatted_code,variadic   
BLOCK_preformatted
+smallexample      block,close_paragraph,preformatted,preformatted_code         
   BLOCK_preformatted
+lisp              block,close_paragraph,preformatted,preformatted_code         
   BLOCK_preformatted
+smalllisp         block,close_paragraph,preformatted,preformatted_code         
   BLOCK_preformatted
+display           block,close_paragraph,preformatted      BLOCK_preformatted
+smalldisplay      block,close_paragraph,preformatted      BLOCK_preformatted
+format            block,close_paragraph,preformatted      BLOCK_preformatted
+smallformat       block,close_paragraph,preformatted      BLOCK_preformatted
 
 # format raw commands
-html                    block                           BLOCK_format_raw
-tex                     block                           BLOCK_format_raw
-xml                     block                           BLOCK_format_raw
-docbook                 block                           BLOCK_format_raw
-latex                   block                           BLOCK_format_raw
+html                    block                             BLOCK_format_raw
+tex                     block                             BLOCK_format_raw
+xml                     block                             BLOCK_format_raw
+docbook                 block                             BLOCK_format_raw
+latex                   block                             BLOCK_format_raw
 
 # raw commands
-verbatim                block                           BLOCK_raw
-ignore                  block                           BLOCK_raw
-macro                   block                           BLOCK_raw
-rmacro                  block                           BLOCK_raw
+verbatim                block,close_paragraph             BLOCK_raw
+ignore                  block                             BLOCK_raw
+macro                   block                             BLOCK_raw
+rmacro                  block                             BLOCK_raw
 
-table                   block,blockitem                 BLOCK_item_line       1
-ftable                  block,blockitem                 BLOCK_item_line       1
-vtable                  block,blockitem                 BLOCK_item_line       1
-itemize                 block,blockitem                 BLOCK_item_container  1
-enumerate               block,blockitem                 BLOCK_item_container  1
-quotation               block                           BLOCK_quotation       1
-smallquotation          block                           BLOCK_quotation       1
+table                   block,close_paragraph,blockitem   BLOCK_item_line      
 1
+ftable                  block,close_paragraph,blockitem   BLOCK_item_line      
 1
+vtable                  block,close_paragraph,blockitem   BLOCK_item_line      
 1
+itemize                 block,close_paragraph,blockitem   BLOCK_item_container 
 1
+enumerate               block,close_paragraph,blockitem   BLOCK_item_container 
 1
+quotation               block,close_paragraph             BLOCK_quotation      
 1
+smallquotation          block,close_paragraph             BLOCK_quotation      
 1
 
-float                   block                           BLOCK_float           2
+float                   block,close_paragraph             BLOCK_float          
 2
 
-displaymath             block,math                      BLOCK_math
+displaymath             block,close_paragraph,math        BLOCK_math
 
 ##################################################################
 # Conditional commands
@@ -544,27 +544,27 @@ ifcommandnotdefined     block                           
BLOCK_conditional
 
 ##########################################################
 # Root commands
-node                    root,line                               LINE_line     4
-top                     root,line,sectioning_heading,global_unique   LINE_line
-chapter                 root,line,sectioning_heading            LINE_line
-unnumbered              root,line,sectioning_heading            LINE_line
-chapheading             line,sectioning_heading                 LINE_line
-appendix                root,line,sectioning_heading            LINE_line
-section                 root,line,sectioning_heading            LINE_line
-unnumberedsec           root,line,sectioning_heading            LINE_line
-heading                 line,sectioning_heading                 LINE_line
-appendixsec             root,line,sectioning_heading            LINE_line
-subsection              root,line,sectioning_heading            LINE_line
-unnumberedsubsec        root,line,sectioning_heading            LINE_line
-subheading              line,sectioning_heading                 LINE_line
-appendixsubsec          root,line,sectioning_heading            LINE_line
-subsubsection           root,line,sectioning_heading            LINE_line
-unnumberedsubsubsec     root,line,sectioning_heading            LINE_line
-subsubheading           line,sectioning_heading                 LINE_line
-appendixsubsubsec       root,line,sectioning_heading            LINE_line
-
-part                    root,line,sectioning_heading,global     LINE_line
-appendixsection         root,line,sectioning_heading            LINE_line
-majorheading            line,sectioning_heading                 LINE_line
-centerchap              root,line,sectioning_heading,deprecated LINE_line
+node                    line,root                                  LINE_line   
  4
+top                     line,root,sectioning_heading,global_unique   LINE_line
+chapter                 line,root,sectioning_heading               LINE_line
+unnumbered              line,root,sectioning_heading               LINE_line
+chapheading             line,sectioning_heading,close_paragraph    LINE_line
+appendix                line,root,sectioning_heading               LINE_line
+section                 line,root,sectioning_heading               LINE_line
+unnumberedsec           line,root,sectioning_heading               LINE_line
+heading                 line,sectioning_heading,close_paragraph    LINE_line
+appendixsec             line,root,sectioning_heading               LINE_line
+subsection              line,root,sectioning_heading               LINE_line
+unnumberedsubsec        line,root,sectioning_heading               LINE_line
+subheading              line,sectioning_heading,close_paragraph    LINE_line
+appendixsubsec          line,root,sectioning_heading               LINE_line
+subsubsection           line,root,sectioning_heading               LINE_line
+unnumberedsubsubsec     line,root,sectioning_heading               LINE_line
+subsubheading           line,sectioning_heading,close_paragraph    LINE_line
+appendixsubsubsec       line,root,sectioning_heading               LINE_line
+
+part                    line,root,sectioning_heading,global        LINE_line
+appendixsection         line,root,sectioning_heading               LINE_line
+majorheading            line,sectioning_heading,close_paragraph    LINE_line
+centerchap              line,root,sectioning_heading,deprecated    LINE_line
 
diff --git a/tp/Texinfo/XS/parsetexi/commands.c 
b/tp/Texinfo/XS/parsetexi/commands.c
index 684895ddc5..943afa42fa 100644
--- a/tp/Texinfo/XS/parsetexi/commands.c
+++ b/tp/Texinfo/XS/parsetexi/commands.c
@@ -130,63 +130,11 @@ wipe_user_commands (void)
   user_defined_number = 0;
 }
 
-/* Commands that terminate a paragraph. */
-/* We may replace this function with a macro, or represent this infomation in
-   command_data. */
-int
-close_paragraph_command (enum command_id cmd)
-{
-  if (cmd == CM_verbatim)
-    return 1;
-
-  /* Block commands except 'raw' and 'conditional'.  */
-
-  if (command_data(cmd).flags & CF_block)
-    {
-      if (command_data(cmd).data == BLOCK_conditional
-          || command_data(cmd).data == BLOCK_raw
-          || command_data(cmd).data == BLOCK_format_raw)
-        return 0;
-      return 1;
-    }
-
-  if (cmd == CM_titlefont
-     || cmd == CM_insertcopying
-     || cmd == CM_sp
-     || cmd == CM_verbatiminclude
-     || cmd == CM_need
-     || cmd == CM_page
-     || cmd == CM_item
-     || cmd == CM_itemx
-     || cmd == CM_tab
-     || cmd == CM_headitem
-     || cmd == CM_printindex
-     || cmd == CM_listoffloats
-     || cmd == CM_center
-     || cmd == CM_dircategory
-     || cmd == CM_contents
-     || cmd == CM_shortcontents
-     || cmd == CM_summarycontents
-     || cmd == CM_caption
-     || cmd == CM_shortcaption
-     || cmd == CM_setfilename
-     || cmd == CM_exdent)
-    return 1;
-
-  if ((command_data(cmd).flags & CF_sectioning_heading)
-      && !(command_data(cmd).flags & CF_root))
-    return 1;
-
-  if ((command_data(cmd).flags & CF_def))
-    return 1;
-
-  return 0;
-}
-
 int
 close_preformatted_command (enum command_id cmd_id)
 {
-  return cmd_id != CM_sp && close_paragraph_command (cmd_id);
+  return cmd_id != CM_sp
+          && command_data(cmd_id).flags & CF_close_paragraph;
 }
 
 int
diff --git a/tp/Texinfo/XS/parsetexi/commands.h 
b/tp/Texinfo/XS/parsetexi/commands.h
index bc7686dcd2..fd06251d03 100644
--- a/tp/Texinfo/XS/parsetexi/commands.h
+++ b/tp/Texinfo/XS/parsetexi/commands.h
@@ -39,7 +39,6 @@ enum command_id lookup_command (char *cmdname);
 #define command_flags(e) (!(e) ? 0 : (command_data((e)->cmd).flags))
 #define command_name(cmd) (command_data(cmd).cmdname)
 
-int close_paragraph_command (enum command_id cmd_id);
 int close_preformatted_command (enum command_id cmd_id);
 int item_line_command (enum command_id cmd_id);
 enum command_id add_texinfo_command (char *name);
@@ -77,8 +76,8 @@ void wipe_user_commands (void);
 #define CF_def_alias                   0x00040000
 /* only accept plain text, ie only accent, symbol and glyph commands */
 #define CF_contain_plain_text          0x00080000
-/* CF_align is not used */
-#define CF_align                       0x00100000
+/* CF_close_paragraph commands that forces closing an opened paragraph */
+#define CF_close_paragraph             0x00100000
 #define CF_contain_simple_text         0x00200000
 #define CF_preformatted                        0x00400000
 #define CF_preformatted_code           0x00800000
@@ -97,9 +96,6 @@ void wipe_user_commands (void);
 
 /* NOTE: We often run out of spaces for flags
 
-   Candidates for flags:
-     CF_close_paragraph
-
    Could combine CF_MACRO, CF_ALIAS, and CF_INFOENCLOSE into 2 bits.
  */
 
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 17f8997578..e77556aa1d 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -451,7 +451,7 @@ begin_paragraph (ELEMENT *current)
               if (child->type == ET_empty_line
                   || child->type == ET_paragraph)
                 break;
-              if (close_paragraph_command(child->cmd))
+              if (command_data(child->cmd).flags & CF_close_paragraph)
                 break;
               if (child->cmd == CM_indent
                   || child->cmd == CM_noindent)
@@ -1820,7 +1820,7 @@ value_invalid:
 
       if (cmd)
         {
-          if (close_paragraph_command (cmd))
+          if (command_data(cmd).flags & CF_close_paragraph)
             current = end_paragraph (current, 0, 0);
           if (close_preformatted_command (cmd))
             current = end_preformatted (current, 0, 0);



reply via email to

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