[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 19 May 2024 16:23:17 -0400 (EDT) |
branch: master
commit 75ce892d3523945138a304e5bff853ca0b21560e
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun May 19 21:37:27 2024 +0200
* tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf, parse_file)
(parse_text, parse_string, parse_texi): call new_document and
set_input_encoding in reset_parser_except_conf.
---
ChangeLog | 6 ++++++
tp/Texinfo/XS/parsetexi/api.c | 17 +++++------------
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5163a1603f..b0c6897044 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-19 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf, parse_file)
+ (parse_text, parse_string, parse_texi): call new_document and
+ set_input_encoding in reset_parser_except_conf.
+
2024-05-19 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/main/translations.c (replace_convert_substrings):
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 5ebbdd5ea9..3a869bf5c7 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -70,6 +70,9 @@ reset_parser_except_conf (void)
reset_obstacks ();
current_node = current_section = current_part = 0;
+
+ parsed_document = new_document ();
+ set_input_encoding ("utf-8");
}
void
@@ -116,9 +119,6 @@ parse_file (const char *filename, const char
*input_file_name,
reset_parser_except_conf ();
- parsed_document = new_document ();
- set_input_encoding ("utf-8");
-
status = input_push_file (filename);
if (status)
{
@@ -164,9 +164,6 @@ parse_text (const char *string, int line_nr)
reset_parser_except_conf ();
- parsed_document = new_document ();
- set_input_encoding ("utf-8");
-
input_push_text (strdup (string), line_nr, 0, 0);
document_descriptor = parse_texi_document ();
return document_descriptor;
@@ -182,10 +179,8 @@ parse_string (const char *string, int line_nr)
int document_descriptor;
reset_parser_except_conf ();
- root_elt = new_element (ET_root_line);
- parsed_document = new_document ();
- set_input_encoding ("utf-8");
+ root_elt = new_element (ET_root_line);
input_push_text (strdup (string), line_nr, 0, 0);
document_descriptor = parse_texi (root_elt, root_elt);
@@ -200,12 +195,10 @@ parse_piece (const char *string, int line_nr)
ELEMENT *before_node_section, *document_root;
reset_parser_except_conf ();
+
before_node_section = setup_document_root_and_before_node_section ();
document_root = before_node_section->parent;
- parsed_document = new_document ();
- set_input_encoding ("utf-8");
-
input_push_text (strdup (string), line_nr, 0, 0);
document_descriptor = parse_texi (document_root, before_node_section);
return document_descriptor;