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/Convert/DocBoo


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Common.pm, tp/Texinfo/Convert/DocBook.pm (converter_initialize, _convert), tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/Plaintext.pm (_convert), tp/Texinfo/Convert/TexinfoMarkup.pm, tp/Texinfo/ParserNonXS.pm (_close_current, _end_line) (_process_remaining_on_line, _parse_texi), tp/Texinfo/XS/parsetexi/close.c (close_current, close_commands), tp/Texinfo/XS/parsetexi/command_data.txt, tp/Texinfo/XS/parsetexi/commands.c (close_paragraph_command), tp [...]
Date: Mon, 26 Sep 2022 18:51:04 -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 7ec42e7f7f * tp/Texinfo/Common.pm, tp/Texinfo/Convert/DocBook.pm 
(converter_initialize, _convert), tp/Texinfo/Convert/HTML.pm, 
tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/Plaintext.pm (_convert), 
tp/Texinfo/Convert/TexinfoMarkup.pm, tp/Texinfo/ParserNonXS.pm (_close_current, 
_end_line) (_process_remaining_on_line, _parse_texi), 
tp/Texinfo/XS/parsetexi/close.c (close_current, close_commands), 
tp/Texinfo/XS/parsetexi/command_data.txt, tp/Texinfo/XS/parsetexi/commands.c 
(close_p [...]
7ec42e7f7f is described below

commit 7ec42e7f7f0bcafcb2a668cdb64203c58306bf3e
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Sep 27 00:50:54 2022 +0200

    * tp/Texinfo/Common.pm, tp/Texinfo/Convert/DocBook.pm
    (converter_initialize, _convert), tp/Texinfo/Convert/HTML.pm,
    tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/Plaintext.pm
    (_convert), tp/Texinfo/Convert/TexinfoMarkup.pm,
    tp/Texinfo/ParserNonXS.pm (_close_current, _end_line)
    (_process_remaining_on_line, _parse_texi),
    tp/Texinfo/XS/parsetexi/close.c (close_current, close_commands),
    tp/Texinfo/XS/parsetexi/command_data.txt,
    tp/Texinfo/XS/parsetexi/commands.c (close_paragraph_command),
    tp/Texinfo/XS/parsetexi/commands.h, tp/Texinfo/XS/parsetexi/end_line.c
    (end_line_starting_block), tp/Texinfo/XS/parsetexi/handle_commands.c
    (handle_block_command), tp/Texinfo/XS/parsetexi/parser.c
    (check_valid_nesting, process_remaining_on_line):
    remove %raw_commands and %format_raw_commands, use %block_commands
    values instead, adding 'format_raw'.  In XS Parser, set and use
    BLOCK_format_raw instead of the flag CF_format_raw.  In some
    converters, set %format_raw_commands locally.
---
 ChangeLog                                 | 20 +++++++
 tp/Texinfo/Common.pm                      | 97 +++++++++++++++++++------------
 tp/Texinfo/Convert/DocBook.pm             |  5 +-
 tp/Texinfo/Convert/HTML.pm                |  5 +-
 tp/Texinfo/Convert/LaTeX.pm               | 16 ++---
 tp/Texinfo/Convert/Plaintext.pm           |  8 ++-
 tp/Texinfo/Convert/TexinfoMarkup.pm       |  3 +-
 tp/Texinfo/ParserNonXS.pm                 | 43 +++++++-------
 tp/Texinfo/XS/parsetexi/close.c           |  4 +-
 tp/Texinfo/XS/parsetexi/command_data.txt  | 10 ++--
 tp/Texinfo/XS/parsetexi/commands.c        |  6 +-
 tp/Texinfo/XS/parsetexi/commands.h        |  7 +++
 tp/Texinfo/XS/parsetexi/end_line.c        |  2 +-
 tp/Texinfo/XS/parsetexi/handle_commands.c |  2 +-
 tp/Texinfo/XS/parsetexi/parser.c          |  6 +-
 15 files changed, 143 insertions(+), 91 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 782fb2cdcc..f132290d01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2022-09-26  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Common.pm, tp/Texinfo/Convert/DocBook.pm
+       (converter_initialize, _convert), tp/Texinfo/Convert/HTML.pm,
+       tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/Plaintext.pm
+       (_convert), tp/Texinfo/Convert/TexinfoMarkup.pm,
+       tp/Texinfo/ParserNonXS.pm (_close_current, _end_line)
+       (_process_remaining_on_line, _parse_texi),
+       tp/Texinfo/XS/parsetexi/close.c (close_current, close_commands),
+       tp/Texinfo/XS/parsetexi/command_data.txt,
+       tp/Texinfo/XS/parsetexi/commands.c (close_paragraph_command),
+       tp/Texinfo/XS/parsetexi/commands.h, tp/Texinfo/XS/parsetexi/end_line.c
+       (end_line_starting_block), tp/Texinfo/XS/parsetexi/handle_commands.c
+       (handle_block_command), tp/Texinfo/XS/parsetexi/parser.c
+       (check_valid_nesting, process_remaining_on_line):
+       remove %raw_commands and %format_raw_commands, use %block_commands
+       values instead, adding 'format_raw'.  In XS Parser, set and use
+       BLOCK_format_raw instead of the flag CF_format_raw.  In some
+       converters, set %format_raw_commands locally.
+
 2022-09-26  Werner Lemberg  <wl@gnu.org>
 
        * doc/texinfo.tex: Add character protrusion support for XeTeX.
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index d5c60a6182..cab0e1f471 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -958,25 +958,24 @@ foreach my $block_math_command('displaymath') {
   $math_commands{$block_math_command} = 1;
 }
 
-our %format_raw_commands;
-foreach my $format_raw_command('html', 'tex', 'xml', 'docbook', 'latex') {
-  $block_commands{$format_raw_command} = 'format';
-  $format_raw_commands{$format_raw_command} = 1;
-}
-
-our %raw_commands;
 # macro/rmacro are special
-foreach my $raw_command ('verbatim',
-                         'ignore', 'macro', 'rmacro') {
+foreach my $raw_command ('verbatim', 'ignore', 'macro', 'rmacro') {
   $block_commands{$raw_command} = 'raw';
-  $raw_commands{$raw_command} = 1;
 }
 
 our %texinfo_output_formats;
-foreach my $command (keys(%format_raw_commands), 'info', 'plaintext') {
+foreach my $format_raw_command('html', 'tex', 'xml', 'docbook', 'latex') {
+  $block_commands{$format_raw_command} = 'format_raw';
+  $texinfo_output_formats{$format_raw_command} = $format_raw_command;
+}
+
+foreach my $output_format_command ('info', 'plaintext') {
+  $texinfo_output_formats{$output_format_command} = $output_format_command;
+}
+
+foreach my $command (keys(%texinfo_output_formats)) {
   $block_commands{'if' . $command} = 'conditional';
   $block_commands{'ifnot' . $command} = 'conditional';
-  $texinfo_output_formats{$command} = $command;
 }
 
 $block_commands{'ifset'} = 'conditional';
@@ -1010,9 +1009,9 @@ our %close_paragraph_commands;
 
 foreach my $block_command (keys(%block_commands)) {
   $close_paragraph_commands{$block_command} = 1
-     unless ($block_commands{$block_command} eq 'raw' or
-             $block_commands{$block_command} eq 'conditional'
-             or $format_raw_commands{$block_command});
+     unless ($block_commands{$block_command} eq 'raw'
+             or $block_commands{$block_command} eq 'conditional'
+             or $block_commands{$block_command} eq 'format_raw');
 }
 
 $close_paragraph_commands{'verbatim'} = 1;
@@ -1171,7 +1170,8 @@ foreach my $command (
 our %preamble_commands;
 foreach my $preamble_command ('direnty', 'hyphenation', 'errormsg',
        'inlineraw', '*', keys(%document_settable_at_commands),
-       keys(%format_raw_commands), keys(%inline_commands),
+       (grep {$block_commands{$_} eq 'format_raw'} keys(%block_commands)),
+       keys(%inline_commands),
        keys(%unformatted_block_commands), keys(%misc_commands),
        keys(%region_commands)) {
   $preamble_commands{$preamble_command} = 1;
@@ -2908,7 +2908,7 @@ described in L<Texinfo::Parser/indices_information>.
 X<C<%texinfo_output_formats>>
 
 Cannonical output formats that have associated conditionals.  In
-practice corresponds to C<%format_raw_commands> plus C<info>
+practice corresponds to C<format_raw> C<%block_commands> plus C<info>
 and C<plaintext>.
 
 =back
@@ -2942,15 +2942,48 @@ X<C<%align_commands>>
 =item %block_commands
 X<C<%block_commands>>
 
-Commands delimiting a block with a closing C<@end>.  The value
-is I<conditional> for C<@if> commands, I<def> for definition
-commands like C<@deffn>, I<raw> for @-commands that have no expansion
-of @-commands in their bodies (C<@macro>, C<@verbatim> and C<@ignore>),
-I<multitable> for C<@multitable>, I<menu> for C<@menu>, C<@detailmenu>
-and C<@direntry>, I<item_container> for commands with C<@item> containing
-any content, C<@itemize> and C<@enumerate>, I<item_line> for commands
-like C<@table> in which the C<@item> argument is on its line
- and other values for other block line commands.
+Commands delimiting a block with a closing C<@end>.  The values are:
+
+=over
+
+=item I<conditional>
+
+C<@if*> commands;
+
+=item I<def>
+
+Definition commands like C<@deffn>;
+
+=item I<format_raw>
+
+raw output format commands such as C<@html> or C<@info>;
+
+=item I<item_container>
+
+commands  with C<@item> containing
+any content, C<@itemize> and C<@enumerate>;
+
+=item I<item_line>
+
+commands like C<@table> in which the C<@item> argument is on its line;
+
+=item I<menu>
+
+menu @-commands, C<@menu>, C<@detailmenu>
+and C<@direntry>;
+
+=item I<multitable>
+
+C<@multitable>;
+
+=item I<raw>
+
+@-commands that have no expansion
+of @-commands in their bodies (C<@macro>, C<@verbatim> and C<@ignore>);
+
+=back
+
+Other values for other block line commands.
 
 =item %block_commands_args_number
 X<C<%block_commands_args_number>>
@@ -3007,12 +3040,6 @@ X<C<%explained_commands>>
 @-commands whose second argument explain first argument and further
 @-command call without first argument, as C<@abbr> and C<@acronym>.
 
-=item %format_raw_commands
-X<C<%format_raw_commands>>
-
-@-commands associated with raw output format, like C<@html>, or
-C<@docbook>.
-
 =item %headings_specification_commands
 X<C<%headings_specification_commands>>
 
@@ -3072,12 +3099,6 @@ I<%preformatted_commands> is for commands whose content 
should not
 be filled, like C<@example> or C<@display>.  If the command is meant
 for code, it is also in I<%preformatted_code_commands>, like C<@example>.
 
-=item %raw_commands
-X<C<%raw_commands>>
-
-@-commands that have no expansion of @-commands in their bodies,
-as C<@macro>, C<@verbatim> or C<@ignore>.
-
 =item %ref_commands
 X<C<%ref_commands>>
 
diff --git a/tp/Texinfo/Convert/DocBook.pm b/tp/Texinfo/Convert/DocBook.pm
index 1b6614c1be..931ecdffd2 100644
--- a/tp/Texinfo/Convert/DocBook.pm
+++ b/tp/Texinfo/Convert/DocBook.pm
@@ -270,7 +270,8 @@ sub converter_initialize($)
 
   $self->{'document_context'} = [{'monospace' => [0], 'upper_case' => [0]}];
   $self->{'context_block_commands'} = {%default_context_block_commands};
-  foreach my $raw (keys (%Texinfo::Common::format_raw_commands)) {
+  foreach my $raw (grep {$Texinfo::Common::block_commands{$_} eq 'format_raw'}
+                        keys(%Texinfo::Common::block_commands)) {
     $self->{'context_block_commands'}->{$raw} = 1
          if $self->{'expanded_formats_hash'}->{$raw};
   }
@@ -1553,7 +1554,7 @@ sub _convert($$;$)
         }
         $format_element = 'blockquote' if (!defined($format_element));
         push @format_elements, $format_element;
-      } elsif ($Texinfo::Common::format_raw_commands{$element->{'cmdname'}}) {
+      } elsif ($Texinfo::Common::block_commands{$element->{'cmdname'}} eq 
'format_raw') {
         return '' if 
(!$self->{'expanded_formats_hash'}->{$element->{'cmdname'}});
         # the context is here only for the command, so this is forgotten
         # once all the raw internal text has been formatted
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 9fb9676045..a9d3e6111b 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -108,8 +108,6 @@ my %root_commands = %Texinfo::Common::root_commands;
 my %preformatted_commands = %Texinfo::Common::preformatted_commands;
 my %math_commands = %Texinfo::Common::math_commands;
 my %explained_commands = %Texinfo::Common::explained_commands;
-my %raw_commands = %Texinfo::Common::raw_commands;
-my %format_raw_commands = %Texinfo::Common::format_raw_commands;
 my %inline_commands = %Texinfo::Common::inline_commands;
 my %inline_format_commands = %Texinfo::Common::inline_format_commands;
 my %brace_code_commands       = %Texinfo::Common::brace_code_commands;
@@ -135,9 +133,12 @@ foreach my $misc_context_command('tab', 'item', 'itemx', 
'headitem') {
 my %composition_context_commands = (%preformatted_commands, %root_commands,
   %align_commands);
 $composition_context_commands{'float'} = 1;
+my %format_raw_commands;
 foreach my $block_command (keys(%block_commands)) {
   $composition_context_commands{$block_command} = 1
     if ($block_commands{$block_command} eq 'menu');
+  $format_raw_commands{$block_command} = 1
+    if ($block_commands{$block_command} eq 'format_raw');
 }
 
 # FIXME allow customization? (also in DocBook)
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 61a5de5d8a..ded0ac7609 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -229,7 +229,6 @@ my %math_commands = %Texinfo::Common::math_commands;
 my %explained_commands = %Texinfo::Common::explained_commands;
 my %inline_format_commands = %Texinfo::Common::inline_format_commands;
 my %inline_commands = %Texinfo::Common::inline_commands;
-my %format_raw_commands = %Texinfo::Common::format_raw_commands;
 my %brace_code_commands       = %Texinfo::Common::brace_code_commands;
 my %preformatted_code_commands = %Texinfo::Common::preformatted_code_commands;
 my %default_index_commands = %Texinfo::Common::default_index_commands;
@@ -259,11 +258,6 @@ foreach my $def_command (keys(%def_commands)) {
 #                (no text protection). Inside formatting_context.
 
 
-my %block_raw_commands = %format_raw_commands;
-foreach my $block_raw_command ('verbatim') {
-  $block_raw_commands{$block_raw_command} = 1
-}
-
 my %block_math_commands;
 foreach my $block_math_command (keys(%math_commands)) {
   if (exists($block_commands{$block_math_command})) {
@@ -480,11 +474,19 @@ my %LaTeX_list_environments = (
   'enumerate' => 'enumerate',
 );
 
+my %format_raw_commands;
 foreach my $block_command (keys(%block_commands)) {
   $ignored_commands{$block_command} = 1
     if ($block_commands{$block_command} eq 'menu');
   $LaTeX_list_environments{$block_command} = 'description'
     if ($block_commands{$block_command} eq 'item_line');
+  $format_raw_commands{$block_command} = 1
+    if ($block_commands{$block_command} eq 'format_raw');
+}
+
+my %block_raw_commands = %format_raw_commands;
+foreach my $block_raw_command ('verbatim') {
+  $block_raw_commands{$block_raw_command} = 1
 }
 
 my @LaTeX_same_block_commands = (
@@ -1376,7 +1378,7 @@ roundcorner=10pt}
   # textcomp for \textdegree in older LaTeX
   # graphicx for \includegraphics
   # needspace for \needspace. In texlive-latex-extra in debian
-  # etoolbox for \patchcmd, \ifstrempty \and AtBeginEnvironment.
+  # etoolbox for \patchcmd, \ifstrempty and \AtBeginEnvironment.
   # In texlive-latex-recommended in debian
   # fontsize for \changefontsize. In texlive-latex-extra in debian
   # mdframed is used for the formatting of @cartouche,
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 985cf45cc3..4085f088aa 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -101,8 +101,6 @@ my %math_commands = %Texinfo::Common::math_commands;
 my %explained_commands = %Texinfo::Common::explained_commands;
 my %inline_format_commands = %Texinfo::Common::inline_format_commands;
 my %inline_commands = %Texinfo::Common::inline_commands;
-my %raw_commands = %Texinfo::Common::raw_commands;
-my %format_raw_commands = %Texinfo::Common::format_raw_commands;
 my %brace_code_commands       = %Texinfo::Common::brace_code_commands;
 my %preformatted_code_commands = %Texinfo::Common::preformatted_code_commands;
 my %default_index_commands = %Texinfo::Common::default_index_commands;
@@ -163,9 +161,12 @@ foreach my $def_command (keys(%def_commands)) {
 
 my %menu_commands;
 
+my %format_raw_commands;
 foreach my $block_command (keys(%block_commands)) {
   $menu_commands{$block_command} = 1
     if ($block_commands{$block_command} eq 'menu');
+  $format_raw_commands{$block_command} = 1
+    if ($block_commands{$block_command} eq 'format_raw');
 }
 
 my %default_preformatted_context_commands = (%preformatted_commands,
@@ -2425,7 +2426,8 @@ sub _convert($$)
         push @{$self->{'context'}}, $command;
       } elsif ($flush_commands{$command}) {
         push @{$self->{'context'}}, $command;
-      } elsif ($raw_commands{$command} or $block_math_commands{$command}) {
+      } elsif ($block_commands{$command} eq 'raw' # can only be @verbatim in 
practice
+               or $block_math_commands{$command}) {
         if (!$self->{'formatters'}->[-1]->{'_top_formatter'}) {
           # reuse the current formatter if not in top level
           $result .= _count_added($self, $formatter->{'container'},
diff --git a/tp/Texinfo/Convert/TexinfoMarkup.pm 
b/tp/Texinfo/Convert/TexinfoMarkup.pm
index 20fd6c9f21..c0fb00a728 100644
--- a/tp/Texinfo/Convert/TexinfoMarkup.pm
+++ b/tp/Texinfo/Convert/TexinfoMarkup.pm
@@ -258,7 +258,8 @@ sub converter_initialize($)
 
   $self->{'document_context'} = [{'monospace' => [0]}];
   $self->{'context_block_commands'} = {%default_context_block_commands};
-  foreach my $raw (keys (%Texinfo::Common::format_raw_commands)) {
+  foreach my $raw (grep {$Texinfo::Common::block_commands{$_} eq 'format_raw'}
+                        keys(%Texinfo::Common::block_commands)) {
     $self->{'context_block_commands'}->{$raw} = 1
          if $self->{'expanded_formats_hash'}->{$raw};
   }
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index e4bbd78199..2ebb368398 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -273,7 +273,6 @@ my %def_commands              = 
%Texinfo::Common::def_commands;
 my %def_aliases               = %Texinfo::Common::def_aliases;
 my %preformatted_commands     = %Texinfo::Common::preformatted_commands;
 my %math_commands             = %Texinfo::Common::math_commands;
-my %format_raw_commands       = %Texinfo::Common::format_raw_commands;
 my %deprecated_commands       = %Texinfo::Common::deprecated_commands;
 my %root_commands             = %Texinfo::Common::root_commands;
 my %sectioning_heading_commands     = 
%Texinfo::Common::sectioning_heading_commands;
@@ -362,19 +361,18 @@ foreach my $not_begin_line_command ('comment', 'c', 'sp', 
'columnfractions',
   delete $begin_line_commands{$not_begin_line_command};
 }
 
-foreach my $block_command (keys(%block_commands)) {
-  $begin_line_commands{$block_command} = 1;
-  $default_no_paragraph_commands{$block_command} = 1;
-}
-
 my %close_preformatted_commands = %close_paragraph_commands;
 foreach my $no_close_preformatted('sp') {
   delete $close_preformatted_commands{$no_close_preformatted};
 }
-# FIXME to close preformated or not to close?
-#foreach my $format_raw_command(keys(%format_raw_commands)) {
-#  $close_preformatted_commands{$format_raw_command} = 1;
-#}
+
+foreach my $block_command (keys(%block_commands)) {
+  $begin_line_commands{$block_command} = 1;
+  $default_no_paragraph_commands{$block_command} = 1;
+  # FIXME to close preformated or not to close?
+  #$close_preformatted_commands{$format_raw_command} = 1
+  #  if ($brace_commands{$format_raw_command}) eq 'format_raw');
+}
 
 # commands that may appear in accents
 my %in_accent_commands = %accent_commands;
@@ -398,7 +396,8 @@ foreach my $in_full_text_command ('c', 'comment', 'refill', 
'subentry',
   $in_full_text_commands{$in_full_text_command} = 1;
 }
 
-foreach my $out_format (keys(%format_raw_commands)) {
+foreach my $out_format (grep {$block_commands{$_} eq 'format_raw'}
+                             keys(%block_commands)) {
   $in_full_text_commands{$out_format} = 1;
 }
 delete $in_full_text_commands{'caption'};
@@ -1786,7 +1785,7 @@ sub _close_current($$$;$$)
       if ($preformatted_commands{$current->{'cmdname'}}
           or $block_commands{$current->{'cmdname'}} eq 'menu') {
         $self->_pop_context(['ct_preformatted'], $source_info, $current);
-      } elsif ($format_raw_commands{$current->{'cmdname'}}) {
+      } elsif ($block_commands{$current->{'cmdname'}} eq 'format_raw') {
         $self->_pop_context(['ct_rawpreformatted'], $source_info, $current);
       } elsif ($math_commands{$current->{'cmdname'}}) {
         $self->_pop_context(['ct_math'], $source_info, $current);
@@ -1881,7 +1880,7 @@ sub _close_commands($$$;$$)
         or $block_commands{$current->{'cmdname'}} eq 'menu') {
       $self->_pop_context(['ct_preformatted'], $source_info, $current,
                           "for $closed_command");
-    } elsif ($format_raw_commands{$current->{'cmdname'}}) {
+    } elsif ($block_commands{$current->{'cmdname'}} eq 'format_raw') {
       $self->_pop_context(['ct_rawpreformatted'], $source_info, $current,
                           "for $closed_command");
     } elsif ($math_commands{$current->{'cmdname'}}) {
@@ -3200,7 +3199,8 @@ sub _end_line($$$)
       $current = $current->{'contents'}->[-1];
       print STDERR "MENU_COMMENT OPEN\n" if ($self->{'DEBUG'});
     }
-    if ($current->{'cmdname'} and $format_raw_commands{$current->{'cmdname'}}
+    if ($current->{'cmdname'}
+        and $block_commands{$current->{'cmdname'}} eq 'format_raw'
         and $self->{'expanded_formats_hash'}->{$current->{'cmdname'}}) {
       push @{$current->{'contents'}},
           { 'type' => 'rawpreformatted',
@@ -4019,7 +4019,8 @@ sub _process_remaining_on_line($$$$)
       goto funexit;
     }
   } elsif ($current->{'cmdname'}
-           and $format_raw_commands{$current->{'cmdname'}}
+           and $block_commands{$current->{'cmdname'}}
+           and $block_commands{$current->{'cmdname'}} eq 'format_raw'
            and not $self->{'expanded_formats_hash'}->{$current->{'cmdname'}}) {
     push @{$current->{'contents'}}, { 'type' => 'elided_block',
                                       'parent' => $current };
@@ -5042,7 +5043,7 @@ sub _process_remaining_on_line($$$$)
           $self->_push_context('ct_preformatted', $command);
         } elsif ($math_commands{$command}) {
           $self->_push_context('ct_math', $command);
-        } elsif ($format_raw_commands{$command}) {
+        } elsif ($block_commands{$command} eq 'format_raw') {
           $self->_push_context('ct_rawpreformatted', $command);
         }
         if ($region_commands{$command}) {
@@ -5721,15 +5722,13 @@ sub _parse_texi($$$)
         # 'raw' command or ignored conditional or verb or ignored raw format
           (($current->{'cmdname'}
            and $block_commands{$current->{'cmdname'}}
-            and ($block_commands{$current->{'cmdname'}} eq 'raw'
-                 or $block_commands{$current->{'cmdname'}} eq 'conditional'))
+           and ($block_commands{$current->{'cmdname'}} eq 'raw'
+                or $block_commands{$current->{'cmdname'}} eq 'conditional'
+                or ($block_commands{$current->{'cmdname'}} eq 'format_raw'
+           and not $self->{'expanded_formats_hash'}->{$current->{'cmdname'}})))
           or
            ($current->{'parent'} and $current->{'parent'}->{'cmdname'}
             and $current->{'parent'}->{'cmdname'} eq 'verb')
-          or
-           ($current->{'cmdname'}
-            and $format_raw_commands{$current->{'cmdname'}}
-            and not $self->{'expanded_formats_hash'}->{$current->{'cmdname'}})
           )
         # not def line
         and $self->_top_context() ne 'ct_def') {
diff --git a/tp/Texinfo/XS/parsetexi/close.c b/tp/Texinfo/XS/parsetexi/close.c
index 23de8b30db..aa1d1a76e5 100644
--- a/tp/Texinfo/XS/parsetexi/close.c
+++ b/tp/Texinfo/XS/parsetexi/close.c
@@ -294,7 +294,7 @@ close_current (ELEMENT *current,
               if (pop_context () != ct_preformatted)
                 fatal ("preformatted context expected");
             }
-          else if (command_data(cmd).flags & CF_format_raw)
+          else if (command_data(cmd).data == BLOCK_format_raw)
             {
               if (pop_context () != ct_rawpreformatted)
                 fatal ("rawpreformatted context expected");
@@ -407,7 +407,7 @@ close_commands (ELEMENT *current, enum command_id 
closed_command,
           if (pop_context () != ct_preformatted)
             fatal ("preformatted context expected");
         }
-      else if (command_data(current->cmd).flags & CF_format_raw)
+      else if (command_data(current->cmd).data == BLOCK_format_raw)
         {
           if (pop_context () != ct_rawpreformatted)
             fatal ("rawpreformatted context expected");
diff --git a/tp/Texinfo/XS/parsetexi/command_data.txt 
b/tp/Texinfo/XS/parsetexi/command_data.txt
index c04cd84617..f1a41d7503 100644
--- a/tp/Texinfo/XS/parsetexi/command_data.txt
+++ b/tp/Texinfo/XS/parsetexi/command_data.txt
@@ -427,11 +427,11 @@ format                  block,preformatted
 smallformat             block,preformatted
 
 # format raw commands
-html                    block,format_raw
-tex                     block,format_raw
-xml                     block,format_raw
-docbook                 block,format_raw
-latex                   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
diff --git a/tp/Texinfo/XS/parsetexi/commands.c 
b/tp/Texinfo/XS/parsetexi/commands.c
index 8e70ecbe1d..c63a1f8fa8 100644
--- a/tp/Texinfo/XS/parsetexi/commands.c
+++ b/tp/Texinfo/XS/parsetexi/commands.c
@@ -144,11 +144,9 @@ close_paragraph_command (enum command_id cmd)
   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_raw
+          || command_data(cmd).data == BLOCK_format_raw)
         return 0;
-      if (command_data(cmd).flags & CF_format_raw)
-        return 0;
-
       return 1;
     }
 
diff --git a/tp/Texinfo/XS/parsetexi/commands.h 
b/tp/Texinfo/XS/parsetexi/commands.h
index 863410ee8c..f265f2682e 100644
--- a/tp/Texinfo/XS/parsetexi/commands.h
+++ b/tp/Texinfo/XS/parsetexi/commands.h
@@ -53,6 +53,7 @@ void wipe_user_commands (void);
 #define CF_root                                0x0004
 #define CF_sectioning_heading                  0x0008
 #define CF_brace                       0x0010
+/* CF_letter_no_arg is not used */
 #define CF_letter_no_arg               0x0020
 #define CF_accent                      0x0040
 /* CF_style is not used */
@@ -63,18 +64,23 @@ void wipe_user_commands (void);
 #define CF_ref                         0x0800
 #define CF_ALIAS                        0x1000
 #define CF_block                       0x2000
+/* CF_raw is not used */
 #define CF_raw                         0x4000
+/* CF_format_raw is not used */
 #define CF_format_raw                  0x8000
 #define CF_global                      0x00010000
 #define CF_def                         0x00020000
 #define CF_def_alias                   0x00040000
 /* CF_menu is not used */
 #define CF_menu                                0x00080000
+/* CF_align is not used */
 #define CF_align                       0x00100000
 #define CF_other                       0x00200000
 #define CF_preformatted                        0x00400000
 #define CF_preformatted_code           0x00800000
+/* CF_item_container is not used */
 #define CF_item_container              0x01000000
+/* CF_item_line is not used */
 #define CF_item_line                   0x02000000
 #define CF_nobrace                     0x04000000
 #define CF_blockitem                   0x08000000
@@ -119,6 +125,7 @@ void wipe_user_commands (void);
 #define BLOCK_quotation -7
 #define BLOCK_float -8
 #define BLOCK_menu -9
+#define BLOCK_format_raw -10
 
 /* Types of brace command (CF_brace). */
 #define BRACE_arguments 1
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c 
b/tp/Texinfo/XS/parsetexi/end_line.c
index 7ffb6ceb08..a62c6df5bd 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -1279,7 +1279,7 @@ end_line_starting_block (ELEMENT *current)
       current = menu_comment;
       debug ("MENU_COMMENT OPEN");
     }
-  if (command_flags(current) & CF_format_raw
+  if (command_data(current->cmd).data == BLOCK_format_raw
       && format_expanded_p (command_name(current->cmd)))
     {
       ELEMENT *rawpreformatted = new_element (ET_rawpreformatted);
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c 
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index 19bd2344a9..803c67d467 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -892,7 +892,7 @@ handle_block_command (ELEMENT *current, char **line_inout,
         push_context (ct_preformatted, cmd);
       else if (cmd == CM_displaymath)
         push_context (ct_math, cmd);
-      else if (command_data(cmd).flags & CF_format_raw)
+      else if (command_data(cmd).data == BLOCK_format_raw)
         {
           push_context (ct_rawpreformatted, cmd);
         }
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index c145381ca4..742e7eac1d 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -993,7 +993,7 @@ check_valid_nesting (ELEMENT *current, enum command_id cmd)
                || cmd == CM_clear
                || cmd == CM_end)
         ok = 1;
-      else if (cmd_flags & CF_format_raw)
+      else if (command_data(cmd).data == BLOCK_format_raw)
         ok = 1;
       if (cmd == CM_caption || cmd == CM_shortcaption)
         ok = 0;
@@ -1335,7 +1335,7 @@ superfluous_arg:
           retval = GET_A_NEW_LINE; goto funexit;  /* Get next line. */
         }
     } /* CM_verb */
-  else if (command_flags(current) & CF_format_raw
+  else if (command_data(current->cmd).data == BLOCK_format_raw
            && !format_expanded_p (command_name(current->cmd)))
     {
       ELEMENT *e;
@@ -2058,7 +2058,7 @@ parse_texi (ELEMENT *root_elt, ELEMENT *current_elt)
              && (command_data(current->cmd).data == BLOCK_raw
                  || command_data(current->cmd).data == BLOCK_conditional)
             || current->parent && current->parent->cmd == CM_verb
-            || (command_flags(current) & CF_format_raw
+            || (command_data(current->cmd).data == BLOCK_format_raw
                 && !format_expanded_p (command_name(current->cmd))))
           && current_context () != ct_def)
         {



reply via email to

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