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 (_close_current) (_pr


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_close_current) (_process_remaining_on_line, _parse_texi): use same messages as XS parser. Remove redundant checks on contents, now if contetns exists, there is some contents.
Date: Fri, 24 Feb 2023 16:24:06 -0500

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 55fa6707a6 * tp/Texinfo/ParserNonXS.pm (_close_current) 
(_process_remaining_on_line, _parse_texi): use same messages as XS parser.  
Remove redundant checks on contents, now if contetns exists, there is some 
contents.
55fa6707a6 is described below

commit 55fa6707a65ecfd46a88b0a86c483d34b4829394
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Feb 24 22:23:56 2023 +0100

    * tp/Texinfo/ParserNonXS.pm (_close_current)
    (_process_remaining_on_line, _parse_texi): use same messages as XS
    parser.  Remove redundant checks on contents, now if contetns exists,
    there is some contents.
    
    * tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): remove
    useless code for an impossible situation.
---
 ChangeLog                           | 10 ++++++++++
 tp/Texinfo/ParserNonXS.pm           | 14 +++++---------
 tp/Texinfo/XS/parsetexi/separator.c |  7 -------
 3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3afaf9c313..2f085bb898 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2023-02-24  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_close_current)
+       (_process_remaining_on_line, _parse_texi): use same messages as XS
+       parser.  Remove redundant checks on contents, now if contetns exists,
+       there is some contents.
+
+       * tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): remove
+       useless code for an impossible situation.
+
 2023-02-24  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm (_parse_special_misc_command): match
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index d12ddb6480..08dde4c299 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -2046,10 +2046,8 @@ sub _close_current($$$;$$)
   } elsif ($current->{'type'}) {
     print STDERR "CLOSING type $current->{'type'}\n" if ($self->{'DEBUG'});
     if ($current->{'type'} eq 'bracketed') {
-      $self->_command_error($current, $source_info,
-                            __("misplaced %c"), ord('{'));
+      $self->_command_error($current, $source_info, __("misplaced {"));
       if ($current->{'contents'}
-          and @{$current->{'contents'}}
           and $current->{'contents'}->[0]->{'type'}
           and $current->{'contents'}->[0]->{'type'}
                 eq 'internal_spaces_before_argument') {
@@ -6199,7 +6197,8 @@ sub _process_remaining_on_line($$$$)
             if ($command eq 'inlineraw');
         }
         print STDERR "OPENED \@$current->{'parent'}->{'cmdname'}, remaining: "
-          .(defined($current->{'parent'}->{'remaining_args'}) ? "remaining: 
$current->{'parent'}->{'remaining_args'}, " : '')
+          .(defined($current->{'parent'}->{'remaining_args'})
+              ? "remaining: $current->{'parent'}->{'remaining_args'}, " : '')
           .($current->{'type'} ? "type: $current->{'type'}" : '')."\n"
            if ($self->{'DEBUG'});
       } elsif ($current->{'parent'}
@@ -6241,8 +6240,7 @@ sub _process_remaining_on_line($$$$)
         print STDERR "BRACKETED in math/rawpreformatted/inlineraw\n"
            if ($self->{'DEBUG'});
       } else {
-        $self->_line_error(sprintf(__("misplaced %c"),
-                                         ord('{')), $source_info);
+        $self->_line_error(sprintf(__("misplaced {")), $source_info);
       }
 
     } elsif ($separator eq '}') {
@@ -6480,8 +6478,7 @@ sub _process_remaining_on_line($$$$)
                                          'parent' => $current };
 
       } else {
-        $self->_line_error(sprintf(__("misplaced %c"),
-                                 ord('}')), $source_info);
+        $self->_line_error(sprintf(__("misplaced }")), $source_info);
       }
     } elsif ($separator eq ','
              and $current->{'parent'}
@@ -6759,7 +6756,6 @@ sub _parse_texi($$$)
       print STDERR "BEGIN LINE\n" if ($self->{'DEBUG'});
 
       if ($current->{'contents'}
-          and $current->{'contents'}->[-1]
           and $current->{'contents'}->[-1]->{'type'}
           and $current->{'contents'}->[-1]->{'type'}
                eq 'internal_spaces_before_argument') {
diff --git a/tp/Texinfo/XS/parsetexi/separator.c 
b/tp/Texinfo/XS/parsetexi/separator.c
index 65b5cec3b8..41494a4dcb 100644
--- a/tp/Texinfo/XS/parsetexi/separator.c
+++ b/tp/Texinfo/XS/parsetexi/separator.c
@@ -204,13 +204,6 @@ handle_open_brace (ELEMENT *current, char **line_inout)
   else
     {
       line_error ("misplaced {");
-      if (current->contents.number > 0
-          && last_contents_child(current)->type
-               == ET_internal_spaces_before_argument)
-        {
-          /* FIXME: Is this right? */
-          remove_from_contents (current, 0);
-        }
     }
 
   *line_inout = line;



reply via email to

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