[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/ParserNonXS.pm (registrar), tp/Texin
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/ParserNonXS.pm (registrar), tp/Texinfo/XS/parsetexi/Parsetexi.pm (registrar): get self argument. |
Date: |
Thu, 07 Mar 2024 16:11:58 -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 008415fc1d * tp/Texinfo/ParserNonXS.pm (registrar),
tp/Texinfo/XS/parsetexi/Parsetexi.pm (registrar): get self argument.
008415fc1d is described below
commit 008415fc1d3670252f520adfc5a703fe9998edae
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Mar 7 22:11:59 2024 +0100
* tp/Texinfo/ParserNonXS.pm (registrar),
tp/Texinfo/XS/parsetexi/Parsetexi.pm (registrar): get self argument.
* tp/Texinfo/XS/main/build_perl_info.c
(pass_document_parser_errors_to_registrar),
tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_parser_info),
tp/Texinfo/XS/parsetexi/Parsetexi.xs
(pass_document_parser_errors_to_registrar): pass directly document
prser errors to registrar. Remove pass_document_parser_errors.
---
ChangeLog | 12 +++++++++++
tp/Texinfo/ParserNonXS.pm | 1 +
tp/Texinfo/XS/main/build_perl_info.c | 42 ++++++++++++++++--------------------
tp/Texinfo/XS/main/build_perl_info.h | 3 ++-
tp/Texinfo/XS/parsetexi/Parsetexi.pm | 11 ++++------
tp/Texinfo/XS/parsetexi/Parsetexi.xs | 4 ++--
6 files changed, 40 insertions(+), 33 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c190f59bd3..a0d781392e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2024-03-07 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/ParserNonXS.pm (registrar),
+ tp/Texinfo/XS/parsetexi/Parsetexi.pm (registrar): get self argument.
+
+ * tp/Texinfo/XS/main/build_perl_info.c
+ (pass_document_parser_errors_to_registrar),
+ tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_parser_info),
+ tp/Texinfo/XS/parsetexi/Parsetexi.xs
+ (pass_document_parser_errors_to_registrar): pass directly document
+ prser errors to registrar. Remove pass_document_parser_errors.
+
2024-03-07 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/ParserNonXS.pm (errors),
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 84a0bfde35..2d9038d89b 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -975,6 +975,7 @@ sub _parse_texi_document($)
# Only used in a test, not documented, there for symmetry with document
sub registrar($)
{
+ my $self = shift;
return $self->{'registrar'};
}
diff --git a/tp/Texinfo/XS/main/build_perl_info.c
b/tp/Texinfo/XS/main/build_perl_info.c
index 04d8dbf9d6..caa1c8e59f 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -1203,29 +1203,6 @@ build_errors (ERROR_MESSAGE *error_list, size_t
error_number)
return av;
}
-/* build perl errors list and clear XS document parser errors */
-SV *
-pass_document_parser_errors (size_t document_descriptor)
-{
- DOCUMENT *document;
- AV *av_parser_errors_list;
-
- dTHX;
-
- document = retrieve_document (document_descriptor);
-
- if (!document)
- return newSV (0);
-
- av_parser_errors_list
- = build_errors (document->parser_error_messages->list,
- document->parser_error_messages->number);
-
- clear_document_parser_errors (document_descriptor);
-
- return newRV_inc ((SV *) av_parser_errors_list);
-}
-
/* build perl errors list and clear XS document errors */
/* Currently unused */
SV *
@@ -1821,6 +1798,25 @@ pass_errors_to_registrar (ERROR_MESSAGE_LIST
*error_messages, SV *object_sv,
return newSV (0);
}
+void
+pass_document_parser_errors_to_registrar (int document_descriptor,
+ SV *parser_sv)
+{
+ DOCUMENT *document;
+ SV *errors_warnings_sv = 0;
+ SV *error_nrs_sv = 0;
+
+ dTHX;
+
+ document = retrieve_document (document_descriptor);
+
+ if (!document)
+ return;
+
+ pass_errors_to_registrar (document->parser_error_messages, parser_sv,
+ &errors_warnings_sv, &error_nrs_sv);
+}
+
AV *
build_integer_stack (const INTEGER_STACK *integer_stack)
{
diff --git a/tp/Texinfo/XS/main/build_perl_info.h
b/tp/Texinfo/XS/main/build_perl_info.h
index 533add9a5f..d831c636bc 100644
--- a/tp/Texinfo/XS/main/build_perl_info.h
+++ b/tp/Texinfo/XS/main/build_perl_info.h
@@ -47,7 +47,8 @@ HV *build_global_info (GLOBAL_INFO *global_info_ref,
GLOBAL_COMMANDS *global_commands_ref);
HV *build_global_commands (GLOBAL_COMMANDS *global_commands_ref);
-SV *pass_document_parser_errors (size_t document_descriptor);
+void pass_document_parser_errors_to_registrar (int document_descriptor,
+ SV *parser_sv);
SV *pass_document_errors (size_t document_descriptor);
SV *pass_errors_to_registrar (ERROR_MESSAGE_LIST *error_messages,
SV *object_sv,
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
index 76b9f10030..72b1452009 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
@@ -4,12 +4,12 @@
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License,
# or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -205,11 +205,7 @@ sub _get_parser_info($$;$$) {
# get hold of errors before calling build_document, as if $no_store is set
# they will be destroyed.
- my $parser_errors = pass_document_parser_errors($document_descriptor);
- # Copy the errors into the parser Texinfo::Report error list.
- foreach my $error (@$parser_errors) {
- $parser_registrar->add_formatted_message($error);
- }
+ pass_document_parser_errors_to_registrar($document_descriptor, $self);
my $document;
if ($no_build) {
@@ -334,6 +330,7 @@ sub parse_texi_line($$;$$$)
# Only used in a test, not documented, there for symmetry with document
sub registrar($)
{
+ my $self = shift;
return $self->{'registrar'};
}
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.xs
b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
index c2f3864be6..a2162bf412 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.xs
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
@@ -102,8 +102,8 @@ build_document (int document_descriptor, ...)
SV *
get_document (int document_descriptor)
-SV *
-pass_document_parser_errors (int document_descriptor)
+void
+pass_document_parser_errors_to_registrar (int document_descriptor, SV
*parser_sv)
void
parser_store_value (name, value)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/ParserNonXS.pm (registrar), tp/Texinfo/XS/parsetexi/Parsetexi.pm (registrar): get self argument.,
Patrice Dumas <=