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 (%nobrace_symbol_text, %n


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Common.pm (%nobrace_symbol_text, %nobrace_commands), tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line), tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/DocBook.pm, tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/LaTeX.pm, tp/Texinfo/Convert/NodeNameNormalization.pm, tp/Texinfo/Convert/Plaintext.pm, tp/Texinfo/Convert/TexinfoMarkup.pm, tp/Texinfo/Convert/Text.pm, tp/Texinfo/Convert/TextContent.pm: rename former %nobrace_commands as %nobrace_symbol_text. Set %nobrace_co [...]
Date: Fri, 30 Sep 2022 16:12:57 -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 5e8da1f33d * tp/Texinfo/Common.pm (%nobrace_symbol_text, 
%nobrace_commands), tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line), 
tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/DocBook.pm, 
tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/LaTeX.pm, 
tp/Texinfo/Convert/NodeNameNormalization.pm, tp/Texinfo/Convert/Plaintext.pm, 
tp/Texinfo/Convert/TexinfoMarkup.pm, tp/Texinfo/Convert/Text.pm, 
tp/Texinfo/Convert/TextContent.pm: rename former %nobrace_commands as 
%nobrace_symbol_t [...]
5e8da1f33d is described below

commit 5e8da1f33d459c8ad6bb3bc1bc55bd7fb05400d1
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Sep 30 22:12:46 2022 +0200

    * tp/Texinfo/Common.pm (%nobrace_symbol_text, %nobrace_commands),
    tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line),
    tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/DocBook.pm,
    tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/LaTeX.pm,
    tp/Texinfo/Convert/NodeNameNormalization.pm,
    tp/Texinfo/Convert/Plaintext.pm, tp/Texinfo/Convert/TexinfoMarkup.pm,
    tp/Texinfo/Convert/Text.pm, tp/Texinfo/Convert/TextContent.pm: rename
    former %nobrace_commands as %nobrace_symbol_text.  Set
    %nobrace_commands according to
    tp/Texinfo/XS/parsetexi/command_data.txt.  Handle all the
    %nobrace_commands together.
---
 ChangeLog                                   | 14 +++++++
 tp/Texinfo/Common.pm                        | 26 +++++++++----
 tp/Texinfo/Convert/Converter.pm             |  4 +-
 tp/Texinfo/Convert/DocBook.pm               |  4 +-
 tp/Texinfo/Convert/HTML.pm                  | 14 ++++---
 tp/Texinfo/Convert/LaTeX.pm                 |  6 +--
 tp/Texinfo/Convert/NodeNameNormalization.pm | 10 ++---
 tp/Texinfo/Convert/Plaintext.pm             |  8 ++--
 tp/Texinfo/Convert/TexinfoMarkup.pm         |  2 +-
 tp/Texinfo/Convert/Text.pm                  |  6 +--
 tp/Texinfo/Convert/TextContent.pm           |  4 +-
 tp/Texinfo/ParserNonXS.pm                   | 58 +++++++++++++++--------------
 12 files changed, 93 insertions(+), 63 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b949944139..3dc7b9e19e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2022-09-30  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Common.pm (%nobrace_symbol_text, %nobrace_commands),
+       tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line),
+       tp/Texinfo/Convert/Converter.pm, tp/Texinfo/Convert/DocBook.pm,
+       tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/LaTeX.pm,
+       tp/Texinfo/Convert/NodeNameNormalization.pm,
+       tp/Texinfo/Convert/Plaintext.pm, tp/Texinfo/Convert/TexinfoMarkup.pm,
+       tp/Texinfo/Convert/Text.pm, tp/Texinfo/Convert/TextContent.pm: rename
+       former %nobrace_commands as %nobrace_symbol_text.  Set
+       %nobrace_commands according to
+       tp/Texinfo/XS/parsetexi/command_data.txt.  Handle all the
+       %nobrace_commands together.
+
 2022-09-30  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/parsetexi/command_data.txt,
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index efa8210bc5..59e6ca336a 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -476,8 +476,8 @@ sub valid_tree_transformation ($)
 
 # @-commands classifications and other information on @-commands
 
-our %nobrace_commands;             # commands never taking braces
-%nobrace_commands = (
+our %nobrace_symbol_text;
+%nobrace_symbol_text = (
            '*', "\n",
            ' ', ' ',
            "\t", ' ',
@@ -496,6 +496,12 @@ our %nobrace_commands;             # commands never taking 
braces
            '\\', '\\',  # should only appear in math
 );
 
+# commands never taking braces
+our %nobrace_commands;
+foreach my $nobrace_command (keys(%nobrace_symbol_text)) {
+  $nobrace_commands{$nobrace_command} = 'symbol';
+}
+
 # @-commands max number of arguments.  Not set for all commands,
 # in general it only matters if > 1, as commands with 0 args
 # are in specific categories, and default handling of commands
@@ -626,14 +632,14 @@ $commands_args_number{'node'} = 4;
 # skipspace:   no argument, following spaces are skipped.
 # noarg:       no argument
 #
-our %other_commands = (
+my %other_commands = (
   # formatting
   'noindent'          => 'skipspace',
   'indent'            => 'skipspace',
   'headitem'          => 'skipspace',
   'item'              => 'skipspace', # or line, depending on the context
   'tab'               => 'skipspace',
-  'refill'            => 'noarg',     # obsolete
+  'refill'            => 'other',     # obsolete
 );
 
 # only valid in heading or footing specifications
@@ -643,7 +649,11 @@ foreach my $in_heading_command ('thischapter', 
'thischaptername',
    'thisfile', 'thispage', 'thistitle') {
   $in_heading_spec_commands{$in_heading_command} = 1;
 
-  $other_commands{$in_heading_command} = 'noarg';
+  $other_commands{$in_heading_command} = 'other';
+}
+
+foreach my $nobrace_command (keys(%other_commands)) {
+  $nobrace_commands{$nobrace_command} = $other_commands{$nobrace_command};
 }
 
 # %in_heading_spec_commands and @| are only valid in the following @-commands
@@ -1173,7 +1183,7 @@ our %all_commands;
 foreach my $command (
   keys(%Texinfo::Common::block_commands),
   keys(%Texinfo::Common::brace_commands),
-  keys(%Texinfo::Common::misc_commands),
+  keys(%Texinfo::Common::line_commands),
   keys(%Texinfo::Common::nobrace_commands),
  ) {
   $all_commands{$command} = 1;
@@ -3119,8 +3129,8 @@ C<@node>, C<@chapter>, C<@cindex>, C<@deffnx>, C<@end>, 
C<@footnotestyle>,
 C<@set>, C<@settitle>, C<@indent>, C<@definfoenclose>, C<@comment> and many
 others.
 
-=item %nobrace_commands
-X<C<%nobrace_commands>>
+=item %nobrace_symbol_text
+X<C<%nobrace_symbol_text>>
 
 Commands without brace with a single character as name, like C<*>
 or C<:>.  The value is an ASCII representation of the command.  It
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index 909eca9850..b031abf106 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -1488,9 +1488,9 @@ our %xml_text_entity_no_arg_commands_formatting = (
                'guilsinglright'          => '&rsaquo;',
 );
 
-foreach my $no_brace_command (keys(%Texinfo::Common::nobrace_commands)) {
+foreach my $no_brace_command (keys(%Texinfo::Common::nobrace_symbol_text)) {
   $xml_text_entity_no_arg_commands_formatting{$no_brace_command}
-    = $Texinfo::Common::nobrace_commands{$no_brace_command};
+    = $Texinfo::Common::nobrace_symbol_text{$no_brace_command};
 }
 
 $xml_text_entity_no_arg_commands_formatting{'&'} = '&amp;';
diff --git a/tp/Texinfo/Convert/DocBook.pm b/tp/Texinfo/Convert/DocBook.pm
index 7cc82c6d6a..0fdd8460c4 100644
--- a/tp/Texinfo/Convert/DocBook.pm
+++ b/tp/Texinfo/Convert/DocBook.pm
@@ -775,7 +775,7 @@ sub _convert($$;$)
 
     } elsif (exists($docbook_misc_commands{$element->{'cmdname'}})) {
       # FIXME redo code to use directly commands and not be based on the
-      # %misc_commands type.  Also probably ignore %other_commands
+      # %misc_commands type.  Also probably ignore %nobrace_commands
       # right away
       #warn "  is dbk misc command\n";
       if ($docbook_global_commands{$element->{'cmdname'}}) {
@@ -942,7 +942,7 @@ sub _convert($$;$)
           # misc commands not handled especially are ignored here.
           return '';
         }
-      } elsif ($type eq 'skipline' or $type eq 'noarg') {
+      } elsif ($type eq 'skipline' or $type eq 'other') {
         if ($element->{'cmdname'} eq 'insertcopying') {
           if ($self->{'global_commands'}
               and $self->{'global_commands'}->{'copying'}) {
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 02ed9d196e..646aab31e5 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -97,6 +97,8 @@ sub import {
 my %formatted_misc_commands = %Texinfo::Common::formatted_misc_commands;
 my %formattable_misc_commands = %Texinfo::Common::formattable_misc_commands;
 my %nobrace_commands = %Texinfo::Common::nobrace_commands;
+my %line_commands = %Texinfo::Common::line_commands;
+my %nobrace_symbol_text = %Texinfo::Common::nobrace_symbol_text;
 my %accent_commands = %Texinfo::Common::accent_commands;
 my %misc_commands = %Texinfo::Common::misc_commands;
 my %sectioning_heading_commands = 
%Texinfo::Common::sectioning_heading_commands;
@@ -2281,9 +2283,9 @@ 
$default_no_arg_commands_formatting{'preformatted'}->{'*'}->{'text'} = "\n";
 # is protected as CSS as a\'b", and " is escaped in an HTML style
 # attribute: style="list-style-type: 'a\'b&quot;'"
 
-foreach my $no_brace_command (keys(%nobrace_commands)) {
+foreach my $no_brace_command (keys(%nobrace_symbol_text)) {
   
$default_no_arg_commands_formatting{'css_string'}->{$no_brace_command}->{'text'}
-   = $nobrace_commands{$no_brace_command};
+   = $nobrace_symbol_text{$no_brace_command};
 }
 
 foreach my $command (keys(%{$default_no_arg_commands_formatting{'normal'}})) {
@@ -2303,8 +2305,8 @@ foreach my $command 
(keys(%{$default_no_arg_commands_formatting{'normal'}})) {
   } elsif 
($default_no_arg_commands_formatting{'normal'}->{$command}->{'text'}) {
     $default_no_arg_commands_formatting{'css_string'}->{$command}->{'text'} =
       $default_no_arg_commands_formatting{'normal'}->{$command}->{'text'};
-  } elsif (exists($nobrace_commands{$command})
-           and $nobrace_commands{$command} eq '') {
+  } elsif (exists($nobrace_symbol_text{$command})
+           and $nobrace_symbol_text{$command} eq '') {
     # @- @/ @/ @|
     $default_no_arg_commands_formatting{'css_string'}->{$command}->{'text'} = 
'';
   } else {
@@ -6989,7 +6991,7 @@ sub converter_initialize($)
   # FIXME put value in a category in Texinfo::Common?
   my $customized_commands_conversion
      = Texinfo::Config::GNUT_get_commands_conversion();
-  foreach my $command (keys(%misc_commands), keys(%brace_commands),
+  foreach my $command (keys(%line_commands), keys(%brace_commands),
      keys (%block_commands), keys(%nobrace_commands)) {
     if (exists($customized_commands_conversion->{$command})) {
       $self->{'commands_conversion'}->{$command}
@@ -7009,7 +7011,7 @@ sub converter_initialize($)
 
   my $customized_commands_open
      = Texinfo::Config::GNUT_get_commands_open();
-  foreach my $command (keys(%misc_commands), keys(%brace_commands),
+  foreach my $command (keys(%line_commands), keys(%brace_commands),
      keys (%block_commands), keys(%nobrace_commands)) {
     if (exists($customized_commands_open->{$command})) {
       $self->{'commands_open'}->{$command}
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 9f083a5d86..8c1b1aea9d 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -216,7 +216,7 @@ foreach my $informative_command (keys 
(%Texinfo::Common::document_settable_at_co
   $informative_commands{$informative_command} = 1;
 }
 
-my %nobrace_commands = %Texinfo::Common::nobrace_commands;
+my %nobrace_symbol_text = %Texinfo::Common::nobrace_symbol_text;
 my %brace_no_arg_commands;
 foreach my $command (keys (%Texinfo::Common::brace_commands)) {
   $brace_no_arg_commands{$command} = 1
@@ -2290,7 +2290,7 @@ sub _convert($$)
       $command_format_context = 'cmd_math';
     }
     my $did_stop_embrac;
-    if (defined($nobrace_commands{$cmdname})) {
+    if (defined($nobrace_symbol_text{$cmdname})) {
       if ($cmdname eq ':') {
         if ($command_format_context ne 'cmd_math') {
           $result .= "\\\@";
@@ -2350,7 +2350,7 @@ sub _convert($$)
           $result .= "\\$cmdname";
         }
       } else {
-        $result .= _protect_text($self, $nobrace_commands{$cmdname});
+        $result .= _protect_text($self, $nobrace_symbol_text{$cmdname});
       }
       return $result;
     } elsif (exists($brace_no_arg_commands{$cmdname})) {
diff --git a/tp/Texinfo/Convert/NodeNameNormalization.pm 
b/tp/Texinfo/Convert/NodeNameNormalization.pm
index dd7fe328e9..336d1af134 100644
--- a/tp/Texinfo/Convert/NodeNameNormalization.pm
+++ b/tp/Texinfo/Convert/NodeNameNormalization.pm
@@ -61,9 +61,9 @@ foreach my $command 
(keys(%Texinfo::Convert::Unicode::unicode_character_brace_no
      
$Texinfo::Convert::Unicode::unicode_character_brace_no_arg_commands{$command};
 }
 
-my %normalize_node_nobrace_commands
-  = %Texinfo::Common::nobrace_commands;
-$normalize_node_nobrace_commands{'*'} = ' ';
+my %normalize_node_nobrace_symbol_text
+  = %Texinfo::Common::nobrace_symbol_text;
+$normalize_node_nobrace_symbol_text{'*'} = ' ';
 
 my %accent_commands = %Texinfo::Common::accent_commands;
 
@@ -253,8 +253,8 @@ sub _convert($;$)
   }
   if ($element->{'cmdname'}) {
     my $command = $element->{'cmdname'};
-    if (defined($normalize_node_nobrace_commands{$element->{'cmdname'}})) {
-      return $normalize_node_nobrace_commands{$element->{'cmdname'}};
+    if (defined($normalize_node_nobrace_symbol_text{$element->{'cmdname'}})) {
+      return $normalize_node_nobrace_symbol_text{$element->{'cmdname'}};
     } elsif 
(defined($normalize_node_brace_no_arg_commands{$element->{'cmdname'}})) {
       $command = $element->{'extra'}->{'clickstyle'}
          if ($element->{'extra'}
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 66ff426b77..7e22972245 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -83,7 +83,7 @@ sub get_informative_global_commands($)
   return @informative_global_commands;
 }
 
-my %nobrace_commands = %Texinfo::Common::nobrace_commands;
+my %nobrace_symbol_text = %Texinfo::Common::nobrace_symbol_text;
 my %brace_no_arg_commands;
 foreach my $command (keys (%brace_commands)) {
   $brace_no_arg_commands{$command} = 1 
@@ -1718,7 +1718,7 @@ sub _convert($$)
   my $preformatted;
   if ($command) {
     my $unknown_command;
-    if (defined($nobrace_commands{$command})) {
+    if (defined($nobrace_symbol_text{$command})) {
       if ($command eq ':') {
         remove_end_sentence($formatter->{'container'});
         return '';
@@ -1741,10 +1741,10 @@ sub _convert($$)
         add_end_sentence($formatter->{'container'}, 1);
       } elsif ($command eq ' ' or $command eq "\n" or $command eq "\t") {
         $result .= _count_added($self, $formatter->{'container'}, 
-            add_next($formatter->{'container'}, $nobrace_commands{$command}));
+            add_next($formatter->{'container'}, 
$nobrace_symbol_text{$command}));
       } else {
         $result .= _count_added($self, $formatter->{'container'}, 
-            add_text($formatter->{'container'}, $nobrace_commands{$command}));
+            add_text($formatter->{'container'}, 
$nobrace_symbol_text{$command}));
       }
       return $result;
     } elsif ($command eq 'today') {
diff --git a/tp/Texinfo/Convert/TexinfoMarkup.pm 
b/tp/Texinfo/Convert/TexinfoMarkup.pm
index 6ea1c49b2f..767991adfc 100644
--- a/tp/Texinfo/Convert/TexinfoMarkup.pm
+++ b/tp/Texinfo/Convert/TexinfoMarkup.pm
@@ -850,7 +850,7 @@ sub _convert($$;$)
         }
         return $self->txi_markup_open_element($cmdname, $attribute)
                  .$self->txi_markup_close_element($cmdname)."\n";
-      } elsif ($type eq 'noarg' or $type eq 'skipspace') {
+      } elsif ($type eq 'other' or $type eq 'skipspace') {
         my $spaces = '';
         $spaces = $element->{'extra'}->{'spaces_after_command'}
           if ($element->{'extra'} and 
$element->{'extra'}->{'spaces_after_command'}
diff --git a/tp/Texinfo/Convert/Text.pm b/tp/Texinfo/Convert/Text.pm
index bf971a9d74..896c93c14d 100644
--- a/tp/Texinfo/Convert/Text.pm
+++ b/tp/Texinfo/Convert/Text.pm
@@ -142,7 +142,7 @@ foreach my $accent_letter ('o','O','l','L') {
 }
 
 my %accent_commands = %Texinfo::Common::accent_commands;
-my %nobrace_commands = %Texinfo::Common::nobrace_commands;
+my %nobrace_symbol_text = %Texinfo::Common::nobrace_symbol_text;
 my %formatted_misc_commands = %Texinfo::Common::formatted_misc_commands;
 # 'page' is a formatted_misc_commands and therefore is replaced by an empty 
line.
 
@@ -433,8 +433,8 @@ sub _convert($;$)
   }
   if ($element->{'cmdname'}) {
     my $command = $element->{'cmdname'};
-    if (defined($nobrace_commands{$element->{'cmdname'}})) {
-      return $nobrace_commands{$element->{'cmdname'}};
+    if (defined($nobrace_symbol_text{$element->{'cmdname'}})) {
+      return $nobrace_symbol_text{$element->{'cmdname'}};
     } elsif ($element->{'cmdname'} eq 'today') {
       if ($options->{'sort_string'}
           and $sort_brace_no_arg_commands{$element->{'cmdname'}}) {
diff --git a/tp/Texinfo/Convert/TextContent.pm 
b/tp/Texinfo/Convert/TextContent.pm
index ef210fd6e4..0061fe6f0f 100644
--- a/tp/Texinfo/Convert/TextContent.pm
+++ b/tp/Texinfo/Convert/TextContent.pm
@@ -118,8 +118,8 @@ sub _convert($$)
     return $element->{'text'};
   }
   if (defined($element->{'cmdname'})) {
-    if (exists($Texinfo::Common::nobrace_commands{$element->{'cmdname'}})) {
-      return $Texinfo::Common::nobrace_commands{$element->{'cmdname'}};
+    if (exists($Texinfo::Common::nobrace_symbol_text{$element->{'cmdname'}})) {
+      return $Texinfo::Common::nobrace_symbol_text{$element->{'cmdname'}};
     } elsif ($element->{'cmdname'} eq 'today') {
       if ($self->get_conf('TEST')) {
         return 'a sunny day';
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index e59029117a..3c8a0ae1d1 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -263,7 +263,6 @@ my %initialization_overrides = (
 
 my %nobrace_commands          = %Texinfo::Common::nobrace_commands;
 my %line_commands             = %Texinfo::Common::line_commands;
-my %other_commands            = %Texinfo::Common::other_commands;
 my %brace_commands            = %Texinfo::Common::brace_commands;
 my %commands_args_number      = %Texinfo::Common::commands_args_number;
 my %accent_commands           = %Texinfo::Common::accent_commands;
@@ -347,7 +346,7 @@ foreach my $no_paragraph_command ('titlefont', 'caption', 
'shortcaption',
 }
 
 foreach my $no_paragraph_command (keys(%line_commands),
-                                  keys(%other_commands)) {
+      grep {$nobrace_commands{$_} ne 'symbol'} keys(%nobrace_commands)) {
   $default_no_paragraph_commands{$no_paragraph_command} = 1;
 }
 
@@ -382,8 +381,12 @@ foreach my $brace_command(keys(%brace_commands)) {
   $in_plain_text_commands{$brace_command} = 1
      if ($brace_commands{$brace_command} eq 'noarg');
 }
+my %symbol_nobrace_commands;
 foreach my $no_brace_command (keys(%nobrace_commands)) {
-  $in_plain_text_commands{$no_brace_command} = 1;
+  if ($nobrace_commands{$no_brace_command} eq 'symbol') {
+    $symbol_nobrace_commands{$no_brace_command} = 1;
+    $in_plain_text_commands{$no_brace_command} = 1;
+  }
 }
 $in_plain_text_commands{'c'} = 1;
 $in_plain_text_commands{'comment'} = 1;
@@ -391,7 +394,7 @@ $in_plain_text_commands{'comment'} = 1;
 # commands that may appear in any text argument, similar constraints
 # as in paragraphs.
 my %in_full_text_commands;
-foreach my $command (keys(%brace_commands), keys(%nobrace_commands)) {
+foreach my $command (keys(%brace_commands), keys(%symbol_nobrace_commands)) {
   $in_full_text_commands{$command} = 1;
 }
 foreach my $in_full_text_command ('c', 'comment', 'refill', 'subentry',
@@ -4569,13 +4572,16 @@ sub _process_remaining_on_line($$$$)
       }
     }
 
-    if (defined($other_commands{$command})
+    if (defined($nobrace_commands{$command})
         and ($command ne 'item' or !_item_line_parent($current))) {
-      # noarg skipspace
-      my $arg_spec = $other_commands{$command};
+      # symbol skipspace other
+      my $arg_spec = $nobrace_commands{$command};
       my $misc;
 
-      if ($arg_spec eq 'noarg') {
+      if ($arg_spec ne 'skipspace') {
+        $misc = {'cmdname' => $command, 'parent' => $current};
+        push @{$current->{'contents'}}, $misc;
+
         if ($in_heading_spec_commands{$command}) {
           # TODO use a more generic system for check of @-command nesting
           # in command on context stack
@@ -4587,11 +4593,23 @@ sub _process_remaining_on_line($$$$)
                     $command), $source_info);
           }
         }
-        $misc = {'cmdname' => $command, 'parent' => $current};
-        push @{$current->{'contents'}}, $misc;
-        _register_global_command($self, $misc, $source_info);
-        $current = _begin_preformatted($self, $current)
-          if ($close_preformatted_commands{$command});
+        if ($arg_spec eq 'symbol') {
+          # FIXME generalize?
+          if ($command eq '\\' and $self->_top_context() ne 'ct_math') {
+            $self->_line_warn(sprintf(
+                       __("\@%s should only appear in math context"),
+                                  $command), $source_info);
+          }
+          if ($command eq "\n") {
+            $current = _end_line($self, $current, $source_info);
+            $retval = $GET_A_NEW_LINE;
+            goto funexit;
+          }
+        } else { # other
+          _register_global_command($self, $misc, $source_info);
+          $current = _begin_preformatted($self, $current)
+            if ($close_preformatted_commands{$command});
+        }
       } else {
         if ($command eq 'item'
             or $command eq 'headitem' or $command eq 'tab') {
@@ -5173,20 +5191,6 @@ sub _process_remaining_on_line($$$$)
         $current->{'extra'}->{'end'}
           = $self->{'definfoenclose'}->{$command}->[1];
       }
-    } elsif (exists ($nobrace_commands{$command})) {
-      push @{$current->{'contents'}},
-             { 'cmdname' => $command, 'parent' => $current };
-      # FIXME generalize?
-      if ($command eq '\\' and $self->_top_context() ne 'ct_math') {
-        $self->_line_warn(sprintf(
-                       __("\@%s should only appear in math context"),
-                                  $command), $source_info);
-      }
-      if ($command eq "\n") {
-        $current = _end_line($self, $current, $source_info);
-        $retval = $GET_A_NEW_LINE;
-        goto funexit;
-      }
     }
   } elsif ($separator_match) {
     my $separator = $separator_match;



reply via email to

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