[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Add spaces information for @-commands with braces
From: |
Patrice Dumas |
Subject: |
branch master updated: Add spaces information for @-commands with braces followed by spaces |
Date: |
Sat, 27 Aug 2022 02:03:35 -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 29777b8983 Add spaces information for @-commands with braces followed
by spaces
29777b8983 is described below
commit 29777b89833372036fab96c9a0ced21a517f1c6b
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Aug 27 08:03:24 2022 +0200
Add spaces information for @-commands with braces followed by spaces
* tp/Texinfo/ParserNonXS.pm (_parse_texi),
tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line): add spaces in
extra
for @-commands with braces followed by spaces.
* tp/Texinfo/ParserNonXS.pm (_parse_texi): handle unknown @-commands
earlier.
---
ChangeLog | 11 +
tp/Texinfo/ParserNonXS.pm | 238 +++++++++++----------
tp/Texinfo/XS/parsetexi/parser.c | 18 ++
tp/t/converters_tests.t | 2 +-
tp/t/results/converters_tests/form_feeds.pl | 39 +++-
tp/t/results/coverage/invalid_U.pl | 5 +-
.../coverage/spaces_after_braced_command.pl | 12 +-
.../spaces_no_brace_after_braced_command.pl | 5 +-
tp/t/results/coverage_braces/no_brace.pl | 11 +-
.../coverage_braces/no_brace_space_end_line.pl | 19 +-
.../formatting_macro_expand/formatting.texi | 24 ++-
11 files changed, 248 insertions(+), 136 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 07626f33df..d0f370ab6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-08-27 Patrice Dumas <pertusus@free.fr>
+
+ Add spaces information for @-commands with braces followed by spaces
+
+ * tp/Texinfo/ParserNonXS.pm (_parse_texi),
+ tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line): add
spaces in extra
+ for @-commands with braces followed by spaces.
+
+ * tp/Texinfo/ParserNonXS.pm (_parse_texi): handle unknown @-commands
+ earlier.
+
2022-08-27 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/Text.pm (_convert): handle displaymath as a block
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index b0ec3714b2..06132c8728 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -1829,7 +1829,7 @@ sub _close_current($$$;$$)
and $current->{'contents'}->[0]->{'type'}
eq 'empty_spaces_before_argument') {
# remove spaces element from tree and update extra values
- _abort_empty_line($self, $current)
+ _abort_empty_line($self, $current);
}
} elsif ($current->{'type'} eq 'menu_comment'
@@ -2306,7 +2306,6 @@ sub _abort_empty_line {
# remove empty 'empty*before'.
if ($spaces_element->{'text'} eq '') {
pop @{$current->{'contents'}};
-
} elsif ($spaces_element->{'type'} eq 'empty_line') {
# exactly the same condition as to begin a paragraph
if ((!$current->{'type'} or $type_with_paragraph{$current->{'type'}})
@@ -2490,6 +2489,9 @@ sub _parse_def($$$)
if ($contents[0] and $contents[0]->{'type'}
and ($contents[0]->{'type'} eq 'empty_spaces_after_command'
or $contents[0]->{'type'} eq 'empty_line_after_command')) {
+ # FIXME this only happens if there is no argument at all, otherwise the
+ # types should already be put in extra by _abort_empty_line. Would
+ # probably be better to call _abort_empty_line before.
$empty_spaces_after_command = shift @contents;
}
@@ -3752,6 +3754,7 @@ sub _is_index_element {
sub _parse_texi_regex {
my ($line) = @_;
+ # REMACRO
my ($at_command, $open_brace, $asterisk, $single_letter_command,
$separator_match, $misc_text)
= ($line =~ /^\@([[:alnum:]][[:alnum:]-]*)
@@ -4076,105 +4079,126 @@ sub _parse_texi($$$)
}
}
- # handle user defined macros before anything else since
- # their expansion may lead to changes in the line
- # REMACRO
my $at_command_length;
+ my @line_parsing = _parse_texi_regex($line);
my ($at_command, $open_brace, $asterisk, $single_letter_command,
- $separator_match, $misc_text) = _parse_texi_regex($line);
+ $separator_match, $misc_text) = @line_parsing;
+ print STDERR "PARSED: ".join(', ', map {!defined($_) ? 'UNDEF' : $_}
@line_parsing)."\n"
+ if ($self->{'DEBUG'});
if ($at_command) {
$at_command_length = length($at_command) + 1;
- }
- if ($at_command
- and ($self->{'macros'}->{$at_command}
- or (exists $self->{'aliases'}->{$at_command}
- and
$self->{'macros'}->{$self->{'aliases'}->{$at_command}}))) {
- substr($line, 0, $at_command_length) = '';
- my $command = $at_command;
- my $alias_command;
- if (exists($self->{'aliases'}->{$command})) {
- $alias_command = $command;
- $command = $self->{'aliases'}->{$command};
- }
- my $expanded_macro = $self->{'macros'}->{$command}->{'element'};
- my $args_number = scalar(@{$expanded_macro->{'args'}}) -1;
- my $arguments = [];
- if ($line =~ s/^\s*{\s*//) { # macro with args
- ($arguments, $line, $source_info)
- = _expand_macro_arguments($self, $expanded_macro, $line,
$source_info);
- } elsif (($args_number >= 2) or ($args_number <1)) {
- # as agreed on the bug-texinfo mailing list, no warn when zero
- # arg and not called with {}.
- $self->_line_warn(sprintf(__(
- "\@%s defined with zero or more than one argument should be invoked with
{}"),
- $command), $source_info)
- if ($args_number >= 2);
- } else {
- if ($line !~ /\n/) {
- ($line, $source_info) = _new_line($self, $source_info);
- $line = '' if (!defined($line));
- }
- $line =~ s/^\s*// if ($line =~ /\S/);
- my $has_end_of_line = chomp $line;
- $arguments = [$line];
- $line = "\n" if ($has_end_of_line);
- }
- my $expanded = _expand_macro_body($self,
- $self->{'macros'}->{$command},
- $arguments, $source_info);
- print STDERR "MACROBODY: $expanded".'||||||'."\n"
- if ($self->{'DEBUG'});
- # empty result. It is ignored here.
- if ($expanded eq '') {
- next;
- }
- if ($self->{'MAX_MACRO_CALL_NESTING'}
- and scalar(@{$self->{'macro_stack'}}) >
$self->{'MAX_MACRO_CALL_NESTING'}) {
- $self->_line_warn(sprintf(__(
-"macro call nested too deeply (set MAX_NESTED_MACROS to override; current
value %d)"),
- $self->{'MAX_MACRO_CALL_NESTING'}),
$source_info);
+ # handle unknown @-command
+ if (!$all_commands{$at_command}
+ and !$self->{'macros'}->{$at_command}
+ and !$self->{'definfoenclose'}->{$at_command}
+ and !$self->{'aliases'}->{$at_command}
+ and !$self->{'command_index'}->{$at_command}
+ # @txiinternalvalue is invalid unless accept_internalvalue is set
+ and !($at_command eq 'txiinternalvalue'
+ and $self->{'accept_internalvalue'})) {
+ $self->_line_error(sprintf(__("unknown command `%s'"),
+ $at_command), $source_info);
+ substr($line, 0, $at_command_length) = '';
+ _abort_empty_line($self, $current);
+ my $paragraph = _begin_paragraph($self, $current, $source_info);
+ $current = $paragraph if ($paragraph);
next;
}
- if ($expanded_macro->{'cmdname'} eq 'macro') {
- my $found = 0;
- foreach my $macro (@{$self->{'macro_stack'}}) {
- if ($macro->{'args'}->[0]->{'text'} eq $command) {
- $self->_line_error(sprintf(__(
- "recursive call of macro %s is not allowed; use \@rmacro if
needed"),
- $command), $source_info);
- $found = 1;
- last;
- }
+
+ # handle user defined macros before anything else since
+ # their expansion may lead to changes in the line
+ if ($self->{'macros'}->{$at_command}
+ or (exists $self->{'aliases'}->{$at_command}
+ and
$self->{'macros'}->{$self->{'aliases'}->{$at_command}})) {
+ substr($line, 0, $at_command_length) = '';
+ my $command = $at_command;
+ my $alias_command;
+ if (exists($self->{'aliases'}->{$command})) {
+ $alias_command = $command;
+ $command = $self->{'aliases'}->{$command};
}
- next if ($found);
- }
- my $expanded_lines = _text_to_lines($expanded);
- next if (!@$expanded_lines);
- chomp ($expanded_lines->[-1]);
- pop @$expanded_lines if ($expanded_lines->[-1] eq '');
- print STDERR "MACRO EXPANSION LINES: ".join('|', @$expanded_lines)
- ."|\nEND LINES MACRO EXPANSION\n" if
($self->{'DEBUG'});
- next if (!@$expanded_lines);
- unshift @{$self->{'macro_stack'}}, $expanded_macro;
- print STDERR "UNSHIFT MACRO_STACK:
$expanded_macro->{'args'}->[0]->{'text'}\n"
- if ($self->{'DEBUG'});
- my $new_lines = _complete_line_nr($expanded_lines,
- $source_info->{'line_nr'},
$source_info->{'file_name'},
- $expanded_macro->{'args'}->[0]->{'text'}, 1);
- $source_info->{'end_macro'} = 1;
- # first put the line that was interrupted by the macro call
- # on the input pending text with information stack
- unshift @{$self->{'input'}->[0]->{'pending'}}, [$line, $source_info];
- # current line is the first from macro expansion
- my $new_text = shift @$new_lines;
- ($line, $source_info) = ($new_text->[0], $new_text->[1]);
- # then put the following macro expansion lines with information on the
- # pending text with information stack
- unshift @{$self->{'input'}->[0]->{'pending'}}, @$new_lines;
+ my $expanded_macro = $self->{'macros'}->{$command}->{'element'};
+ my $args_number = scalar(@{$expanded_macro->{'args'}}) -1;
+ my $arguments = [];
+ if ($line =~ s/^\s*{\s*//) { # macro with args
+ ($arguments, $line, $source_info)
+ = _expand_macro_arguments($self, $expanded_macro, $line,
$source_info);
+ } elsif (($args_number >= 2) or ($args_number <1)) {
+ # as agreed on the bug-texinfo mailing list, no warn when zero
+ # arg and not called with {}.
+ $self->_line_warn(sprintf(__(
+ "\@%s defined with zero or more than one argument should be invoked with
{}"),
+ $command), $source_info)
+ if ($args_number >= 2);
+ } else {
+ if ($line !~ /\n/) {
+ ($line, $source_info) = _new_line($self, $source_info);
+ $line = '' if (!defined($line));
+ }
+ $line =~ s/^\s*// if ($line =~ /\S/);
+ my $has_end_of_line = chomp $line;
+ $arguments = [$line];
+ $line = "\n" if ($has_end_of_line);
+ }
+ my $expanded = _expand_macro_body($self,
+ $self->{'macros'}->{$command},
+ $arguments, $source_info);
+ print STDERR "MACROBODY: $expanded".'||||||'."\n"
+ if ($self->{'DEBUG'});
+ # empty result. It is ignored here.
+ if ($expanded eq '') {
+ next;
+ }
+ if ($self->{'MAX_MACRO_CALL_NESTING'}
+ and scalar(@{$self->{'macro_stack'}}) >
$self->{'MAX_MACRO_CALL_NESTING'}) {
+ $self->_line_warn(sprintf(__(
+ "macro call nested too deeply (set MAX_NESTED_MACROS to override; current
value %d)"),
+ $self->{'MAX_MACRO_CALL_NESTING'}),
$source_info);
+ next;
+ }
+ if ($expanded_macro->{'cmdname'} eq 'macro') {
+ my $found = 0;
+ foreach my $macro (@{$self->{'macro_stack'}}) {
+ if ($macro->{'args'}->[0]->{'text'} eq $command) {
+ $self->_line_error(sprintf(__(
+ "recursive call of macro %s is not allowed; use \@rmacro if
needed"),
+ $command), $source_info);
+ $found = 1;
+ last;
+ }
+ }
+ next if ($found);
+ }
+ my $expanded_lines = _text_to_lines($expanded);
+ next if (!@$expanded_lines);
+ chomp ($expanded_lines->[-1]);
+ pop @$expanded_lines if ($expanded_lines->[-1] eq '');
+ print STDERR "MACRO EXPANSION LINES: ".join('|', @$expanded_lines)
+ ."|\nEND LINES MACRO EXPANSION\n" if
($self->{'DEBUG'});
+ next if (!@$expanded_lines);
+ unshift @{$self->{'macro_stack'}}, $expanded_macro;
+ print STDERR "UNSHIFT MACRO_STACK:
$expanded_macro->{'args'}->[0]->{'text'}\n"
+ if ($self->{'DEBUG'});
+ my $new_lines = _complete_line_nr($expanded_lines,
+ $source_info->{'line_nr'},
$source_info->{'file_name'},
+ $expanded_macro->{'args'}->[0]->{'text'}, 1);
+ $source_info->{'end_macro'} = 1;
+ # first put the line that was interrupted by the macro call
+ # on the input pending text with information stack
+ unshift @{$self->{'input'}->[0]->{'pending'}}, [$line, $source_info];
+ # current line is the first from macro expansion
+ my $new_text = shift @$new_lines;
+ ($line, $source_info) = ($new_text->[0], $new_text->[1]);
+ # then put the following macro expansion lines with information on
the
+ # pending text with information stack
+ unshift @{$self->{'input'}->[0]->{'pending'}}, @$new_lines;
+ next;
+ }
+ }
# Now handle all the cases that may lead to command closing
# or following character association with an @-command, especially
# accent command, that is handle @-command with braces that don't
@@ -4182,9 +4206,11 @@ sub _parse_texi($$$)
# The condition below is only caught right after command opening,
# otherwise we are in the 'args' and not right in the command container.
- } elsif ($current->{'cmdname'}
+ if ($current->{'cmdname'}
and defined($brace_commands{$current->{'cmdname'}})
and !$open_brace) {
+ print STDERR "BRACE command \@$current->{'cmdname'}, no brace\n"
+ if $self->{'DEBUG'};
# now accent commands
if ($accent_commands{$current->{'cmdname'}}) {
# we should only warn for empty accent command. However, it is
@@ -4254,7 +4280,10 @@ sub _parse_texi($$$)
} else {
# ignore space after a braced @-command like TeX does
if ($self->{'IGNORE_SPACE_AFTER_BRACED_COMMAND_NAME'}
- and $line =~ s/^\s+//) {
+ and $line =~ s/^(\s+)//) {
+ $current->{'extra'}->{'spaces'} = ''
+ if (!defined($current->{'extra'}->{'spaces'}));
+ $current->{'extra'}->{'spaces'} .= $1;
next;
}
$self->_line_error(sprintf(__("\@%s expected braces"),
@@ -4364,7 +4393,7 @@ sub _parse_texi($$$)
print STDERR "MENU NODE $separator\n" if ($self->{'DEBUG'});
$current = _enter_menu_entry_node($self, $current, $source_info);
}
- # REMACRO
+ # Any other @-command.
} elsif ($at_command or $single_letter_command) {
my $command;
if (!$at_command) {
@@ -4376,21 +4405,6 @@ sub _parse_texi($$$)
}
print STDERR "COMMAND $command\n" if ($self->{'DEBUG'});
- if (!$all_commands{$command}
- and !$self->{'macros'}->{$command}
- and !$self->{'definfoenclose'}->{$command}
- and !$self->{'aliases'}->{$command}
- and !$self->{'command_index'}->{$command}
- # @txiinternalvalue is invalid unless accept_internalvalue is set
- and !($command eq 'txiinternalvalue'
- and $self->{'accept_internalvalue'})) {
- $self->_line_error(sprintf(__("unknown command `%s'"),
- $command), $source_info);
- _abort_empty_line($self, $current);
- my $paragraph = _begin_paragraph($self, $current, $source_info);
- $current = $paragraph if ($paragraph);
- next;
- }
my $alias_command;
if (exists($self->{'aliases'}->{$command})) {
@@ -4620,10 +4634,9 @@ sub _parse_texi($$$)
$current = _merge_text($self, $current, $1);
}
if ($line ne ''
- and $current->{'contents'}->[-1]->{'type'} eq
- 'empty_line_after_command') {
+ and $current->{'contents'}->[-1]->{'type'} eq
'empty_line_after_command') {
$current->{'contents'}->[-1]->{'type'}
- = 'empty_spaces_after_command';
+ = 'empty_spaces_after_command';
}
my $paragraph = _begin_paragraph($self, $current, $source_info);
$current = $paragraph if $paragraph;
@@ -6948,8 +6961,7 @@ C<@verb>, C<@html>, C<@macro> body).
=item spaces_at_end
-Space at the end of an argument to a line command, at the end of an
-comma-separated argument for some brace commands, or at the end of
+Space at the end of an argument to a line command, or at the end of
bracketed content on a C<@multitable> line or definition line.
=item text_before_beginning
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 12efdc4f0b..4092ff898d 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -1510,9 +1510,27 @@ superfluous_arg:
if (conf.ignore_space_after_braced_command_name)
{
char *p;
+
p = line + strspn (line, whitespace_chars);
if (p != line)
{
+ char *s;
+ KEY_PAIR *k;
+
+ k = lookup_extra (current, "spaces");
+ if (!k)
+ {
+ xasprintf (&s, "%.*s", (int) (p - line), line);
+ add_extra_string (current, "spaces", s);
+ }
+ else
+ {
+ xasprintf (&s, "%s%.*s",
+ (char *) k->value,
+ (int) (p - line), p);
+ free (k->value);
+ k->value = (ELEMENT *) s;
+ }
line = p;
goto funexit;
}
diff --git a/tp/t/converters_tests.t b/tp/t/converters_tests.t
index 1ae1d91410..f9118fa44a 100644
--- a/tp/t/converters_tests.t
+++ b/tp/t/converters_tests.t
@@ -178,7 +178,7 @@ T
@float
a float
-@caption{'."\f".' in cation '."\f".'} '."\f".' Toto
+@caption{'."\f".' within '."\f".' cation '."\f".'} '."\f".' Toto
@end float '."\f".'
'],
diff --git a/tp/t/results/converters_tests/form_feeds.pl
b/tp/t/results/converters_tests/form_feeds.pl
index 28c8eba64e..2ba49d0fc2 100644
--- a/tp/t/results/converters_tests/form_feeds.pl
+++ b/tp/t/results/converters_tests/form_feeds.pl
@@ -786,7 +786,27 @@ $result_trees{'form_feeds'} = {
'contents' => [
{
'parent' => {},
- 'text' => 'in cation '
+ 'text' => 'within '
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ },
+ {
+ 'parent' => {},
+ 'text' => '',
+ 'type' => 'empty_line'
+ },
+ {
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_before_paragraph'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'cation '
}
],
'parent' => {},
@@ -1021,6 +1041,10 @@
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[1]{'paren
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0]{'contents'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0]{'contents'}[0];
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0];
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0]{'contents'}[1]{'parent'}
=
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0];
+$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0]{'contents'}[2]{'parent'}
=
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0];
+$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0]{'contents'}[3]{'contents'}[0]{'parent'}
=
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0]{'contents'}[3];
+$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0]{'contents'}[3]{'parent'}
=
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0];
+$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0]{'contents'}[4]{'parent'}
=
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0];
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'args'}[0]{'parent'}
= $result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2];
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'extra'}{'float'}
= $result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29];
$result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29]{'contents'}[2]{'parent'}
= $result_trees{'form_feeds'}{'contents'}[2]{'contents'}[29];
@@ -1071,7 +1095,7 @@ T
@float
a float
-@caption{ in cation } Toto
+@caption{ within cation } Toto
@end float
';
@@ -1197,7 +1221,9 @@ $result_converted{'plaintext'}->{'form_feeds'} = 'aa
a float
Toto
-in cation
+within
+
+cation
';
@@ -1246,7 +1272,7 @@ $result_converted{'html_text'}->{'form_feeds'} = '<a
class="node-id" id="Top"></
<div class="float">
<p>a float
</p><p>Toto
-</p><div class="caption"><p>in cation </p></div></div>
+</p><div class="caption"><p>within </p><p>cation </p></div></div>
';
@@ -1283,7 +1309,7 @@ $result_converted{'xml'}->{'form_feeds'} = '<node
name="Top" spaces=" "><nodenam
<float type="" endspaces=" ">
<para>a float
-</para><caption spaces="\\f "><para>in cation </para>&formfeed;</caption>
&formfeed; <para>Toto
+</para><caption spaces="\\f "><para>within </para>&formfeed; <para>cation
</para>&formfeed;</caption> &formfeed; <para>Toto
</para></float>
';
@@ -1369,7 +1395,8 @@ T
\\begin{TexinfoFloat}
a float
-\\caption{in cation \\par{}
+\\caption{within \\par{}
+ cation \\par{}
}
\\par{}Toto
\\end{TexinfoFloat}
diff --git a/tp/t/results/coverage/invalid_U.pl
b/tp/t/results/coverage/invalid_U.pl
index 90d813ca70..671d7993cb 100644
--- a/tp/t/results/coverage/invalid_U.pl
+++ b/tp/t/results/coverage/invalid_U.pl
@@ -14,6 +14,9 @@ $result_trees{'invalid_U'} = {
{
'cmdname' => 'U',
'contents' => [],
+ 'extra' => {
+ 'spaces' => ' '
+ },
'parent' => {},
'source_info' => {
'file_name' => '',
@@ -310,7 +313,7 @@
$result_trees{'invalid_U'}{'contents'}[0]{'contents'}[0]{'contents'}[18]{'parent
$result_trees{'invalid_U'}{'contents'}[0]{'contents'}[0]{'parent'} =
$result_trees{'invalid_U'}{'contents'}[0];
$result_trees{'invalid_U'}{'contents'}[0]{'parent'} =
$result_trees{'invalid_U'};
-$result_texis{'invalid_U'} = '@U@U{} @U{z} @U{abc} @U{9999999999999}
@U{110000} @U{10FFFF}
+$result_texis{'invalid_U'} = '@U @U{} @U{z} @U{abc} @U{9999999999999}
@U{110000} @U{10FFFF}
@U{ 0023 } @U{FFFD} @U{ wxyz }
';
diff --git a/tp/t/results/coverage/spaces_after_braced_command.pl
b/tp/t/results/coverage/spaces_after_braced_command.pl
index fde90af8ed..2c4290fa99 100644
--- a/tp/t/results/coverage/spaces_after_braced_command.pl
+++ b/tp/t/results/coverage/spaces_after_braced_command.pl
@@ -26,6 +26,9 @@ $result_trees{'spaces_after_braced_command'} = {
],
'cmdname' => 'code',
'contents' => [],
+ 'extra' => {
+ 'spaces' => ' '
+ },
'parent' => {},
'source_info' => {
'file_name' => '',
@@ -65,6 +68,10 @@ $result_trees{'spaces_after_braced_command'} = {
],
'cmdname' => 'samp',
'contents' => [],
+ 'extra' => {
+ 'spaces' => '
+'
+ },
'parent' => {},
'source_info' => {
'file_name' => '',
@@ -101,9 +108,10 @@
$result_trees{'spaces_after_braced_command'}{'contents'}[0]{'contents'}[2]{'cont
$result_trees{'spaces_after_braced_command'}{'contents'}[0]{'contents'}[2]{'parent'}
= $result_trees{'spaces_after_braced_command'}{'contents'}[0];
$result_trees{'spaces_after_braced_command'}{'contents'}[0]{'parent'} =
$result_trees{'spaces_after_braced_command'};
-$result_texis{'spaces_after_braced_command'} = '@code{b}
+$result_texis{'spaces_after_braced_command'} = '@code {b}
-@samp{v}
+@samp
+{v}
';
diff --git a/tp/t/results/coverage/spaces_no_brace_after_braced_command.pl
b/tp/t/results/coverage/spaces_no_brace_after_braced_command.pl
index 541ec65765..1a5611e03c 100644
--- a/tp/t/results/coverage/spaces_no_brace_after_braced_command.pl
+++ b/tp/t/results/coverage/spaces_no_brace_after_braced_command.pl
@@ -14,6 +14,9 @@ $result_trees{'spaces_no_brace_after_braced_command'} = {
{
'cmdname' => 'code',
'contents' => [],
+ 'extra' => {
+ 'spaces' => ' '
+ },
'parent' => {},
'source_info' => {
'file_name' => '',
@@ -42,7 +45,7 @@
$result_trees{'spaces_no_brace_after_braced_command'}{'contents'}[0]{'contents'}
$result_trees{'spaces_no_brace_after_braced_command'}{'contents'}[0]{'contents'}[0]{'parent'}
= $result_trees{'spaces_no_brace_after_braced_command'}{'contents'}[0];
$result_trees{'spaces_no_brace_after_braced_command'}{'contents'}[0]{'parent'}
= $result_trees{'spaces_no_brace_after_braced_command'};
-$result_texis{'spaces_no_brace_after_braced_command'} = '@codeb
+$result_texis{'spaces_no_brace_after_braced_command'} = '@code b
';
diff --git a/tp/t/results/coverage_braces/no_brace.pl
b/tp/t/results/coverage_braces/no_brace.pl
index 5ebb922cd2..f9488f0d04 100644
--- a/tp/t/results/coverage_braces/no_brace.pl
+++ b/tp/t/results/coverage_braces/no_brace.pl
@@ -14,6 +14,9 @@ $result_trees{'no_brace'} = {
{
'cmdname' => 'TeX',
'contents' => [],
+ 'extra' => {
+ 'spaces' => ' '
+ },
'parent' => {},
'source_info' => {
'file_name' => '',
@@ -28,6 +31,9 @@ $result_trees{'no_brace'} = {
{
'cmdname' => 'code',
'contents' => [],
+ 'extra' => {
+ 'spaces' => ' '
+ },
'parent' => {},
'source_info' => {
'file_name' => '',
@@ -42,6 +48,9 @@ $result_trees{'no_brace'} = {
{
'cmdname' => 'footnote',
'contents' => [],
+ 'extra' => {
+ 'spaces' => ' '
+ },
'parent' => {},
'source_info' => {
'file_name' => '',
@@ -73,7 +82,7 @@
$result_trees{'no_brace'}{'contents'}[0]{'contents'}[0]{'contents'}[5]{'parent'}
$result_trees{'no_brace'}{'contents'}[0]{'contents'}[0]{'parent'} =
$result_trees{'no_brace'}{'contents'}[0];
$result_trees{'no_brace'}{'contents'}[0]{'parent'} = $result_trees{'no_brace'};
-$result_texis{'no_brace'} = '@TeXand @codecode and @footnotefootnote ';
+$result_texis{'no_brace'} = '@TeX and @code code and @footnote footnote ';
$result_texts{'no_brace'} = 'TeXand code and footnote ';
diff --git a/tp/t/results/coverage_braces/no_brace_space_end_line.pl
b/tp/t/results/coverage_braces/no_brace_space_end_line.pl
index e4ca636fce..4d958dae72 100644
--- a/tp/t/results/coverage_braces/no_brace_space_end_line.pl
+++ b/tp/t/results/coverage_braces/no_brace_space_end_line.pl
@@ -26,6 +26,9 @@ $result_trees{'no_brace_space_end_line'} = {
],
'cmdname' => 'code',
'contents' => [],
+ 'extra' => {
+ 'spaces' => ' '
+ },
'parent' => {},
'source_info' => {
'file_name' => '',
@@ -53,6 +56,10 @@ $result_trees{'no_brace_space_end_line'} = {
{
'cmdname' => 'TeX',
'contents' => [],
+ 'extra' => {
+ 'spaces' => '
+'
+ },
'parent' => {},
'source_info' => {
'file_name' => '',
@@ -68,6 +75,10 @@ $result_trees{'no_brace_space_end_line'} = {
{
'cmdname' => 'code',
'contents' => [],
+ 'extra' => {
+ 'spaces' => '
+'
+ },
'parent' => {},
'source_info' => {
'file_name' => '',
@@ -103,10 +114,12 @@
$result_trees{'no_brace_space_end_line'}{'contents'}[0]{'contents'}[2]{'contents
$result_trees{'no_brace_space_end_line'}{'contents'}[0]{'contents'}[2]{'parent'}
= $result_trees{'no_brace_space_end_line'}{'contents'}[0];
$result_trees{'no_brace_space_end_line'}{'contents'}[0]{'parent'} =
$result_trees{'no_brace_space_end_line'};
-$result_texis{'no_brace_space_end_line'} = '@code{c}.
+$result_texis{'no_brace_space_end_line'} = '@code {c}.
-@TeXtext
-@codeArg.';
+@TeX
+text
+@code
+Arg.';
$result_texts{'no_brace_space_end_line'} = 'c.
diff --git a/tp/tests/layout/res_parser/formatting_macro_expand/formatting.texi
b/tp/tests/layout/res_parser/formatting_macro_expand/formatting.texi
index a4af53a6e6..454858b935 100644
--- a/tp/tests/layout/res_parser/formatting_macro_expand/formatting.texi
+++ b/tp/tests/layout/res_parser/formatting_macro_expand/formatting.texi
@@ -2165,14 +2165,16 @@ Invalid use of @@':@*
@code{@@dotless@{a@}} @dotless{a}
@c @U arg must be specified and within range
-@@U, without braces @U@@U@{@}, with empty arg @U{}
+@@U, without braces @U
+@@U@{@}, with empty arg @U{}
@@U@{z@}, with non-hex arg @U{z}
@@U@{abc@}, with <4 hex digits @U{abc}
@@U@{FFFFFFFFFFFFFF@}, value much too large @U{FFFFFFFFFFFFFF}
@@U@{110000@}, value just beyond Unicode @U{110000}
@c braces missing
-@@TeX, but without brace @TeX@c unknown command
+@@TeX, but without brace @TeX
+@c unknown command
@code{@@#} #
@c no arg
@@ -3311,14 +3313,16 @@ Invalid use of @@':@*
@code{@@dotless@{a@}} @dotless{a}
@c @U arg must be specified and within range
-@@U, without braces @U@@U@{@}, with empty arg @U{}
+@@U, without braces @U
+@@U@{@}, with empty arg @U{}
@@U@{z@}, with non-hex arg @U{z}
@@U@{abc@}, with <4 hex digits @U{abc}
@@U@{FFFFFFFFFFFFFF@}, value much too large @U{FFFFFFFFFFFFFF}
@@U@{110000@}, value just beyond Unicode @U{110000}
@c braces missing
-@@TeX, but without brace @TeX@c unknown command
+@@TeX, but without brace @TeX
+@c unknown command
@code{@@#} #
@c no arg
@@ -4483,14 +4487,16 @@ Invalid use of @@':@*
@code{@@dotless@{a@}} @dotless{a}
@c @U arg must be specified and within range
-@@U, without braces @U@@U@{@}, with empty arg @U{}
+@@U, without braces @U
+@@U@{@}, with empty arg @U{}
@@U@{z@}, with non-hex arg @U{z}
@@U@{abc@}, with <4 hex digits @U{abc}
@@U@{FFFFFFFFFFFFFF@}, value much too large @U{FFFFFFFFFFFFFF}
@@U@{110000@}, value just beyond Unicode @U{110000}
@c braces missing
-@@TeX, but without brace @TeX@c unknown command
+@@TeX, but without brace @TeX
+@c unknown command
@code{@@#} #
@c no arg
@@ -5636,14 +5642,16 @@ Invalid use of @@':@*
@code{@@dotless@{a@}} @dotless{a}
@c @U arg must be specified and within range
-@@U, without braces @U@@U@{@}, with empty arg @U{}
+@@U, without braces @U
+@@U@{@}, with empty arg @U{}
@@U@{z@}, with non-hex arg @U{z}
@@U@{abc@}, with <4 hex digits @U{abc}
@@U@{FFFFFFFFFFFFFF@}, value much too large @U{FFFFFFFFFFFFFF}
@@U@{110000@}, value just beyond Unicode @U{110000}
@c braces missing
-@@TeX, but without brace @TeX@c unknown command
+@@TeX, but without brace @TeX
+@c unknown command
@code{@@#} #
@c no arg
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Add spaces information for @-commands with braces followed by spaces,
Patrice Dumas <=