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, tp/Texinfo/XS/parsetexi/commands.h: use BRACE_special for special commands with braces, instead of BRACE_other with is now used for brance commands in which leading and trailing spaces are kept, and used for @dmn and @titlefont. Set @indicateurl and @key as BRACE_style_code commands.
Date: Thu, 29 Sep 2022 15:31:55 -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 60abe53e9d * tp/Texinfo/Common.pm, 
tp/Texinfo/XS/parsetexi/command_data.txt, tp/Texinfo/XS/parsetexi/commands.h: 
use BRACE_special for special commands with braces, instead of BRACE_other with 
is now used for brance commands in which leading and trailing spaces are kept, 
and used for @dmn and @titlefont.  Set @indicateurl and @key as 
BRACE_style_code commands.
60abe53e9d is described below

commit 60abe53e9d086775980f5501aca156322105c972
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Sep 29 21:31:43 2022 +0200

    * tp/Texinfo/Common.pm, tp/Texinfo/XS/parsetexi/command_data.txt,
    tp/Texinfo/XS/parsetexi/commands.h: use BRACE_special for
    special commands with braces, instead of BRACE_other with is
    now used for brance commands in which leading and trailing spaces
    are kept, and used for @dmn and @titlefont.  Set @indicateurl and @key
    as BRACE_style_code commands.
---
 ChangeLog                                          |  9 ++++++
 tp/Texinfo/Common.pm                               | 33 +++++++++++-----------
 tp/Texinfo/XS/parsetexi/command_data.txt           | 16 ++++++-----
 tp/Texinfo/XS/parsetexi/commands.h                 |  1 +
 tp/t/results/converters_tests/form_feeds.pl        | 17 +++++------
 .../one_argument_leading_trailing_spaces.pl        | 14 ++++-----
 tp/t/results/xml_tests/commands_and_spaces.pl      | 10 ++-----
 7 files changed, 51 insertions(+), 49 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a0f9f60374..def6dbdca5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-09-29  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Common.pm, tp/Texinfo/XS/parsetexi/command_data.txt,
+       tp/Texinfo/XS/parsetexi/commands.h: use BRACE_special for
+       special commands with braces, instead of BRACE_other with is
+       now used for brance commands in which leading and trailing spaces
+       are kept, and used for @dmn and @titlefont.  Set @indicateurl and @key
+       as BRACE_style_code commands.
+
 2022-09-29  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * README-hacking, tp/Texinfo/XS/parsetexi/README:
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 217e43c196..ab365dab01 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -734,39 +734,40 @@ foreach my $command ('r') {
 }
 
 our %brace_code_commands; # contains also non style commands, see below
-foreach my $command ('code', 'command', 'env', 'file', 'kbd', 'option',
-   'samp', 't') {
+foreach my $command ('code', 'command', 'env', 'file', 'indicateurl', 'kbd',
+   'key', 'option', 'samp', 't') {
   $brace_code_commands{$command} = 1;
   $brace_commands{$command} = 'style_code';
 }
 
-# FIXME this category contains commands with different constraints.  Some 
should
-# only contain text: 'U' , 'dmn', 'key', 'hyphenation', 'sortas'.
-# The others can contain @-commands, but not all, for example no @ref,
-# no @footnote: 'anchor', 'indicateurl', 'errormsg', 'seeentry', 'seealso'
-# and lastly titlefont which may be less constrained.
+# FIXME Some commands should only contain text/accents and
+# could be checked for that: 'dmn', 'key', 'hyphenation', 'sortas'.
+# Some commands can contain @-commands, but not all, for example no @ref,
+# no @footnote: 'anchor', 'indicateurl', 'errormsg', 'seeentry', 'seealso'.
+# 'titlefont' may be less constrained.
 
 # 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') {
+foreach my $one_arg_command ('U', 'hyphenation',
+    'anchor', 'errormsg', 'sortas', 'seeentry', 'seealso') {
   $brace_commands{$one_arg_command} = 'arguments';
   $commands_args_number{$one_arg_command} = 1;
 }
 
-# commands in other keep their leading and trailing spaces in main text
-# argument, but are not style commands.
-# 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.
+# Leading and trailing spaces kept in main text.
+# verb is treated especially, it should not matter much in which category it 
is.
 # value also is treated especially.
-foreach my $other_arg_command ('w', 'verb', 'value') {
+foreach my $special_arg_command ('w', 'verb', 'value') {
+  $brace_commands{$special_arg_command} = 'special';
+}
+
+# Leading and trailing spaces kept in main text, nothing special.
+foreach my $other_arg_command ('titlefont', 'dmn') {
   $brace_commands{$other_arg_command} = 'other';
 }
 
 # brace style command that are not style commands
-$brace_code_commands{'key'} = 1;
 $brace_code_commands{'verb'} = 1;
-$brace_code_commands{'indicateurl'} = 1;
 
 # Commands that enclose full texts not in the main document context.
 # They can contain multiple paragraphs.
diff --git a/tp/Texinfo/XS/parsetexi/command_data.txt 
b/tp/Texinfo/XS/parsetexi/command_data.txt
index c99b54398a..3bf6020ccf 100644
--- a/tp/Texinfo/XS/parsetexi/command_data.txt
+++ b/tp/Texinfo/XS/parsetexi/command_data.txt
@@ -292,7 +292,9 @@ code                    brace                           
BRACE_style_code
 command                 brace                           BRACE_style_code
 env                     brace                           BRACE_style_code
 file                    brace                           BRACE_style_code
+indicateurl             brace                           BRACE_style_code
 kbd                     brace                           BRACE_style_code
+key                     brace                           BRACE_style_code
 option                  brace                           BRACE_style_code
 samp                    brace                           BRACE_style_code
 t                       brace                           BRACE_style_code
@@ -301,20 +303,20 @@ t                       brace                           
BRACE_style_code
 r                       brace                           BRACE_style_no_code
 
 U                       brace                           BRACE_arguments     1
-dmn                     brace                           BRACE_arguments     1
-titlefont               brace,global                    BRACE_arguments     1
 hyphenation             brace,global                    BRACE_arguments     1
 anchor                  brace                           BRACE_arguments     1
 errormsg                brace                           BRACE_arguments     1
 sortas                  brace                           BRACE_arguments     1
 seeentry                brace                           BRACE_arguments     1
 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
+value                   brace                           BRACE_special
+verb                    brace                           BRACE_special
+w                       brace                           BRACE_special
+
+# other brace commands, leading and trailing spaces not ignored
+dmn                     brace                           BRACE_other         1
+titlefont               brace,global                    BRACE_other         1
 
 # context brace commands - commands that enclose full texts
 footnote                brace,global                    BRACE_context
diff --git a/tp/Texinfo/XS/parsetexi/commands.h 
b/tp/Texinfo/XS/parsetexi/commands.h
index 43f2f177cc..f01e7c2c15 100644
--- a/tp/Texinfo/XS/parsetexi/commands.h
+++ b/tp/Texinfo/XS/parsetexi/commands.h
@@ -130,6 +130,7 @@ void wipe_user_commands (void);
 #define BRACE_style_code -5
 #define BRACE_style_no_code -6
 #define BRACE_other -7
+#define BRACE_special -8
 
 /* Types of internal commands (CF_internal). */
 #define INTERNAL_brace -1
diff --git a/tp/t/results/converters_tests/form_feeds.pl 
b/tp/t/results/converters_tests/form_feeds.pl
index a5c9099e58..f21d47c8dc 100644
--- a/tp/t/results/converters_tests/form_feeds.pl
+++ b/tp/t/results/converters_tests/form_feeds.pl
@@ -463,12 +463,9 @@ $result_trees{'form_feeds'} = {
                   'contents' => [
                     {
                       'parent' => {},
-                      'text' => 'in indicateurl'
+                      'text' => '  in indicateurl'
                     }
                   ],
-                  'extra' => {
-                    'spaces_before_argument' => '  '
-                  },
                   'parent' => {},
                   'type' => 'brace_command_arg'
                 }
@@ -1192,7 +1189,7 @@ in example
 around center
 in center
 
-in indicateurl
+  in indicateurl
 
 truc: machin bidule  chose arg
 T
@@ -1291,7 +1288,7 @@ $result_converted{'plaintext'}->{'form_feeds'} = 'aa
                              around center
                                in center
 
-   ‘in indicateurl’
+   ‘ in indicateurl’
 
  -- truc: machin bidule chose arg
      T
@@ -1341,7 +1338,7 @@ $result_converted{'html_text'}->{'form_feeds'} = '<a 
class="node-id" id="Top"></
 <div class="center">around center
 </div><div class="center">in &#12;center
 </div>
-<p>&lsquo;<code class="indicateurl">in indicateurl</code>&rsquo;
+<p>&lsquo;<code class="indicateurl"> &#12; in indicateurl</code>&rsquo;
 </p>
 <dl class="first-deffn">
 <dt class="deffn" id="index-machin"><span class="category-def">truc: 
</span><span><strong class="def-name">machin</strong> <var 
class="def-var-arguments">bidule  chose arg</var><a class="copiable-link" 
href=\'#index-machin\'> &para;</a></span></dt>
@@ -1381,7 +1378,7 @@ $result_converted{'xml'}->{'form_feeds'} = '<node 
name="Top" spaces=" "><nodenam
 <center spaces=" \\f ">around center &formfeed;</center>
 <center spaces=" ">in &formfeed;center</center>
 
-<para><indicateurl spaces=" \\f ">in indicateurl</indicateurl>
+<para><indicateurl> &formfeed; in indicateurl</indicateurl>
 </para>
 <deffn spaces=" " endspaces=" "><definitionterm><indexterm index="fn" 
number="1">machin</indexterm><defcategory bracketed="on" spaces=" 
\\f">truc</defcategory> <deffunction bracketed="on" spaces=" 
">machin</deffunction>  <defparam bracketed="on" spaces=" ">bidule</defparam>  
<defparam bracketed="on" spaces=" \\f ">chose</defparam> <defparam 
bracketed="on" spaces="  ">arg</defparam></definitionterm>
 <definitionitem><para>T
@@ -1417,7 +1414,7 @@ $result_converted{'docbook'}->{'form_feeds'} = '<anchor 
id="first-node"/>
 <simpara role="center">around center</simpara>
 <simpara role="center">in  center</simpara>
 
-<para><literal>in indicateurl</literal>
+<para><literal>   in indicateurl</literal>
 </para>
 <synopsis><indexterm role="fn"><primary>machin</primary></indexterm><phrase 
role="category"><emphasis role="bold">truc</emphasis>:</phrase> 
<function>machin</function>  <emphasis role="arg">bidule</emphasis>  <emphasis 
role="arg">chose</emphasis> <emphasis role="arg">arg</emphasis></synopsis>
 <blockquote><para>T
@@ -1461,7 +1458,7 @@ around center
 in center
 \\end{center}
 
-`\\texttt{in indicateurl}\'
+`\\texttt{\\  in indicateurl}\'
 
 
 \\noindent\\begin{tabularx}{\\linewidth}{@{}Xr}
diff --git 
a/tp/t/results/coverage_braces/one_argument_leading_trailing_spaces.pl 
b/tp/t/results/coverage_braces/one_argument_leading_trailing_spaces.pl
index 69b605fb45..8043a37629 100644
--- a/tp/t/results/coverage_braces/one_argument_leading_trailing_spaces.pl
+++ b/tp/t/results/coverage_braces/one_argument_leading_trailing_spaces.pl
@@ -149,13 +149,9 @@ $result_trees{'one_argument_leading_trailing_spaces'} = {
                   'contents' => [
                     {
                       'parent' => {},
-                      'text' => 'http://example.com'
+                      'text' => ' http://example.com '
                     }
                   ],
-                  'extra' => {
-                    'spaces_after_argument' => ' ',
-                    'spaces_before_argument' => ' '
-                  },
                   'parent' => {},
                   'type' => 'brace_command_arg'
                 }
@@ -313,7 +309,7 @@ $result_texis{'one_argument_leading_trailing_spaces'} = 
'@code{ in code } @slant
 
 
 $result_texts{'one_argument_leading_trailing_spaces'} = ' in code   in slanted 
  var   sub 
-http://example.com 1234  w   verb .
+ http://example.com  1234  w   verb .
 ';
 
 $result_errors{'one_argument_leading_trailing_spaces'} = [];
@@ -323,17 +319,17 @@ $result_floats{'one_argument_leading_trailing_spaces'} = 
{};
 
 
 
-$result_converted{'plaintext'}->{'one_argument_leading_trailing_spaces'} = '‘ 
in code ’ in slanted VAR _{ sub } ‘http://example.com’ ሴ  w   verb .
+$result_converted{'plaintext'}->{'one_argument_leading_trailing_spaces'} = '‘ 
in code ’ in slanted VAR _{ sub } ‘ http://example.com ’ ሴ  w   verb .
 ';
 
 
 $result_converted{'html_text'}->{'one_argument_leading_trailing_spaces'} = 
'<p><code class="code"> in code </code> <i class="slanted"> in slanted </i> 
<var class="var"> var </var> <sub class="sub"> sub </sub>
-&lsquo;<code class="indicateurl">http://example.com</code>&rsquo; &#x1234; 
&nbsp;w&nbsp;<!-- /@w --> <code class="verb"> verb </code>.
+&lsquo;<code class="indicateurl"> http://example.com </code>&rsquo; &#x1234; 
&nbsp;w&nbsp;<!-- /@w --> <code class="verb"> verb </code>.
 </p>';
 
 
 $result_converted{'latex_text'}->{'one_argument_leading_trailing_spaces'} = 
'\\texttt{\\ in code } \\textsl{ in slanted } \\GNUTexinfocommandstyletextvar{ 
var } \\textsubscript{ sub }
-\\hyphenation{a-b c-d}`\\texttt{http://example.com}\' ሴ \\hbox{ w } \\verb: 
verb :.
+\\hyphenation{a-b c-d}`\\texttt{\\ http://example.com }\' ሴ \\hbox{ w } 
\\verb: verb :.
 ';
 
 1;
diff --git a/tp/t/results/xml_tests/commands_and_spaces.pl 
b/tp/t/results/xml_tests/commands_and_spaces.pl
index 3600a5c8d6..21a1c3317f 100644
--- a/tp/t/results/xml_tests/commands_and_spaces.pl
+++ b/tp/t/results/xml_tests/commands_and_spaces.pl
@@ -1462,13 +1462,9 @@ $result_trees{'commands_and_spaces'} = {
                   'contents' => [
                     {
                       'parent' => {},
-                      'text' => 'http://ggg'
+                      'text' => ' http://ggg '
                     }
                   ],
-                  'extra' => {
-                    'spaces_after_argument' => ' ',
-                    'spaces_before_argument' => ' '
-                  },
                   'parent' => {},
                   'type' => 'brace_command_arg'
                 }
@@ -2132,7 +2128,7 @@ T.
 
 Math \\underline{ a, b} .
 
-http://ggg
+ http://ggg 
 
 truc: machin bidule  chose arg
 T
@@ -2302,7 +2298,7 @@ in tex
 </para>
 <para>Math <math spaces=" ">\\underline{ a, b} </math>.
 </para>
-<para><indicateurl spaces=" ">http://ggg </indicateurl>
+<para><indicateurl> http://ggg </indicateurl>
 </para>
 <deffn spaces=" " endspaces=" "><definitionterm><indexterm index="fn" 
number="1">machin</indexterm><defcategory bracketed="on" spaces=" 
">truc</defcategory> <deffunction bracketed="on" spaces=" 
">machin</deffunction>  <defparam bracketed="on" spaces=" ">bidule</defparam>  
<defparam bracketed="on" spaces="  ">chose</defparam> <defparam bracketed="on" 
spaces="  ">arg</defparam></definitionterm>
 <definitionitem><para>T



reply via email to

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