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/XS/parsetexi/c


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Common.pm, tp/Texinfo/XS/parsetexi/command_data.txt: reorganize brace commands classifications. Put hyphenation in brace commands with 1 argument.
Date: Mon, 22 Aug 2022 14:39:18 -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 a9100ebefb * tp/Texinfo/Common.pm, 
tp/Texinfo/XS/parsetexi/command_data.txt: reorganize brace commands 
classifications.  Put hyphenation in brace commands with 1 argument.
a9100ebefb is described below

commit a9100ebefbaffee90454723ca943145676792129
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Aug 22 20:38:47 2022 +0200

    * tp/Texinfo/Common.pm, tp/Texinfo/XS/parsetexi/command_data.txt:
    reorganize brace commands classifications.  Put hyphenation in
    brace commands with 1 argument.
---
 ChangeLog                                |  6 +++++
 tp/Texinfo/Common.pm                     | 44 ++++++++++++++++++++------------
 tp/Texinfo/XS/parsetexi/command_data.txt | 15 ++++++-----
 tp/t/results/coverage/hyphenation.pl     |  5 +++-
 4 files changed, 45 insertions(+), 25 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e9b8de0cec..99be1058fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-08-22  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Common.pm, tp/Texinfo/XS/parsetexi/command_data.txt:
+       reorganize brace commands classifications.  Put hyphenation in
+       brace commands with 1 argument.
+
 2022-08-21  Patrice Dumas  <pertusus@free.fr>
 
        * doc/texinfo.texi (Invoking @command{texi2any})
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 37ba1a5215..5002463d34 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -709,9 +709,8 @@ foreach my $accent_command ('"','~','^','`',"'",',','=',
 our %style_commands;
 foreach my $style_command ('asis','cite','clicksequence',
   'dfn', 'emph',
-  'sc', 't', 'var',
-  'headitemfont', 'code', 'command', 'env', 'file', 'kbd',
-  'option', 'samp', 'strong', 'sub', 'sup') {
+  'sc', 'var',
+  'headitemfont', 'strong', 'sub', 'sup') {
   $brace_commands{$style_command} = 'style';
   $style_commands{$style_command} = 1;
 }
@@ -723,26 +722,38 @@ foreach my $command ('r', 'i', 'b', 'sansserif', 
'slanted') {
   $style_commands{$command} = 1;
 }
 
-foreach my $one_arg_command ('U', 'dmn', 'key',
+our %code_style_commands;
+foreach my $command ('code', 'command', 'env', 'file', 'kbd', 'option',
+   'samp', 't') {
+  $code_style_commands{$command} = 1;
+  $brace_commands{$command} = 'style';
+  $style_commands{$command} = 1;
+}
+
+# FIXME this category contains commands with different types.  Some should
+# only contain text: 'U' , 'dmn', 'key', 'hyphenation', 'sortas'.
+# The other can contain @-commands, but not full text, for example no @ref,
+# not footnote: 'titlefont', 'anchor', 'indicateurl', 'errormsg', 'seeentry', 
'seealso'
+
+# in this category, the leading and trailing spaces are put in specific
+# text with type, but commas do not delimitate arguments
+foreach my $one_arg_command ('U', 'dmn', 'key', 'hyphenation', 'indicateurl',
     'titlefont', 'anchor', 'errormsg', 'sortas', 'seeentry', 'seealso') {
   $brace_commands{$one_arg_command} = 1;
 }
 
-# FIXME: 'key', 'verb', 't'?
-foreach my $other_arg_command ('w', 'hyphenation') {
+# commands in other keep their leading and trailing spaces in main text
+# argument.
+# key should never contain spaces, so it does not matter whether it is 'other' 
or 1
+# verb is treated especially, so it also should not matter in which category 
it is
+foreach my $other_arg_command ('w', 'verb') {
   $brace_commands{$other_arg_command} = 'other';
 }
 
-our %code_style_commands;
-foreach my $command ('code', 'command', 'env', 'file', 'kbd', 'key', 'option',
-   'samp', 'verb', 't') {
-  $code_style_commands{$command} = 1;
-  $brace_commands{$command} = 'style';
-}
-
-# FIXME: a special case?
+# code style command that do not contain full text
+$code_style_commands{'key'} = 1;
+$code_style_commands{'verb'} = 1;
 $code_style_commands{'indicateurl'} = 1;
-$brace_commands{'indicateurl'} = 1;
 
 
 # Commands that enclose full texts, that can contain multiple paragraphs.
@@ -3096,8 +3107,7 @@ Block @-commands that enclose full text regions, like 
C<@titlepage>.
 =item %regular_font_style_commands
 X<C<%regular_font_style_commands>>
 
-I<style_commands> that have their argument in regular font, like
-C<@r> or C<@slanted>.
+I<style_commands> that have their argument in regular font, C<@r>.
 
 =item %root_commands
 X<C<%root_commands>>
diff --git a/tp/Texinfo/XS/parsetexi/command_data.txt 
b/tp/Texinfo/XS/parsetexi/command_data.txt
index a441e1bb8e..0e0b46f62e 100644
--- a/tp/Texinfo/XS/parsetexi/command_data.txt
+++ b/tp/Texinfo/XS/parsetexi/command_data.txt
@@ -274,9 +274,13 @@ clicksequence           brace                           
BRACE_style
 dfn                     brace                           BRACE_style
 emph                    brace                           BRACE_style
 sc                      brace                           BRACE_style
-t                       brace                           BRACE_style
 var                     brace                           BRACE_style
 headitemfont            brace                           BRACE_style
+strong                  brace                           BRACE_style
+sub                     brace                           BRACE_style
+sup                     brace                           BRACE_style
+
+# code style commands
 code                    brace,code_style                BRACE_style
 command                 brace,code_style                BRACE_style
 env                     brace,code_style                BRACE_style
@@ -284,9 +288,7 @@ file                    brace,code_style                
BRACE_style
 kbd                     brace,code_style                BRACE_style
 option                  brace,code_style                BRACE_style
 samp                    brace,code_style                BRACE_style
-strong                  brace                           BRACE_style
-sub                     brace                           BRACE_style
-sup                     brace                           BRACE_style
+t                       brace,code_style                BRACE_style
 
 # Regular font style commands
 r                       brace                           BRACE_style
@@ -300,9 +302,8 @@ dmn                     brace                           1
 titlefont               brace,global                    1
 
 w                       brace                           BRACE_other
-key                     brace                           BRACE_other
 
-hyphenation             brace,global                    BRACE_other
+hyphenation             brace,global                    1
 anchor                  brace                           1
 errormsg                brace                           1
 sortas                  brace                           1
@@ -311,8 +312,8 @@ seealso                 brace                           1
 
 # more code style commands
 indicateurl             brace,code_style                1
+key                     brace,code_style                BRACE_other
 verb                    brace,code_style                BRACE_other
-t                       brace,code_style                BRACE_other
 
 # context brace commands - commands that enclose full texts
 footnote                brace,global                    BRACE_context
diff --git a/tp/t/results/coverage/hyphenation.pl 
b/tp/t/results/coverage/hyphenation.pl
index 5982936f28..e4b4a70005 100644
--- a/tp/t/results/coverage/hyphenation.pl
+++ b/tp/t/results/coverage/hyphenation.pl
@@ -21,9 +21,12 @@ $result_trees{'hyphenation'} = {
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => 'some-where '
+                  'text' => 'some-where'
                 }
               ],
+              'extra' => {
+                'spaces_after_argument' => ' '
+              },
               'parent' => {},
               'type' => 'brace_command_arg'
             }



reply via email to

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