texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/XS/parsetexi/parser.c (process_remai


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line): really add new text after brace command.
Date: Sat, 27 Aug 2022 09:29:15 -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 92281deba0 * tp/Texinfo/XS/parsetexi/parser.c 
(process_remaining_on_line): really add new text after brace command.
92281deba0 is described below

commit 92281deba034780f72e8cf0ef48451f0671b2edd
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Aug 27 15:28:41 2022 +0200

    * tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line):
    really add new text after brace command.
    
    * tp/Texinfo/ParserNonXS.pm (_parse_texi): remove comment on hack
    for difference with XS parser.  Add/modify debug messages.
---
 ChangeLog                                                      | 10 ++++++++++
 tp/Texinfo/ParserNonXS.pm                                      | 10 ++++++----
 tp/Texinfo/XS/parsetexi/parser.c                               |  2 +-
 tp/t/results/coverage/spaces_after_braced_command.pl           |  2 ++
 .../layout/res_parser/formatting_macro_expand/formatting.texi  |  4 ++++
 5 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index aa56ea048a..f27a687c87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-08-27  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_parse_texi): remove comment on hack
+       for difference with XS parser.  Add/modify debug messages.
+
+2022-08-27  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line):
+       really add new text after brace command.
+
 2022-08-27  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm (_parse_texi),
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 99f201ca84..53cd272eee 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -4216,7 +4216,8 @@ sub _parse_texi($$$)
           if $self->{'DEBUG'};
         # special case for @-command as argument of @itemize or @*table.
         if (_command_with_command_as_argument($current->{'parent'})) {
-          print STDERR "FOR PARENT 
\@$current->{'parent'}->{'parent'}->{'cmdname'} command_as_argument 
$current->{'cmdname'}\n" if ($self->{'DEBUG'});
+          print STDERR "FOR PARENT 
\@$current->{'parent'}->{'parent'}->{'cmdname'} ".
+                 "command_as_argument $current->{'cmdname'}\n" if 
($self->{'DEBUG'});
           $current->{'type'} = 'command_as_argument' if (!$current->{'type'});
           $current->{'parent'}->{'parent'}->{'extra'}->{'command_as_argument'}
             = $current;
@@ -4225,11 +4226,13 @@ sub _parse_texi($$$)
             
$current->{'parent'}->{'parent'}->{'extra'}->{'command_as_argument_kbd_code'} = 
1;
           }
           $current = $current->{'parent'};
-          # Note that non ascii spaces do not count as spaces
+        # Note that non ascii spaces do not count as spaces
         } elsif ($line =~ s/^(\s+)//
                  and ($accent_commands{$current->{'cmdname'}}
                       or $self->{'IGNORE_SPACE_AFTER_BRACED_COMMAND_NAME'})) {
           my $added_space = $1;
+          print STDERR "BRACE spaces ignored '$added_space'\n"
+            if $self->{'DEBUG'};
           $current->{'extra'}->{'spaces'} = ''
             if (!defined($current->{'extra'}->{'spaces'}));
           $current->{'extra'}->{'spaces'} .= $added_space;
@@ -4238,8 +4241,6 @@ sub _parse_texi($$$)
                __("command `\@%s' must not be followed by new line"),
                $current->{'cmdname'}), $source_info);
           }
-          # FIXME temporary hack to get the same output as XS parser
-          #$current->{'extra'}->{'spaces'} =~ s/\n\n/\n/;
         # special case for accent commands, use following character except @
         # as argument
         } elsif ($accent_commands{$current->{'cmdname'}}
@@ -4331,6 +4332,7 @@ sub _parse_texi($$$)
       } elsif ($current->{'args'} and @{$current->{'args'}}
                and $current->{'args'}->[-1]->{'type'}
                and $current->{'args'}->[-1]->{'type'} eq 
'menu_entry_separator') {
+        print STDERR "AFTER menu_entry_separator\n" if ($self->{'DEBUG'});
         my $separator = $current->{'args'}->[-1]->{'text'};
         # separator is ::, we concatenate and let the while restart
         # in order to collect spaces below
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 0463bd50ad..8217f37d4a 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -1454,7 +1454,7 @@ superfluous_arg:
              {
                xasprintf (&s, "%s%.*s",
                          (char *) k->value,
-                         (int) (p - line), p);
+                         (int) (p - line), line);
                free (k->value);
                k->value = (ELEMENT *) s;
              }
diff --git a/tp/t/results/coverage/spaces_after_braced_command.pl 
b/tp/t/results/coverage/spaces_after_braced_command.pl
index e4aca10515..177b271857 100644
--- a/tp/t/results/coverage/spaces_after_braced_command.pl
+++ b/tp/t/results/coverage/spaces_after_braced_command.pl
@@ -108,6 +108,7 @@ $result_trees{'spaces_after_braced_command'} = {
               'contents' => [],
               'extra' => {
                 'spaces' => '
+
 '
               },
               'parent' => {},
@@ -157,6 +158,7 @@ $result_texis{'spaces_after_braced_command'} = '@code {b}
 {v}
 
 @TeX
+
 {}
 ';
 
diff --git a/tp/tests/layout/res_parser/formatting_macro_expand/formatting.texi 
b/tp/tests/layout/res_parser/formatting_macro_expand/formatting.texi
index 454858b935..72896e67c0 100644
--- a/tp/tests/layout/res_parser/formatting_macro_expand/formatting.texi
+++ b/tp/tests/layout/res_parser/formatting_macro_expand/formatting.texi
@@ -2174,6 +2174,7 @@ Invalid use of @@':@*
 
 @c braces missing
 @@TeX, but without brace @TeX
+
 @c unknown command
 @code{@@#} #
 
@@ -3322,6 +3323,7 @@ Invalid use of @@':@*
 
 @c braces missing
 @@TeX, but without brace @TeX
+
 @c unknown command
 @code{@@#} #
 
@@ -4496,6 +4498,7 @@ Invalid use of @@':@*
 
 @c braces missing
 @@TeX, but without brace @TeX
+
 @c unknown command
 @code{@@#} #
 
@@ -5651,6 +5654,7 @@ Invalid use of @@':@*
 
 @c braces missing
 @@TeX, but without brace @TeX
+
 @c unknown command
 @code{@@#} #
 



reply via email to

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