[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 3 Mar 2024 17:49:46 -0500 (EST) |
branch: master
commit d3cfe2d4dfa66f1b39089f67586acb6a2a10c485
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Mar 3 22:00:18 2024 +0100
* tp/t/test_protect_hashchar_at_line_beginning.t (run_test): store
tree transformation error messags in document registrar. Use document
error function to get errors and merge with parser registrar errors.
---
ChangeLog | 6 ++++++
tp/t/test_protect_hashchar_at_line_beginning.t | 14 +++++++-------
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ce38fec330..d792ac3182 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,12 @@
* tp/Texinfo/XS/main/get_perl_info.c: Remove unnecessary #include.
+2024-03-03 Patrice Dumas <pertusus@free.fr>
+
+ * tp/t/test_protect_hashchar_at_line_beginning.t (run_test): store
+ tree transformation error messags in document registrar. Use document
+ error function to get errors and merge with parser registrar errors.
+
2024-03-03 Patrice Dumas <pertusus@free.fr>
Change name of registrar variables to clarify the type of registrar
diff --git a/tp/t/test_protect_hashchar_at_line_beginning.t
b/tp/t/test_protect_hashchar_at_line_beginning.t
index 34cba65cdd..86b5c14145 100644
--- a/tp/t/test_protect_hashchar_at_line_beginning.t
+++ b/tp/t/test_protect_hashchar_at_line_beginning.t
@@ -42,19 +42,19 @@ sub run_test($$$;$)
my $corrected_tree =
Texinfo::Transformations::protect_hashchar_at_line_beginning($tree,
- $parser_registrar, $parser);
+ $document->registrar(), $parser);
Texinfo::Document::rebuild_document($document);
$corrected_tree = $document->tree();
- if ($with_XS) {
- foreach my $error (@{$document->{'errors'}}) {
- $parser_registrar->add_formatted_message($error);
- }
- }
-
if (defined($error_message)) {
+ my $parser_registrar = $parser->registered_errors();
my ($errors, $errors_count) = $parser_registrar->errors();
+ my ($document_errors, $document_errors_count)
+ = $document->errors();
+ $errors_count += $document_errors_count if ($document_errors_count);
+ push @$errors, @$document_errors;
+
my ($error_line_nr_reference, $error_line_reference) = @$error_message;
if (!$error_line_reference) {
if ($errors and scalar(@$errors)) {