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 (_handle_open_brace)


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_handle_open_brace) (_process_remaining_on_line): handle @verb delimiter determination in handle_open_brace to do the same as in the XS parser.
Date: Fri, 14 Jul 2023 07:42:07 -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 3f65deffe9 * tp/Texinfo/ParserNonXS.pm (_handle_open_brace) 
(_process_remaining_on_line): handle @verb delimiter determination in 
handle_open_brace to do the same as in the XS parser.
3f65deffe9 is described below

commit 3f65deffe92a3c4b63e219e183da96191f9bf0b2
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Jul 14 13:41:57 2023 +0200

    * tp/Texinfo/ParserNonXS.pm (_handle_open_brace)
    (_process_remaining_on_line): handle @verb delimiter determination
    in handle_open_brace to do the same as in the XS parser.
---
 ChangeLog                 |  6 ++++++
 tp/Texinfo/ParserNonXS.pm | 33 ++++++++++++++++-----------------
 2 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2843cde593..9d54d326dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-07-14  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_handle_open_brace)
+       (_process_remaining_on_line): handle @verb delimiter determination
+       in handle_open_brace to do the same as in the XS parser.
+
 2023-07-14  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line),
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 9c084cc989..41c2699595 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -5739,7 +5739,22 @@ sub _handle_open_brace($$$$)
     push @{$self->{'nesting_context'}->{'basic_inline_stack'}}, $command
       if ($self->{'basic_inline_commands'}
           and $self->{'basic_inline_commands'}->{$command});
-    if ($self->{'brace_commands'}->{$command} eq 'context') {
+    if ($command eq 'verb') {
+      $current->{'type'} = 'brace_command_arg';
+      $current->{'parent'}->{'info'} = {} if (!$current->{'parent'}->{'info'});
+      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(
+            __("\@verb without associated character"), $source_info);
+      } else {
+        $line =~ s/^(.)//;
+        $current->{'parent'}->{'info'}->{'delimiter'} = $1;
+      }
+    } elsif ($self->{'brace_commands'}->{$command} eq 'context') {
       if ($command eq 'caption' or $command eq 'shortcaption') {
         my $float;
         $self->{'nesting_context'}->{'caption'} += 1;
@@ -6453,22 +6468,6 @@ sub _process_remaining_on_line($$$$)
   # in @verb. type should be 'brace_command_arg'
   } elsif ($current->{'parent'} and $current->{'parent'}->{'cmdname'}
          and $current->{'parent'}->{'cmdname'} eq 'verb') {
-    $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(
-            __("\@verb without associated character"), $source_info);
-      } else {
-        $line =~ s/^(.)//;
-        $current->{'parent'}->{'info'}->{'delimiter'} = $1;
-      }
-    }
     my $char = quotemeta($current->{'parent'}->{'info'}->{'delimiter'});
     if ($line =~ s/^(.*?)$char\}/\}/) {
       push @{$current->{'contents'}},



reply via email to

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