[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/ParserNonXS.pm (_handle_open_brace,
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/ParserNonXS.pm (_handle_open_brace, _handle_close_brace), tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace, handle_close_brace): right in a rawpreformatted, use merge_text to merge an opening or a closing brace to the preceding text, if any. |
Date: |
Sat, 11 Mar 2023 05:09:00 -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 f2b89f502b * tp/Texinfo/ParserNonXS.pm (_handle_open_brace,
_handle_close_brace), tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace,
handle_close_brace): right in a rawpreformatted, use merge_text to merge an
opening or a closing brace to the preceding text, if any.
f2b89f502b is described below
commit f2b89f502bf025fcb0fd65d908ba6862a45fd294
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Mar 11 11:08:51 2023 +0100
* tp/Texinfo/ParserNonXS.pm (_handle_open_brace, _handle_close_brace),
tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace,
handle_close_brace): right in a rawpreformatted, use merge_text to
merge an opening or a closing brace to the preceding text, if any.
---
ChangeLog | 8 ++++----
tp/Texinfo/ParserNonXS.pm | 6 +-----
tp/Texinfo/XS/parsetexi/separator.c | 8 +-------
tp/t/results/converters_tests/raw_block_commands.pl | 20 ++++----------------
.../raw_block_commands_expand_tex.pl | 20 ++++----------------
tp/t/results/raw/braces_in_tex.pl | 10 ++--------
tp/t/results/raw/raw_in_example.pl | 5 +----
tp/t/results/raw/tex_not_closed.pl | 5 +----
8 files changed, 18 insertions(+), 64 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 658ffa4540..801b12729d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,9 @@
2023-03-11 Patrice Dumas <pertusus@free.fr>
- * tp/Texinfo/ParserNonXS.pm (_handle_open_brace),
- tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): right in a
- rawpreformatted, use merge_text to merge an opening brace to the
- preceding text, if any.
+ * tp/Texinfo/ParserNonXS.pm (_handle_open_brace, _handle_close_brace),
+ tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace,
+ handle_close_brace): right in a rawpreformatted, use merge_text to
+ merge an opening or a closing brace to the preceding text, if any.
2023-03-11 Patrice Dumas <pertusus@free.fr>
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 4c1394f57b..f50c032280 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -5980,11 +5980,7 @@ sub _handle_close_brace($$$)
# lone braces accepted right in a rawpreformatted
} elsif ($current->{'type'}
and $current->{'type'} eq 'rawpreformatted') {
- # empty line can happen in expanded rawpreformatted.
- _abort_empty_line($self, $current);
- push @{$current->{'contents'}}, {'text' => '}',
- 'parent' => $current };
-
+ $current = _merge_text($self, $current, '}');
} else {
$self->_line_error(sprintf(__("misplaced }")), $source_info);
}
diff --git a/tp/Texinfo/XS/parsetexi/separator.c
b/tp/Texinfo/XS/parsetexi/separator.c
index 6f5d4bc7ee..c11463c1aa 100644
--- a/tp/Texinfo/XS/parsetexi/separator.c
+++ b/tp/Texinfo/XS/parsetexi/separator.c
@@ -259,7 +259,6 @@ handle_close_brace (ELEMENT *current, char **line_inout)
else
abort_empty_line (¤t, NULL);
current = current->parent;
- goto funexit;
}
else if (command_flags(current->parent) & CF_brace)
{
@@ -535,16 +534,11 @@ handle_close_brace (ELEMENT *current, char **line_inout)
else if (current->type == ET_rawpreformatted)
{
/* lone right braces are accepted in a rawpreformatted */
- ELEMENT *e = new_element (ET_NONE);
- abort_empty_line (¤t, NULL);
- text_append_n (&e->text, "}", 1);
- add_to_element_contents (current, e);
- goto funexit;
+ current = merge_text (current, "}", 0);
}
else
{
line_error ("misplaced }");
- goto funexit;
}
funexit:
diff --git a/tp/t/results/converters_tests/raw_block_commands.pl
b/tp/t/results/converters_tests/raw_block_commands.pl
index b37ee43f52..510962e573 100644
--- a/tp/t/results/converters_tests/raw_block_commands.pl
+++ b/tp/t/results/converters_tests/raw_block_commands.pl
@@ -31,10 +31,7 @@ $result_trees{'raw_block_commands'} = {
{
'contents' => [
{
- 'text' => '<blink>html</blink> ``'
- },
- {
- 'text' => '}
+ 'text' => '<blink>html</blink> ``}
'
}
],
@@ -101,10 +98,7 @@ $result_trees{'raw_block_commands'} = {
{
'contents' => [
{
- 'text' => '<para>xml</para> ``'
- },
- {
- 'text' => '}
+ 'text' => '<para>xml</para> ``}
'
}
],
@@ -171,10 +165,7 @@ $result_trees{'raw_block_commands'} = {
{
'contents' => [
{
- 'text' => '<emphasis>docbook</emphasis> ``'
- },
- {
- 'text' => '}
+ 'text' => '<emphasis>docbook</emphasis> ``}
'
}
],
@@ -376,10 +367,7 @@ $result_trees{'raw_block_commands'} = {
}
},
{
- 'text' => '}{b'
- },
- {
- 'text' => '}$ ``
+ 'text' => '}{b}$ ``
'
}
],
diff --git a/tp/t/results/converters_tests/raw_block_commands_expand_tex.pl
b/tp/t/results/converters_tests/raw_block_commands_expand_tex.pl
index 4f8e97f4fc..c75fb73136 100644
--- a/tp/t/results/converters_tests/raw_block_commands_expand_tex.pl
+++ b/tp/t/results/converters_tests/raw_block_commands_expand_tex.pl
@@ -31,10 +31,7 @@ $result_trees{'raw_block_commands_expand_tex'} = {
{
'contents' => [
{
- 'text' => '<blink>html</blink> ``'
- },
- {
- 'text' => '}
+ 'text' => '<blink>html</blink> ``}
'
}
],
@@ -101,10 +98,7 @@ $result_trees{'raw_block_commands_expand_tex'} = {
{
'contents' => [
{
- 'text' => '<para>xml</para> ``'
- },
- {
- 'text' => '}
+ 'text' => '<para>xml</para> ``}
'
}
],
@@ -171,10 +165,7 @@ $result_trees{'raw_block_commands_expand_tex'} = {
{
'contents' => [
{
- 'text' => '<emphasis>docbook</emphasis> ``'
- },
- {
- 'text' => '}
+ 'text' => '<emphasis>docbook</emphasis> ``}
'
}
],
@@ -376,10 +367,7 @@ $result_trees{'raw_block_commands_expand_tex'} = {
}
},
{
- 'text' => '}{b'
- },
- {
- 'text' => '}$ ``
+ 'text' => '}{b}$ ``
'
}
],
diff --git a/tp/t/results/raw/braces_in_tex.pl
b/tp/t/results/raw/braces_in_tex.pl
index 3fba9cb468..1728ee8250 100644
--- a/tp/t/results/raw/braces_in_tex.pl
+++ b/tp/t/results/raw/braces_in_tex.pl
@@ -35,10 +35,7 @@ $result_trees{'braces_in_tex'} = {
'
},
{
- 'text' => '\\chi^2 = \\sum_{i=1'
- },
- {
- 'text' => '}^N
+ 'text' => '\\chi^2 = \\sum_{i=1}^N
'
},
{
@@ -142,10 +139,7 @@ $result_trees{'braces_in_tex'} = {
'
},
{
- 'text' => '\\chi^2 = \\sum_{i=1'
- },
- {
- 'text' => '}^N
+ 'text' => '\\chi^2 = \\sum_{i=1}^N
'
},
{
diff --git a/tp/t/results/raw/raw_in_example.pl
b/tp/t/results/raw/raw_in_example.pl
index cbbdd0b8c1..844cd2dcb7 100644
--- a/tp/t/results/raw/raw_in_example.pl
+++ b/tp/t/results/raw/raw_in_example.pl
@@ -258,10 +258,7 @@ $result_trees{'raw_in_example'} = {
'
},
{
- 'text' => '\\chi^2 = \\sum_{i=1'
- },
- {
- 'text' => '}^N
+ 'text' => '\\chi^2 = \\sum_{i=1}^N
'
},
{
diff --git a/tp/t/results/raw/tex_not_closed.pl
b/tp/t/results/raw/tex_not_closed.pl
index 9e07367ea2..73e131217c 100644
--- a/tp/t/results/raw/tex_not_closed.pl
+++ b/tp/t/results/raw/tex_not_closed.pl
@@ -31,10 +31,7 @@ $result_trees{'tex_not_closed'} = {
'type' => 'empty_line'
},
{
- 'text' => 'This is some \\LaTeX{'
- },
- {
- 'text' => '}
+ 'text' => 'This is some \\LaTeX{}
'
}
],
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/ParserNonXS.pm (_handle_open_brace, _handle_close_brace), tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace, handle_close_brace): right in a rawpreformatted, use merge_text to merge an opening or a closing brace to the preceding text, if any.,
Patrice Dumas <=
- Prev by Date:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_handle_open_brace), tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): right in a rawpreformatted, use merge_text to merge an opening brace to the preceding text, if any.
- Next by Date:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_close_current, _handle_close_brace), tp/Texinfo/XS/parsetexi/close.c (close_current), tp/Texinfo/XS/parsetexi/separator.c (handle_close_brace): separate code handling bracketed_arg and balanced_braces. No functional change.
- Previous by thread:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_handle_open_brace), tp/Texinfo/XS/parsetexi/separator.c (handle_open_brace): right in a rawpreformatted, use merge_text to merge an opening brace to the preceding text, if any.
- Next by thread:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_close_current, _handle_close_brace), tp/Texinfo/XS/parsetexi/close.c (close_current), tp/Texinfo/XS/parsetexi/separator.c (handle_close_brace): separate code handling bracketed_arg and balanced_braces. No functional change.
- Index(es):