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 (_parse_def), tp/Texi


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_parse_def), tp/Texinfo/XS/parsetexi/def.c (next_bracketed_or_word_agg) (split_def_args, parse_def): remove code setting spaces_at_end on @def* lines, as it cannot happen anymore. Remove use of spaces_at_end def line type.
Date: Tue, 06 Dec 2022 15:53:52 -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 c75309eee8 * tp/Texinfo/ParserNonXS.pm (_parse_def), 
tp/Texinfo/XS/parsetexi/def.c (next_bracketed_or_word_agg) (split_def_args, 
parse_def): remove code setting spaces_at_end on @def* lines, as it cannot 
happen anymore.  Remove use of spaces_at_end def line type.
c75309eee8 is described below

commit c75309eee800b2c5e36fcdb54692a0099245ac31
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Dec 6 21:53:42 2022 +0100

    * tp/Texinfo/ParserNonXS.pm (_parse_def),
    tp/Texinfo/XS/parsetexi/def.c (next_bracketed_or_word_agg)
    (split_def_args, parse_def): remove code setting spaces_at_end on
    @def* lines, as it cannot happen anymore.  Remove use of spaces_at_end
    def line type.
    
    * tp/Texinfo/XS/parsetexi/def.c: remove unused next_bracketed_or_word
    function.
---
 ChangeLog                     | 11 +++++++++++
 tp/Texinfo/ParserNonXS.pm     |  9 +--------
 tp/Texinfo/XS/parsetexi/def.c | 26 +-------------------------
 3 files changed, 13 insertions(+), 33 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0d88a043ff..417217c7de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-12-06  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_parse_def),
+       tp/Texinfo/XS/parsetexi/def.c (next_bracketed_or_word_agg)
+       (split_def_args, parse_def): remove code setting spaces_at_end on
+       @def* lines, as it cannot happen anymore.  Remove use of spaces_at_end
+       def line type.
+
+       * tp/Texinfo/XS/parsetexi/def.c: remove unused next_bracketed_or_word
+       function.
+
 2022-12-06  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Transformations.pm (fill_gaps_in_sectioning): tree
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index eb3f91f5c3..847325b31c 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -2730,9 +2730,6 @@ sub _parse_def($$$)
         and ($token->{'type'} eq 'spaces'
                or $token->{'type'} eq 'spaces_inserted')) {
       if ($token->{'text'}) {
-        if ($token->{'text'} =~ /\n$/) {
-          $token->{'type'} = 'spaces_at_end';
-        }
         push @result, ['spaces', $token];
         shift @contents;
       } else {
@@ -2776,9 +2773,6 @@ sub _parse_def($$$)
       $next_token = shift @contents;
     }
     if (defined($spaces)) {
-      if ($spaces->{'text'} =~ /\n$/) {
-        $spaces->{'type'} = 'spaces_at_end';
-      }
       push @args_results, ['spaces', $spaces]
     }
     last if (!defined($next_token));
@@ -7200,8 +7194,7 @@ C<@verb>, C<@macro> body).
 =item spaces_at_end
 
 Space within an index @-command before an @-command interrupting the
-index command, or at the end of line and end of bracketed content
-on a definition line.
+index command.
 
 =item text_before_beginning
 
diff --git a/tp/Texinfo/XS/parsetexi/def.c b/tp/Texinfo/XS/parsetexi/def.c
index bea4544d14..4825ea2691 100644
--- a/tp/Texinfo/XS/parsetexi/def.c
+++ b/tp/Texinfo/XS/parsetexi/def.c
@@ -65,23 +65,6 @@ gather_def_item (ELEMENT *current, enum command_id 
next_command)
 
 /* Starting at I in the contents, return the next non-whitespace element,
    incrementing I.  Return null if no more elements. */
-ELEMENT *
-next_bracketed_or_word (ELEMENT *current, int *i)
-{
-  while (1)
-    {
-      if (*i == current->contents.number)
-        return 0;
-      if (current->contents.list[*i]->type != ET_spaces
-          && current->contents.list[*i]->type != ET_spaces_inserted
-          && current->contents.list[*i]->type != ET_spaces_at_end
-          && current->contents.list[*i]->type != ET_delimiter)
-        break;
-      (*i)++;
-    }
-  return current->contents.list[(*i)++];
-}
-
 ELEMENT *
 next_bracketed_or_word_agg (ELEMENT *current, int *i)
 {
@@ -96,7 +79,6 @@ next_bracketed_or_word_agg (ELEMENT *current, int *i)
       e = current->contents.list[*i];
       if (e->type == ET_spaces
           || e->type == ET_spaces_inserted
-          || e->type == ET_spaces_at_end
           || e->type == ET_delimiter)
         {
           if (num > 0)
@@ -238,12 +220,7 @@ split_def_args (ELEMENT *current, int starting_idx)
               insert_into_contents (current, new, i++);
               add_extra_string_dup (new, "def_role", "spaces");
               if (!*(p += len))
-                {
-                  if (new->text.end > 0
-                      && new->text.text[new->text.end - 1] == '\n')
-                    new->type = ET_spaces_at_end;
                   break;
-                }
             }
             
           len = strcspn (p, whitespace_chars);
@@ -375,8 +352,7 @@ found:
     {
       e = contents_child_by_index (current, i);
       if (e->type == ET_spaces
-          || e->type == ET_spaces_inserted
-          || e->type == ET_spaces_at_end)
+          || e->type == ET_spaces_inserted)
         {
           continue;
         }



reply via email to

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