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 (%brace_commands, %interna


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Common.pm (%brace_commands, %internal_commands), tp/Texinfo/XS/parsetexi/command_data.txt, tp/Texinfo/XS/parsetexi/commands.h: put value in brace commands. Put internal commands (currently only txiinternalvalue) in specific hash, and use specific flag/data.
Date: Tue, 27 Sep 2022 12:18:24 -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 08291e4b01 * tp/Texinfo/Common.pm (%brace_commands, 
%internal_commands), tp/Texinfo/XS/parsetexi/command_data.txt, 
tp/Texinfo/XS/parsetexi/commands.h: put value in brace commands. Put internal 
commands (currently only txiinternalvalue) in specific hash, and use specific 
flag/data.
08291e4b01 is described below

commit 08291e4b01975bce6a42cc09e226966e8bc1f48c
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Sep 27 18:17:52 2022 +0200

    * tp/Texinfo/Common.pm (%brace_commands, %internal_commands),
    tp/Texinfo/XS/parsetexi/command_data.txt,
    tp/Texinfo/XS/parsetexi/commands.h: put value in brace commands.
    Put internal commands (currently only txiinternalvalue) in
    specific hash, and use specific flag/data.
    
    * tp/Texinfo/XS/parsetexi/commands.c (item_line_command):
    use BLOCK_item_line.
---
 ChangeLog                                | 11 +++++++++++
 tp/Texinfo/Common.pm                     | 21 +++++++++++++++------
 tp/Texinfo/XS/parsetexi/command_data.txt |  7 ++++---
 tp/Texinfo/XS/parsetexi/commands.c       |  2 +-
 tp/Texinfo/XS/parsetexi/commands.h       |  9 +++++++--
 5 files changed, 38 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7e644fdc0a..beae9a274e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-09-27  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Common.pm (%brace_commands, %internal_commands),
+       tp/Texinfo/XS/parsetexi/command_data.txt,
+       tp/Texinfo/XS/parsetexi/commands.h: put value in brace commands.
+       Put internal commands (currently only txiinternalvalue) in
+       specific hash, and use specific flag/data.
+
+       * tp/Texinfo/XS/parsetexi/commands.c (item_line_command):
+       use BLOCK_item_line.
+
 2022-09-27  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Common.pm (%commands_args_number): merge
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 5d80b43625..4923b54cba 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -754,9 +754,10 @@ foreach my $one_arg_command ('U', 'dmn', 'key', 
'hyphenation', 'indicateurl',
 
 # commands in other keep their leading and trailing spaces in main text
 # argument, but are not style commands.
-# key should not contain spaces, so it does not matter if 'other' or 1.
+# key should not contain spaces, it does not matter if 'other' or 'arguments'.
 # verb is treated especially, it should not matter in which category it is.
-foreach my $other_arg_command ('w', 'verb') {
+# value also is treated especially.
+foreach my $other_arg_command ('w', 'verb', 'value') {
   $brace_commands{$other_arg_command} = 'other';
 }
 
@@ -1157,20 +1158,28 @@ our %misc_commands = (%line_commands, %other_commands);
 
 $root_commands{'node'} = 1;
 
-# there is the @txiinternalvalue command too, but it is considered
-# as a valid command only if a customization option is set, such
-# that it does not appear in user documents.  So it is not set here.
+# Not used, kept here as documenation.
+# @txiinternalvalue is considered as a valid command only if a customization
+# option is set, such that it does not appear in user documents.
+our %internal_commands;
+%internal_commands = (
+  'txiinternalvalue' => 'brace',
+);
+
+# The internal commands are not in %all_commands, which includes user-settable
+# commands only.
+# used in util/txicmdlist
 our %all_commands;
 foreach my $command (
   keys(%Texinfo::Common::block_commands),
   keys(%Texinfo::Common::brace_commands),
   keys(%Texinfo::Common::misc_commands),
   keys(%Texinfo::Common::nobrace_commands),
-  qw(value),
  ) {
   $all_commands{$command} = 1;
 }
 
+
 our %preamble_commands;
 foreach my $preamble_command ('direnty', 'hyphenation', 'errormsg',
        'inlineraw', '*', keys(%document_settable_at_commands),
diff --git a/tp/Texinfo/XS/parsetexi/command_data.txt 
b/tp/Texinfo/XS/parsetexi/command_data.txt
index 31c01e2f9a..c99b54398a 100644
--- a/tp/Texinfo/XS/parsetexi/command_data.txt
+++ b/tp/Texinfo/XS/parsetexi/command_data.txt
@@ -17,10 +17,10 @@
 
 # Information from tp/Texinfo/Common.pm
 
-# Not in Common.pm
-value                   brace
+##############################################################
+# Internal commands
 # invalid if not accept_internalvalue set in configuration
-txiinternalvalue        brace
+txiinternalvalue        brace,internal                  INTERNAL_brace
 
 ##############################################################
 # no brace commands - single letter commands
@@ -312,6 +312,7 @@ seealso                 brace                           
BRACE_arguments     1
 indicateurl             brace                           BRACE_arguments     1
 key                     brace                           BRACE_arguments     1
 
+value                   brace                           BRACE_other
 verb                    brace                           BRACE_other
 w                       brace                           BRACE_other
 
diff --git a/tp/Texinfo/XS/parsetexi/commands.c 
b/tp/Texinfo/XS/parsetexi/commands.c
index c63a1f8fa8..684895ddc5 100644
--- a/tp/Texinfo/XS/parsetexi/commands.c
+++ b/tp/Texinfo/XS/parsetexi/commands.c
@@ -192,5 +192,5 @@ close_preformatted_command (enum command_id cmd_id)
 int
 item_line_command (enum command_id cmd_id)
 {
-  return cmd_id == CM_table || cmd_id == CM_ftable || cmd_id == CM_vtable;
+  return command_data(cmd_id).data == BLOCK_item_line;
 }
diff --git a/tp/Texinfo/XS/parsetexi/commands.h 
b/tp/Texinfo/XS/parsetexi/commands.h
index 657b26ecb8..43f2f177cc 100644
--- a/tp/Texinfo/XS/parsetexi/commands.h
+++ b/tp/Texinfo/XS/parsetexi/commands.h
@@ -56,6 +56,7 @@ void wipe_user_commands (void);
 /* CF_letter_no_arg is not used, in Common */
 #define CF_letter_no_arg               0x0020
 #define CF_accent                      0x0040
+/* CF_math is not used, in Common */
 #define CF_math                                0x0080
 #define CF_variadic                    0x0100
 #define CF_INFOENCLOSE                 0x0200
@@ -64,8 +65,9 @@ void wipe_user_commands (void);
 #define CF_ALIAS                        0x1000
 #define CF_block                       0x2000
 #define CF_heading_spec                        0x4000
-/* CF_format_raw is not used */
-#define CF_format_raw                  0x8000
+/* CF_internal is not used in code, but it should be kept as internal
+ * commands marker */
+#define CF_internal                    0x8000
 #define CF_global                      0x00010000
 #define CF_def                         0x00020000
 #define CF_def_alias                   0x00040000
@@ -129,4 +131,7 @@ void wipe_user_commands (void);
 #define BRACE_style_no_code -6
 #define BRACE_other -7
 
+/* Types of internal commands (CF_internal). */
+#define INTERNAL_brace -1
+
 #endif



reply via email to

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