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 (_prepare_input_from_


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_prepare_input_from_text) (parse_texi_piece, parse_texi_line, parse_texi_text): remove arguments not consistent with XS parser. The input should only be a simple string.
Date: Fri, 06 Jan 2023 15:16:34 -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 ce3fdd8770 * tp/Texinfo/ParserNonXS.pm (_prepare_input_from_text) 
(parse_texi_piece, parse_texi_line, parse_texi_text): remove arguments not 
consistent with XS parser.  The input should only be a simple string.
ce3fdd8770 is described below

commit ce3fdd87706037c35c6fc42505776e0f4cce313f
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Jan 6 21:16:22 2023 +0100

    * tp/Texinfo/ParserNonXS.pm (_prepare_input_from_text)
    (parse_texi_piece, parse_texi_line, parse_texi_text): remove arguments
    not consistent with XS parser.  The input should only be a simple
    string.
---
 ChangeLog                 |   7 +++
 tp/Texinfo/ParserNonXS.pm | 117 ++++++----------------------------------------
 2 files changed, 22 insertions(+), 102 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d416b25a45..e77da072af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-01-06  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_prepare_input_from_text)
+       (parse_texi_piece, parse_texi_line, parse_texi_text): remove arguments
+       not consistent with XS parser.  The input should only be a simple
+       string.
+
 2023-01-05  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm (%parser_state_initialization, _next_text)
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 6f97e0e581..96237a05fe 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -809,21 +809,18 @@ sub _complete_line_nr($$;$$$)
   return $new_lines;
 }
 
-sub _prepare_input_from_text($$;$$$$)
+sub _prepare_input_from_text($$;$)
 {
-  my ($self, $text, $lines_nr, $file, $macro, $fixed_line_number) = @_;
+  my ($self, $text, $line_nr) = @_;
 
   return 0 if (!defined($text));
 
-  if (ref($text) eq '') {
-    $text = _text_to_lines($text);
-  }
-  if (not defined($lines_nr)) {
-    $lines_nr = 1;
+  $text = _text_to_lines($text);
+  if (not defined($line_nr)) {
+    $line_nr = 1;
   }
 
-  my $lines_array = _complete_line_nr($text, $lines_nr, $file,
-                                     $macro, $fixed_line_number);
+  my $lines_array = _complete_line_nr($text, $line_nr);
 
   $self->{'input'} = [{'pending' => $lines_array}];
   return 1;
@@ -831,17 +828,13 @@ sub _prepare_input_from_text($$;$$$$)
 
 # entry point for text fragments.
 # Used in some tests.
-# To be in line with the XS Parser,
-#  $lines_nr should only be an integer and text a string.
-#  $file, $macro, $fixed_line_number should never be used.
-sub parse_texi_piece($$;$$$$)
+sub parse_texi_piece($$;$)
 {
-  my ($self, $text, $lines_nr, $file, $macro, $fixed_line_number) = @_;
+  my ($self, $text, $line_nr) = @_;
 
   $self = parser() if (!defined($self));
 
-  return undef unless (_prepare_input_from_text($self, $text, $lines_nr, $file,
-                                                $macro, $fixed_line_number));
+  return undef unless (_prepare_input_from_text($self, $text, $line_nr));
 
   my ($document_root, $before_node_section)
      = _setup_document_root_and_before_node_section();
@@ -850,34 +843,26 @@ sub parse_texi_piece($$;$$$$)
   return $tree;
 }
 
-# To be in line with the XS Parser,
-#  $lines_nr should only be an integer and text a string.
-#  $file, $macro, $fixed_line_number should never be used.
-sub parse_texi_line($$;$$$$)
+sub parse_texi_line($$;$)
 {
-  my ($self, $text, $lines_nr, $file, $macro, $fixed_line_number) = @_;
+  my ($self, $text, $line_nr) = @_;
 
   $self = parser() if (!defined($self));
 
-  return undef unless (_prepare_input_from_text($self, $text, $lines_nr, $file,
-                                                $macro, $fixed_line_number));
+  return undef unless (_prepare_input_from_text($self, $text, $line_nr));
 
   my $root = {'type' => 'root_line'};
   my $tree = $self->_parse_texi($root, $root);
   return $tree;
 }
 
-# To be in line with the XS Parser,
-#  $lines_nr should only be an integer and text a string.
-#  $file, $macro, $fixed_line_number should never be used.
-sub parse_texi_text($$;$$$$)
+sub parse_texi_text($$;$)
 {
-  my ($self, $text, $lines_nr, $file, $macro, $fixed_line_number) = @_;
+  my ($self, $text, $line_nr) = @_;
 
   $self = parser() if (!defined($self));
 
-  return undef unless (_prepare_input_from_text($self, $text, $lines_nr, $file,
-                                                $macro, $fixed_line_number));
+  return undef unless (_prepare_input_from_text($self, $text, $line_nr));
 
   return $self->_parse_texi_document();
 }
@@ -6697,16 +6682,6 @@ When C<parse_texi_line> is used, the resulting tree is 
rooted at
 a C<root_line> type container.  Otherwise, the resulting tree should be
 rooted at a C<document_root> type container.
 
-=begin comment
-
-The XS parser implements only part of the arguments and allows only a
-restricted set of arguments types compared to the Perl parser.  We want users
-to use only what is in common, so document only what is in common.
-
-=item $tree = parse_texi_line($parser, $text, $first_line_number, $file_name, 
$macro_name, $fixed_line_number)
-
-=end comment
-
 =over
 
 =item $tree = parse_texi_line($parser, $text, $first_line_number)
@@ -6717,30 +6692,6 @@ This function is used to parse a short fragment of 
Texinfo code.
 I<$text> is the string containing the texinfo line.  I<$first_line_number> is
 the line number of the line, if undef, it will be set to 1.
 
-=begin comment
-
-I<$text> may be either an array reference of lines, or a text.
-
-The other arguments are optional and allow specifying the position
-information of the Texinfo code.  I<$first_line_number> is the line number
-of the first text line.  I<$file_name> is the name of the file the
-text comes from.  I<$macro> is for the user-defined macro name the text
-is expanded from.  If I<$fixed_line_number> is set, the line number is
-not increased for the different lines, as if the text was the expansion
-of a macro.
-
-=end comment
-
-=begin comment
-
-The XS parser implements only part of the arguments and allows only a
-restricted set of arguments types compared to the Perl parser.  We want users
-to use only what is in common, so document only what is in common.
-
-=item $tree = parse_texi_piece ($parser, $text, $line_numbers_specification, 
$file_name, $macro_name, $fixed_line_number)
-
-=end comment
-
 =item $tree = parse_texi_piece($parser, $text, $first_line_number)
 X<C<parse_texi_piece>>
 
@@ -6749,30 +6700,6 @@ This function is used to parse Texinfo fragments.
 I<$text> is the string containing the texinfo text.  I<$first_line_number> is
 the line number of the first text line, if undef, it will be set to 1.
 
-=begin comment
-
-I<$text> may be either an array reference of lines, or a text.
-
-The other arguments are optional and allow specifying the position
-information of the Texinfo code.  I<$first_line_number> is the line number
-of the first text line.  I<$file_name> is the name of the file the
-text comes from.  I<$macro> is for the user-defined macro name the text
-is expanded from.  If I<$fixed_line_number> is set, the line number is
-not increased for the different lines, as if the text was the expansion
-of a macro.
-
-=end comment
-
-=begin comment
-
-The XS parser implements only part of the arguments and allows only a
-restricted set of arguments types compared to the Perl parser.  We want users
-to use only what is in common, so document only what is in common.
-
-=item $tree = parse_texi_text($parser, $text, $line_numbers_specification, 
$file_name, $macro_name, $fixed_line_number)
-
-=end comment
-
 =item $tree = parse_texi_text($parser, $text, $first_line_number)
 X<C<parse_texi_text>>
 
@@ -6781,20 +6708,6 @@ This function is used to parse a text as a whole 
document.
 I<$text> is the string containing the texinfo text.  I<$first_line_number> is
 the line number of the first text line, if undef, it will be set to 1.
 
-=begin comment
-
-I<$text> may be either an array reference of lines, or a text.
-
-The other arguments are optional and allow specifying the position
-information of the Texinfo code.  I<$first_line_number> is the line number
-of the first text line.  I<$file_name> is the name of the file the
-text comes from.  I<$macro> is for the user-defined macro name the text
-is expanded from.  If I<$fixed_line_number> is set, the line number is
-not increased for the different lines, as if the text was the expansion
-of a macro.
-
-=end comment
-
 =item $tree = parse_texi_file($parser, $file_name)
 X<C<parse_texi_file>>
 



reply via email to

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