[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Remove empty_spaces_after_command. Remove empty_s
From: |
Patrice Dumas |
Subject: |
branch master updated: Remove empty_spaces_after_command. Remove empty_spaces_before_argument from converters |
Date: |
Sat, 10 Sep 2022 17:06:12 -0400 |
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 2dca9882a5 Remove empty_spaces_after_command. Remove
empty_spaces_before_argument from converters
2dca9882a5 is described below
commit 2dca9882a52549e52df794cd03c0bbed71f87446
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Sep 10 23:06:00 2022 +0200
Remove empty_spaces_after_command. Remove empty_spaces_before_argument
from converters
* tp/Texinfo/ParserNonXS.pm (_merge_text, _abort_empty_line),
tp/Texinfo/XS/misc.c (xs_abort_empty_line, xs_merge_text),
tp/Texinfo/XS/parsetexi/parser.c (merge_text, abort_empty_line),
tp/Texinfo/XS/parsetexi/def.c,
tp/Texinfo/XS/parsetexi/element_types.txt,
tp/Texinfo/Transformations.pm (_new_node),
tp/Texinfo/Common.pm (trim_spaces_comment_from_content)
(move_index_entries_after_items),
tp/Texinfo/Convert/DocBook.pm, tp/Texinfo/Convert/HTML.pm,
tp/Texinfo/Convert/LaTeX.pm,
tp/Texinfo/Convert/NodeNameNormalization.pm,
tp/Texinfo/Convert/Plaintext.pm, tp/Texinfo/Convert/TexinfoXML.pm,
tp/Texinfo/Convert/Text.pm, tp/Texinfo/Convert/TextContent.pm:
the container empty_spaces_after_command does not appear in the
tree anymore, remove it and remove the now unreachable code
that set it up. Remove empty_spaces_before_argument from
converters as it is internal to parsers.
* tp/Texinfo/Convert/DocBook.pm (_convert): do not test for
empty_line_after_command in a place where it can not happen.
* tp/Texinfo/XS/misc.c b/tp/Texinfo/XS/misc.c (xs_abort_empty_line):
use correct extra spaces_associated_command key.
---
ChangeLog | 29 +++++++++++++++++++++
tp/Texinfo/Common.pm | 28 +++++---------------
tp/Texinfo/Convert/DocBook.pm | 6 -----
tp/Texinfo/Convert/HTML.pm | 4 +--
tp/Texinfo/Convert/LaTeX.pm | 3 +--
tp/Texinfo/Convert/NodeNameNormalization.pm | 4 +--
tp/Texinfo/Convert/Plaintext.pm | 4 +--
tp/Texinfo/Convert/TexinfoXML.pm | 12 ++-------
tp/Texinfo/Convert/Text.pm | 4 +--
tp/Texinfo/Convert/TextContent.pm | 1 -
tp/Texinfo/ParserNonXS.pm | 24 ++++++-----------
tp/Texinfo/Transformations.pm | 6 ++---
tp/Texinfo/XS/misc.c | 40 +++++++++++------------------
tp/Texinfo/XS/parsetexi/def.c | 4 ---
tp/Texinfo/XS/parsetexi/element_types.c | 3 ---
tp/Texinfo/XS/parsetexi/element_types.h | 3 ---
tp/Texinfo/XS/parsetexi/element_types.txt | 3 ---
tp/Texinfo/XS/parsetexi/parser.c | 28 ++++++++------------
18 files changed, 82 insertions(+), 124 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7fa77a2fa2..4b735abd90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2022-09-10 Patrice Dumas <pertusus@free.fr>
+
+ Remove empty_spaces_after_command. Remove empty_spaces_before_argument
+ from converters
+
+ * tp/Texinfo/ParserNonXS.pm (_merge_text, _abort_empty_line),
+ tp/Texinfo/XS/misc.c (xs_abort_empty_line, xs_merge_text),
+ tp/Texinfo/XS/parsetexi/parser.c (merge_text, abort_empty_line),
+ tp/Texinfo/XS/parsetexi/def.c,
+ tp/Texinfo/XS/parsetexi/element_types.txt,
+ tp/Texinfo/Transformations.pm (_new_node),
+ tp/Texinfo/Common.pm (trim_spaces_comment_from_content)
+ (move_index_entries_after_items),
+ tp/Texinfo/Convert/DocBook.pm, tp/Texinfo/Convert/HTML.pm,
+ tp/Texinfo/Convert/LaTeX.pm,
+ tp/Texinfo/Convert/NodeNameNormalization.pm,
+ tp/Texinfo/Convert/Plaintext.pm, tp/Texinfo/Convert/TexinfoXML.pm,
+ tp/Texinfo/Convert/Text.pm, tp/Texinfo/Convert/TextContent.pm:
+ the container empty_spaces_after_command does not appear in the
+ tree anymore, remove it and remove the now unreachable code
+ that set it up. Remove empty_spaces_before_argument from
+ converters as it is internal to parsers.
+
+ * tp/Texinfo/Convert/DocBook.pm (_convert): do not test for
+ empty_line_after_command in a place where it can not happen.
+
+ * tp/Texinfo/XS/misc.c b/tp/Texinfo/XS/misc.c (xs_abort_empty_line):
+ use correct extra spaces_associated_command key.
+
2022-09-10 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/ParserNonXS.pm (_end_line),
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index c65cdfa324..49f8f8f1ef 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -1788,8 +1788,6 @@ sub trim_spaces_comment_from_content($)
shift @$contents
if ($contents->[0] and $contents->[0]->{'type'}
and ($contents->[0]->{'type'} eq 'empty_line_after_command'
- or $contents->[0]->{'type'} eq 'empty_spaces_after_command'
- or $contents->[0]->{'type'} eq 'empty_spaces_before_argument'
or $contents->[0]->{'type'} eq 'empty_spaces_after_close_brace'));
while (@$contents
@@ -1797,8 +1795,7 @@ sub trim_spaces_comment_from_content($)
and ($contents->[-1]->{'cmdname'} eq 'c'
or $contents->[-1]->{'cmdname'} eq 'comment'))
or ($contents->[-1]->{'type'}
- and ($contents->[-1]->{'type'} eq 'spaces_at_end'
- or $contents->[-1]->{'type'} eq
'space_at_end_block_command')))) {
+ and $contents->[-1]->{'type'} eq 'spaces_at_end'))) {
pop @$contents;
}
}
@@ -2591,24 +2588,13 @@ sub move_index_entries_after_items($)
foreach my $entry(@gathered_index_entries) {
$entry->{'parent'} = $item_container;
}
- # TODO remove
- if ($item->{'extra'}
- and $item->{'extra'}->{'spaces_before_argument'}
- and $item->{'extra'}->{'spaces_before_argument'} !~ /\n$/) {
- $item->{'extra'}->{'spaces_before_argument'} .= "\n";
- # TODO: could we delete some cases down here?
- } elsif ($item_container->{'contents'}
+ if ($item_container->{'contents'}
and $item_container->{'contents'}->[0]
- and $item_container->{'contents'}->[0]->{'type'}) {
- if ($item_container->{'contents'}->[0]->{'type'} eq
'empty_line_after_command') {
- $item_container->{'contents'}->[0]->{'text'} .= "\n"
- if ($item_container->{'contents'}->[0]->{'text'} !~ /\n$/);
- unshift @gathered_index_entries, shift
@{$item_container->{'contents'}};
- } elsif ($item_container->{'contents'}->[0]->{'type'} eq
'empty_spaces_after_command') {
- unshift @gathered_index_entries, shift
@{$item_container->{'contents'}};
- $gathered_index_entries[0]->{'type'} =
'empty_line_after_command';
- $gathered_index_entries[0]->{'text'} .= "\n";
- }
+ and $item_container->{'contents'}->[0]->{'type'}
+ and $item_container->{'contents'}->[0]->{'type'} eq
'empty_line_after_command') {
+ $item_container->{'contents'}->[0]->{'text'} .= "\n"
+ if ($item_container->{'contents'}->[0]->{'text'} !~ /\n$/);
+ unshift @gathered_index_entries, shift
@{$item_container->{'contents'}};
}
unshift @{$item_container->{'contents'}}, @gathered_index_entries;
}
diff --git a/tp/Texinfo/Convert/DocBook.pm b/tp/Texinfo/Convert/DocBook.pm
index 99e529fbac..1522b5ce74 100644
--- a/tp/Texinfo/Convert/DocBook.pm
+++ b/tp/Texinfo/Convert/DocBook.pm
@@ -213,8 +213,6 @@ my %ignored_types;
foreach my $type (
'empty_line_after_command',
'empty_spaces_after_close_brace',
- 'empty_spaces_after_command',
- 'empty_spaces_before_argument',
'empty_spaces_before_paragraph',
'menu_entry_leading_text',
'menu_entry_separator',
@@ -1583,10 +1581,6 @@ sub _convert($$;$)
$main_command = $element->{'extra'}->{'def_command'};
}
foreach my $arg (@{$element->{'args'}->[0]->{'contents'}}) {
- next if $arg->{'type'}
- and ($arg->{'type'} eq 'empty_spaces_after_command'
- or $arg->{'type'} eq 'empty_line_after_command');
-
my $type = $arg->{'extra'}->{'def_role'};
next if !$type and $arg->{'type'} eq 'spaces';
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index a0daa3b7d7..f39ac341d1 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -5365,8 +5365,8 @@ sub default_type_open($$)
# Ignored commands
foreach my $type ('empty_line_after_command', 'preamble_before_beginning',
'preamble_before_setfilename',
- 'empty_spaces_after_command', 'spaces_at_end',
- 'empty_spaces_before_argument', 'empty_spaces_before_paragraph',
+ 'spaces_at_end',
+ 'empty_spaces_before_paragraph',
'empty_spaces_after_close_brace') {
$default_types_conversion{$type} = undef;
}
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 61477fd98b..e3f20ae91b 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -527,8 +527,7 @@ foreach my $environment_command
(@LaTeX_same_block_commands) {
my %ignorable_space_types;
foreach my $type ('empty_line_after_command',
- 'empty_spaces_after_command', 'spaces_at_end',
- 'empty_spaces_before_argument',
+ 'spaces_at_end',
'empty_spaces_after_close_brace') {
$ignorable_space_types{$type} = 1;
}
diff --git a/tp/Texinfo/Convert/NodeNameNormalization.pm
b/tp/Texinfo/Convert/NodeNameNormalization.pm
index 50a93f2bda..ad43ebd6f5 100644
--- a/tp/Texinfo/Convert/NodeNameNormalization.pm
+++ b/tp/Texinfo/Convert/NodeNameNormalization.pm
@@ -74,8 +74,8 @@ foreach my $ignored_brace_command ('anchor', 'footnote',
'shortcaption',
my %ignored_types;
foreach my $type ('empty_line_after_command', 'preamble_before_beginning',
- 'empty_spaces_after_command', 'spaces_at_end',
- 'empty_spaces_before_argument', 'empty_spaces_before_paragraph',
+ 'spaces_at_end',
+ 'empty_spaces_before_paragraph',
'space_at_end_menu_node',
'empty_spaces_after_close_brace') {
$ignored_types{$type} = 1;
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index ee088cb3b8..f14c4430b8 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -261,8 +261,8 @@ my %upper_case_commands = (
my %ignorable_space_types;
foreach my $type ('empty_line_after_command',
- 'empty_spaces_after_command', 'spaces_at_end',
- 'empty_spaces_before_argument', 'empty_spaces_before_paragraph',
+ 'spaces_at_end',
+ 'empty_spaces_before_paragraph',
'empty_spaces_after_close_brace') {
$ignorable_space_types{$type} = 1;
}
diff --git a/tp/Texinfo/Convert/TexinfoXML.pm b/tp/Texinfo/Convert/TexinfoXML.pm
index bc18feb522..f0258489b1 100644
--- a/tp/Texinfo/Convert/TexinfoXML.pm
+++ b/tp/Texinfo/Convert/TexinfoXML.pm
@@ -372,9 +372,6 @@ my %defcommand_name_type = (
my %ignored_types;
foreach my $type (
- # those are put as spaces in the corresponding @-command
- 'empty_spaces_after_command',
- 'empty_spaces_before_argument',
# @-commands replaced in the tree
'replaced',
) {
@@ -642,10 +639,8 @@ sub _collect_leading_trailing_spaces_arg($$)
and defined($arg->{'contents'}->[0]->{'type'})) {
#print STDERR "$arg->{'contents'}->[0]->{'type'}\n";
warn "Unknown leading space type $arg->{'contents'}->[0]->{'type'}\n"
- if ($arg->{'contents'}->[0]->{'type'} ne 'empty_spaces_after_command'
- and $arg->{'contents'}->[0]->{'type'} ne
'empty_spaces_before_argument'
- # FIXME should we really catch this too?
- and $arg->{'contents'}->[0]->{'type'} ne 'empty_line_after_command'
+ if (# FIXME should we really catch this too?
+ $arg->{'contents'}->[0]->{'type'} ne 'empty_line_after_command'
);
$result[0] = $arg->{'contents'}->[0]->{'text'};
return @result if (scalar(@{$arg->{'contents'}}) == 1);
@@ -1578,9 +1573,6 @@ sub _convert($$;$)
$alias = 0;
}
foreach my $arg (@{$element->{'args'}->[0]->{'contents'}}) {
- next if $arg->{'type'}
- and ($arg->{'type'} eq 'empty_spaces_after_command'
- or $arg->{'type'} eq 'empty_line_after_command');
my $type = $arg->{'extra'}->{'def_role'};
next if !$type and $arg->{'type'} eq 'spaces';
my $content = $self->_convert($arg);
diff --git a/tp/Texinfo/Convert/Text.pm b/tp/Texinfo/Convert/Text.pm
index 1b1c54755e..511024fb41 100644
--- a/tp/Texinfo/Convert/Text.pm
+++ b/tp/Texinfo/Convert/Text.pm
@@ -153,8 +153,8 @@ foreach my $command ('verbatiminclude', 'sp') {
my %ignored_types;
foreach my $type ('empty_line_after_command', 'preamble_before_beginning',
- 'empty_spaces_after_command', 'spaces_at_end',
- 'empty_spaces_before_argument', 'empty_spaces_before_paragraph',
+ 'spaces_at_end',
+ 'empty_spaces_before_paragraph',
'empty_spaces_after_close_brace') {
$ignored_types{$type} = 1;
}
diff --git a/tp/Texinfo/Convert/TextContent.pm
b/tp/Texinfo/Convert/TextContent.pm
index 8009d74a13..7961326eba 100644
--- a/tp/Texinfo/Convert/TextContent.pm
+++ b/tp/Texinfo/Convert/TextContent.pm
@@ -46,7 +46,6 @@ foreach my $ignored_command (
my %ignored_types;
foreach my $type ('empty_line_after_command', 'preamble_before_beginning',
- 'empty_spaces_after_command',
'empty_spaces_before_paragraph',
'empty_spaces_after_close_brace') {
$ignored_types{$type} = 1;
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 38103c4beb..c85e12ae8c 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -1941,7 +1941,6 @@ sub _merge_text {
and $current->{'contents'}->[-1]->{'type'}
and ($current->{'contents'}->[-1]->{'type'} eq 'empty_line_after_command'
or $current->{'contents'}->[-1]->{'type'} eq
'internal_empty_line_after_command'
- or $current->{'contents'}->[-1]->{'type'} eq
'empty_spaces_after_command'
or $current->{'contents'}->[-1]->{'type'} eq
'empty_spaces_before_argument'
or $current->{'contents'}->[-1]->{'type'} eq
'empty_spaces_after_close_brace')) {
$no_merge_with_following_text = 1;
@@ -2350,16 +2349,12 @@ sub _abort_empty_line {
}
} elsif ($spaces_element->{'type'} eq 'internal_empty_line_after_command'
or $spaces_element->{'type'} eq 'empty_spaces_before_argument') {
- if ($owning_element) {
- # Remove element from main tree. It will still be referenced in
- # the 'extra' hash as 'spaces_before_argument'.
- pop @{$current->{'contents'}};
+ # Remove element from main tree. It will still be referenced in
+ # the 'extra' hash as 'spaces_before_argument'.
+ pop @{$current->{'contents'}};
- $owning_element->{'extra'}->{'spaces_before_argument'}
- = $spaces_element->{'text'};
- } else {
- $spaces_element->{'type'} = 'empty_spaces_after_command';
- }
+ $owning_element->{'extra'}->{'spaces_before_argument'}
+ = $spaces_element->{'text'};
}
return 1;
@@ -6995,12 +6990,9 @@ An empty line (possibly containing whitespace characters
only).
=item empty_line_after_command
-=item empty_spaces_after_command
-
-The text is spaces for I<empty_spaces_after_command>
-or spaces followed by a newline for
-I<empty_line_after_command>, appearing after an @-command that
-takes an argument on the line or a block @-command.
+spaces appearing after an @-command without braces that does not
+take takes argument on the line, but which is followed by ignorable
+spaces, such as C<@item> in C<@itemize> of C<@multitable>, or C<@noindent>.
=item empty_spaces_after_close_brace
diff --git a/tp/Texinfo/Transformations.pm b/tp/Texinfo/Transformations.pm
index 29e322fe58..a65078e221 100644
--- a/tp/Texinfo/Transformations.pm
+++ b/tp/Texinfo/Transformations.pm
@@ -241,13 +241,11 @@ sub _new_node($$$$)
while (!defined($node)
or ($labels
and $labels->{$parsed_node->{'normalized'}})) {
- $node = {'cmdname' => 'node', 'args' => [{}]};
+ $node = {'cmdname' => 'node', 'args' => [{}],
+ 'extra' => {'spaces_before_argument' => ' '}};
my $node_arg = $node->{'args'}->[0];
$node_arg->{'parent'} = $node;
@{$node_arg->{'contents'}} = (
- {'extra' => {'command' => $node},
- 'text' => ' ',
- 'type' => 'empty_spaces_after_command'},
@{$node_tree->{'contents'}});
if ($appended_number) {
splice (@{$node_arg->{'contents'}}, -1, 0,
diff --git a/tp/Texinfo/XS/misc.c b/tp/Texinfo/XS/misc.c
index 3fb18977b7..73e074aa01 100644
--- a/tp/Texinfo/XS/misc.c
+++ b/tp/Texinfo/XS/misc.c
@@ -114,8 +114,8 @@ xs_abort_empty_line (HV *self, HV *current, SV
*additional_spaces_in)
if (svp)
{
test_extra = (HV *) SvRV (*svp);
- svp = hv_fetch (test_extra, "command",
- strlen ("command"), 0);
+ svp = hv_fetch (test_extra, "spaces_associated_command",
+ strlen ("spaces_associated_command"), 0);
if (svp)
{
owning_elt = (HV *) SvRV (*svp);
@@ -200,31 +200,22 @@ delete_type:
STRLEN len;
char *ptr;
- if (owning_elt)
- {
- /* Remove spaces_elt */
- av_pop (contents_array);
+ /* Remove spaces_elt */
+ av_pop (contents_array);
- ptr = SvPV(existing_text_sv, len);
- /* Replace element reference with a simple string. */
- if (!command_extra)
- {
- command_extra = newHV ();
- hv_store (owning_elt, "extra", strlen ("extra"),
- newRV_inc((SV *)command_extra), 0);
- }
- hv_store (command_extra,
- "spaces_before_argument",
- strlen ("spaces_before_argument"),
- newSVpv(ptr, len),
- 0);
- }
- else
+ ptr = SvPV(existing_text_sv, len);
+ /* Replace element reference with a simple string. */
+ if (!command_extra)
{
- hv_store (spaces_elt, "type", strlen ("type"),
- newSVpv ("empty_spaces_after_command", 0), 0);
-
+ command_extra = newHV ();
+ hv_store (owning_elt, "extra", strlen ("extra"),
+ newRV_inc((SV *)command_extra), 0);
}
+ hv_store (command_extra,
+ "spaces_before_argument",
+ strlen ("spaces_before_argument"),
+ newSVpv(ptr, len),
+ 0);
}
return 1;
}
@@ -295,7 +286,6 @@ xs_merge_text (HV *self, HV *current, SV *text_in)
if (type
&& (!strcmp (type, "empty_line_after_command")
|| !strcmp (type, "internal_empty_line_after_command")
- || !strcmp (type, "empty_spaces_after_command")
|| !strcmp (type, "empty_spaces_before_argument")
|| !strcmp (type, "empty_spaces_after_close_brace")))
{
diff --git a/tp/Texinfo/XS/parsetexi/def.c b/tp/Texinfo/XS/parsetexi/def.c
index e205f30bf2..bea4544d14 100644
--- a/tp/Texinfo/XS/parsetexi/def.c
+++ b/tp/Texinfo/XS/parsetexi/def.c
@@ -75,7 +75,6 @@ next_bracketed_or_word (ELEMENT *current, int *i)
if (current->contents.list[*i]->type != ET_spaces
&& current->contents.list[*i]->type != ET_spaces_inserted
&& current->contents.list[*i]->type != ET_spaces_at_end
- && current->contents.list[*i]->type != ET_empty_spaces_after_command
&& current->contents.list[*i]->type != ET_delimiter)
break;
(*i)++;
@@ -98,7 +97,6 @@ next_bracketed_or_word_agg (ELEMENT *current, int *i)
if (e->type == ET_spaces
|| e->type == ET_spaces_inserted
|| e->type == ET_spaces_at_end
- || e->type == ET_empty_spaces_after_command
|| e->type == ET_delimiter)
{
if (num > 0)
@@ -180,8 +178,6 @@ split_delimiters (ELEMENT *current, int starting_idx)
if (e->type != ET_NONE
|| e->text.end == 0)
continue;
- if (e->type == ET_empty_spaces_after_command)
- continue;
p = e->text.text;
while (1)
diff --git a/tp/Texinfo/XS/parsetexi/element_types.c
b/tp/Texinfo/XS/parsetexi/element_types.c
index a581cd481f..6f3eb4647d 100644
--- a/tp/Texinfo/XS/parsetexi/element_types.c
+++ b/tp/Texinfo/XS/parsetexi/element_types.c
@@ -9,11 +9,8 @@ char *element_type_names[] = {
"empty_line",
"raw",
"empty_line_after_command",
-"empty_spaces_after_command",
"spaces_at_end",
"spaces_before_brace_in_index",
-"empty_space_at_end_def_bracketed",
-"space_at_end_block_command",
"empty_spaces_before_argument",
"empty_spaces_after_close_brace",
"empty_spaces_before_paragraph",
diff --git a/tp/Texinfo/XS/parsetexi/element_types.h
b/tp/Texinfo/XS/parsetexi/element_types.h
index 12a4bde838..d40f1a1bca 100644
--- a/tp/Texinfo/XS/parsetexi/element_types.h
+++ b/tp/Texinfo/XS/parsetexi/element_types.h
@@ -12,11 +12,8 @@ ET_definfoenclose_command,
ET_empty_line,
ET_raw,
ET_empty_line_after_command,
-ET_empty_spaces_after_command,
ET_spaces_at_end,
ET_spaces_before_brace_in_index,
-ET_empty_space_at_end_def_bracketed,
-ET_space_at_end_block_command,
ET_empty_spaces_before_argument,
ET_empty_spaces_after_close_brace,
ET_empty_spaces_before_paragraph,
diff --git a/tp/Texinfo/XS/parsetexi/element_types.txt
b/tp/Texinfo/XS/parsetexi/element_types.txt
index c7d4f524bc..39423fb034 100644
--- a/tp/Texinfo/XS/parsetexi/element_types.txt
+++ b/tp/Texinfo/XS/parsetexi/element_types.txt
@@ -27,11 +27,8 @@ definfoenclose_command
empty_line
raw
empty_line_after_command
-empty_spaces_after_command
spaces_at_end
spaces_before_brace_in_index
-empty_space_at_end_def_bracketed
-space_at_end_block_command
empty_spaces_before_argument
empty_spaces_after_close_brace
empty_spaces_before_paragraph
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 4bb0cb4bd2..788a4659db 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -544,7 +544,6 @@ merge_text (ELEMENT *current, char *text)
if (last_child
&& (last_child->type == ET_empty_line_after_command
|| last_child->type == ET_internal_empty_line_after_command
- || last_child->type == ET_empty_spaces_after_command
|| last_child->type == ET_empty_spaces_before_argument
|| last_child->type == ET_empty_spaces_after_close_brace))
{
@@ -649,19 +648,12 @@ abort_empty_line (ELEMENT **current_inout, char
*additional_spaces)
else if (last_child->type == ET_internal_empty_line_after_command
|| last_child->type == ET_empty_spaces_before_argument)
{
- if (owning_element)
- {
- /* Remove element from main tree. It will still be referenced in
- the 'extra' hash as 'spaces_before_argument'. */
- ELEMENT *e = pop_element_from_contents (current);
- add_extra_string_dup (owning_element, "spaces_before_argument",
- e->text.text);
- destroy_element (e);
- }
- else
- {
- last_child->type = ET_empty_spaces_after_command;
- }
+ /* Remove element from main tree. It will still be referenced in
+ the 'extra' hash as 'spaces_before_argument'. */
+ ELEMENT *e = pop_element_from_contents (current);
+ add_extra_string_dup (owning_element, "spaces_before_argument",
+ e->text.text);
+ destroy_element (e);
}
}
else
@@ -793,10 +785,10 @@ isolate_last_space (ELEMENT *current)
/* Add an "ET_empty_line_after_command" element containing the whitespace at
- the beginning of the rest of the line. This element can be later changed
to
- a "ET_empty_spaces_after_command" element in 'abort_empty_line' if more
- text follows on the line. Used after line commands or commands starting
- a block. */
+ the beginning of the rest of the line after skipspaces commands,
+ if COMMAND is 0. Otherwise add an "ET_internal_empty_line_after_command",
+ container, after line commands or commands starting
+ a block, that will end up in COMMAND extra spaces value. */
void
start_empty_line_after_command (ELEMENT *current, char **line_inout,
ELEMENT *command)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Remove empty_spaces_after_command. Remove empty_spaces_before_argument from converters,
Patrice Dumas <=