texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/ParserNonXS.pm (_process_remaining_o


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line), tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): call new_line after verb opening brace if the line is an empty string in case the delimiter is in macro expansion.
Date: Fri, 14 Jul 2023 07:28:35 -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 2d564d5d43 * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line), 
tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): call new_line after 
verb opening brace if the line is an empty string in case the delimiter is in 
macro expansion.
2d564d5d43 is described below

commit 2d564d5d4335d340034996ed3a2758cb34e1321f
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Jul 14 13:28:24 2023 +0200

    * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line),
    tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): call
    new_line after verb opening brace if the line is an empty string
    in case the delimiter is in macro expansion.
---
 ChangeLog                            |  7 +++++++
 tp/Texinfo/ParserNonXS.pm            |  6 +++++-
 tp/Texinfo/XS/parsetexi/macro.c      |  2 +-
 tp/Texinfo/XS/parsetexi/separator.c  |  3 +++
 tp/t/results/macro/macro_for_verb.pl | 27 ++++++---------------------
 5 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a12da0ffcb..2843cde593 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-07-14  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line),
+       tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): call
+       new_line after verb opening brace if the line is an empty string
+       in case the delimiter is in macro expansion.
+
 2023-07-14  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Makefile.tres, tp/t/60macro.t: add macro_for_verb test.
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index a5263e52e5..9c084cc989 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -4874,7 +4874,7 @@ sub _handle_macro($$$$$)
   }
 
   $self->{'macro_expansion_nr'}++;
-  print STDERR "MACRO NUMBER $self->{'macro_expansion_nr'} $command\n"
+  print STDERR "MACRO EXPANSION NUMBER $self->{'macro_expansion_nr'} 
$command\n"
     if ($self->{'DEBUG'});
 
   if ($expanded_macro->{'cmdname'} eq 'linemacro') {
@@ -6456,6 +6456,10 @@ sub _process_remaining_on_line($$$$)
     $current->{'parent'}->{'info'} = {} if (!$current->{'parent'}->{'info'});
     # collect the first character if not already done
     if (!defined($current->{'parent'}->{'info'}->{'delimiter'})) {
+      if ($line eq '') {
+        # the delimiter may be in macro expansion
+        ($line, $source_info) = _new_line($self, $current);
+      }
       if ($line =~ /^$/) {
         $current->{'parent'}->{'info'}->{'delimiter'} = '';
         $self->_line_error(
diff --git a/tp/Texinfo/XS/parsetexi/macro.c b/tp/Texinfo/XS/parsetexi/macro.c
index 03f14dd4c5..32d35161f8 100644
--- a/tp/Texinfo/XS/parsetexi/macro.c
+++ b/tp/Texinfo/XS/parsetexi/macro.c
@@ -695,7 +695,7 @@ handle_macro (ELEMENT *current, char **line_inout, enum 
command_id cmd)
 
   macro_expansion_nr++;
 
-  debug ("MACRO NUMBER %d %s", macro_expansion_nr, command_name(cmd));
+  debug ("MACRO EXPANSION NUMBER %d %s", macro_expansion_nr, 
command_name(cmd));
 
   if (macro->cmd == CM_linemacro)
     goto funexit;
diff --git a/tp/Texinfo/XS/parsetexi/separator.c 
b/tp/Texinfo/XS/parsetexi/separator.c
index 6795a14c86..ab124cf776 100644
--- a/tp/Texinfo/XS/parsetexi/separator.c
+++ b/tp/Texinfo/XS/parsetexi/separator.c
@@ -54,6 +54,9 @@ handle_open_brace (ELEMENT *current, char **line_inout)
       if (command == CM_verb)
         {
           current->type = ET_brace_command_arg;
+          /* the delimiter may be in macro expansion */
+          if (!*line)
+            line = new_line (current);
           /* Save the deliminating character in 'type'. */
           if (!*line || *line == '\n')
             {
diff --git a/tp/t/results/macro/macro_for_verb.pl 
b/tp/t/results/macro/macro_for_verb.pl
index 7641d48935..5d682fbd3e 100644
--- a/tp/t/results/macro/macro_for_verb.pl
+++ b/tp/t/results/macro/macro_for_verb.pl
@@ -104,11 +104,10 @@ $result_trees{'macro_for_verb'} = {
                           'status' => 'end'
                         }
                       ],
-                      'text' => '',
-                      'type' => 'raw'
+                      'text' => ''
                     },
                     {
-                      'text' => '@ some text
+                      'text' => ' some text
 ',
                       'type' => 'raw'
                     },
@@ -121,10 +120,6 @@ $result_trees{'macro_for_verb'} = {
                       'text' => '@code
 ',
                       'type' => 'raw'
-                    },
-                    {
-                      'text' => '@',
-                      'type' => 'raw'
                     }
                   ],
                   'type' => 'brace_command_arg'
@@ -132,7 +127,7 @@ $result_trees{'macro_for_verb'} = {
               ],
               'cmdname' => 'verb',
               'info' => {
-                'delimiter' => ''
+                'delimiter' => '@'
               },
               'source_info' => {
                 'file_name' => '',
@@ -166,23 +161,13 @@ $result_texis{'macro_for_verb'} = '@macro verbopen {}
 
 
 $result_texts{'macro_for_verb'} = '
-@ some text
+ some text
 
 @code
-@
+
 ';
 
-$result_errors{'macro_for_verb'} = [
-  {
-    'error_line' => '@verb without associated character (possibly involving 
@verbopen)
-',
-    'file_name' => '',
-    'line_nr' => 5,
-    'macro' => 'verbopen',
-    'text' => '@verb without associated character',
-    'type' => 'error'
-  }
-];
+$result_errors{'macro_for_verb'} = [];
 
 
 $result_floats{'macro_for_verb'} = {};



reply via email to

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