[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Makefile.tres, tp/t/60macro.t, tp/t/converte
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Makefile.tres, tp/t/60macro.t, tp/t/converters_tests.t: add macro_expansion_end_in_ignored_ifset_content, macro_expansion_end_in_ignored_nested_conditional, macro_expansion_end_in_ignored_nested_different_conditional tests in *macro.t and inlinefmtifelse_with_commands in converters_tests.t. |
Date: |
Tue, 14 Feb 2023 13:47:24 -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 f36111ed08 * tp/Makefile.tres, tp/t/60macro.t,
tp/t/converters_tests.t: add macro_expansion_end_in_ignored_ifset_content,
macro_expansion_end_in_ignored_nested_conditional,
macro_expansion_end_in_ignored_nested_different_conditional tests in *macro.t
and inlinefmtifelse_with_commands in converters_tests.t.
f36111ed08 is described below
commit f36111ed0821f5f37cc27a99ebf93b3d48a29a18
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Feb 14 19:47:14 2023 +0100
* tp/Makefile.tres, tp/t/60macro.t, tp/t/converters_tests.t: add
macro_expansion_end_in_ignored_ifset_content,
macro_expansion_end_in_ignored_nested_conditional,
macro_expansion_end_in_ignored_nested_different_conditional tests in
*macro.t and inlinefmtifelse_with_commands in converters_tests.t.
---
ChangeLog | 8 +
tp/Makefile.tres | 4 +
tp/TODO | 15 +-
tp/Texinfo/ParserNonXS.pm | 5 +
tp/t/60macro.t | 34 +-
tp/t/converters_tests.t | 19 +
.../inlinefmtifelse_with_commands.pl | 564 +++++++++++++++++++++
...macro_expansion_end_in_ignored_ifset_content.pl | 202 ++++++++
..._expansion_end_in_ignored_nested_conditional.pl | 254 ++++++++++
..._end_in_ignored_nested_different_conditional.pl | 223 ++++++++
10 files changed, 1317 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a4625ced4d..78becac970 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-02-14 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Makefile.tres, tp/t/60macro.t, tp/t/converters_tests.t: add
+ macro_expansion_end_in_ignored_ifset_content,
+ macro_expansion_end_in_ignored_nested_conditional,
+ macro_expansion_end_in_ignored_nested_different_conditional tests in
+ *macro.t and inlinefmtifelse_with_commands in converters_tests.t.
+
2023-02-14 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/ParserNonXS.pm (_close_commands, _end_line_misc_line)
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 90ad96ebad..fddeab3e50 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -188,6 +188,7 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/converters_tests/inline.pl \
t/results/converters_tests/inline_expand_tex.pl \
t/results/converters_tests/inlinefmtifelse.pl \
+ t/results/converters_tests/inlinefmtifelse_with_commands.pl \
t/results/converters_tests/inlinefmtspaces.pl \
t/results/converters_tests/inlineifsetifclear.pl \
t/results/converters_tests/inlineifsetifclearspaces.pl \
@@ -1213,6 +1214,9 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/macro/macro_end_call_in_ignored_raw.pl \
t/results/macro/macro_expands_to_empty.pl \
t/results/macro/macro_expansion.pl \
+ t/results/macro/macro_expansion_end_in_ignored_ifset_content.pl \
+ t/results/macro/macro_expansion_end_in_ignored_nested_conditional.pl \
+
t/results/macro/macro_expansion_end_in_ignored_nested_different_conditional.pl \
t/results/macro/macro_for_dot_in_menu_not_separator.pl \
t/results/macro/macro_for_end.pl \
t/results/macro/macro_for_ignored_line_command.pl \
diff --git a/tp/TODO b/tp/TODO
index 68455e0c59..d4f527af0c 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -10,10 +10,6 @@ This is the todo list for texi2any
Before next release
===================
-Add tests of source marks on ignored @if* blocks lines and in contents.
-
-Check nested @if* commands and source marks.
-
Add source marks for non ignored @if blocks and the corresponding @end
+ tests of source marks on the @-command lines.
@@ -27,12 +23,7 @@ the line corresponding to @set anothervar, at:
@conditionals{}
and not in the following empty line.
-/usr/bin/perl -w ./..//texi2any.pl --force --conf-dir ./../t/init/ --conf-dir
./../init --conf-dir ./../ext -I ./coverage/ -I coverage// -I ./ -I . -I
built_input --error-limit=1000 -c TEST=1 --output
coverage//out_parser/formatting_macro_expand/
--macro-expand=coverage//out_parser/formatting_macro_expand/formatting.texi -c
TEXINFO_OUTPUT_FORMAT=structure ./coverage//formatting.texi --debug=1 2>t.err
-Wide character in print at ../../tp/Texinfo/ParserNonXS.pm line 4799.
-Wide character in print at ../../tp/Texinfo/ParserNonXS.pm line 2296.
-
-Add a test similar to converters_tests.t inlinefmtifelse showing
-the the second arg in the parser is raw text as no format is expanded.
+check @ifsettoto in nested ignored conditionals, the XS parser is probably
fooled.
Bugs
====
@@ -134,6 +125,10 @@ internal nodes. In general, it is because gdt() is used
instead of direct
HTML.
+Many strings in debugging output are not encoded. For example with
+/usr/bin/perl -w ./..//texi2any.pl --force --conf-dir ./../t/init/ --conf-dir
./../init --conf-dir ./../ext -I ./coverage/ -I coverage// -I ./ -I . -I
built_input --error-limit=1000 -c TEST=1 --output
coverage//out_parser/formatting_macro_expand/
--macro-expand=coverage//out_parser/formatting_macro_expand/formatting.texi -c
TEXINFO_OUTPUT_FORMAT=structure ./coverage//formatting.texi --debug=1 2>t.err
+
+
HTML5 validation tidy errors that do not need fixing
----------------------------------------------------
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 3e6e6779f8..f8a27dc49d 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -2211,6 +2211,11 @@ sub _close_commands($$$;$$)
if ($block_commands{$closed_element->{'cmdname'}} eq 'conditional') {
# In ignored conditional.
+ # NOTE since the source mark is registerd at command closing, in
+ # case of nested ignored conditionals, the inside conditional will
+ # be registered first. It could probably possible to register
+ # the source mark at the opening instead, but it is unclear which is
+ # best.
_close_ignored_block_conditional($self, $current);
}
diff --git a/tp/t/60macro.t b/tp/t/60macro.t
index 6156323b00..3238753905 100644
--- a/tp/t/60macro.t
+++ b/tp/t/60macro.t
@@ -854,7 +854,39 @@ arg
in ifset
@endifset
'],
-# unmacro is required for C makeinfo to avoid a warning.
+['macro_expansion_end_in_ignored_ifset_content',
+'@macro beginifsetcontent
+@ifset a
+going
+@end macro
+
+@beginifsetcontent{} into the code
+@end ifset
+'],
+['macro_expansion_end_in_ignored_nested_conditional',
+'@macro beginnestedcond
+@ifset a
+@ifset b
+GG
+@end macro
+
+@beginnestedcond{}
+@end ifset
+@end ifset
+'],
+['macro_expansion_end_in_ignored_nested_different_conditional',
+'@macro beginnestedcond
+@ifset a
+@ifclear b
+GG
+@end macro
+
+@beginnestedcond{}
+@end ifset
+@end ifclear
+'],
+# the use of @unmacro dates from the time when macros needed
+# to be undefined before being redefined. Left as test.
# texi2dvi breaks.
['arg_body_expansion_order',
'
diff --git a/tp/t/converters_tests.t b/tp/t/converters_tests.t
index 263a17fea1..6fe059c265 100644
--- a/tp/t/converters_tests.t
+++ b/tp/t/converters_tests.t
@@ -506,6 +506,25 @@ $inline_text, {'EXPANDED_FORMATS' => ['tex']},
',
{'EXPANDED_FORMATS' => []}
],
+# same as above, show visually that the format being converted
+# text is the first argument and is raw text without @-command
+# expanded, while for the other formats the second argument is
+# used and the @-commands are expanded.
+['inlinefmtifelse_with_commands',
+'@inlinefmtifelse{html,if @code{html},else @code{html}}.
+
+@inlinefmtifelse{plaintext,if @emph{plaintext},else @emph{plaintext}}.
+
+@inlinefmtifelse{xml,if xml @env{empty} second arg, xml @env{else}}.
+
+@inlinefmtifelse{ docbook , if docbook @string{spaces} , else @strong{docbook
spaces} }.
+
+@inlinefmtifelse{tex,if @var{tex},@var{else} tex}.
+
+@inlinefmtifelse{latex,if @sc{latex},@sc{else} latex}.
+',
+{'EXPANDED_FORMATS' => []}
+],
# similar tests without leading/trailing spaces in t/*raw.t
['inlinefmtspaces',
'A @inlinefmt { plaintext , plaintext `` @lbracechar{} } a. Now html
diff --git a/tp/t/results/converters_tests/inlinefmtifelse_with_commands.pl
b/tp/t/results/converters_tests/inlinefmtifelse_with_commands.pl
new file mode 100644
index 0000000000..3f1820e653
--- /dev/null
+++ b/tp/t/results/converters_tests/inlinefmtifelse_with_commands.pl
@@ -0,0 +1,564 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'inlinefmtifelse_with_commands'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'html'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'if @code{html}',
+ 'type' => 'raw'
+ }
+ ],
+ 'type' => 'elided_brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'else '
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'html'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'inlinefmtifelse',
+ 'extra' => {
+ 'expand_index' => 2,
+ 'format' => 'html'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'plaintext'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'if @emph{plaintext}',
+ 'type' => 'raw'
+ }
+ ],
+ 'type' => 'elided_brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'else '
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'plaintext'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'emph',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'inlinefmtifelse',
+ 'extra' => {
+ 'expand_index' => 2,
+ 'format' => 'plaintext'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'xml'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'if xml @env{empty} second arg',
+ 'type' => 'raw'
+ }
+ ],
+ 'type' => 'elided_brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'xml '
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'else'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'env',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'inlinefmtifelse',
+ 'extra' => {
+ 'expand_index' => 2,
+ 'format' => 'xml'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'docbook'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => ' '
+ },
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => ' if docbook @string{spaces} ',
+ 'type' => 'raw'
+ }
+ ],
+ 'type' => 'elided_brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'else '
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'docbook spaces'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'strong',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => ' '
+ }
+ ],
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'inlinefmtifelse',
+ 'extra' => {
+ 'expand_index' => 2,
+ 'format' => 'docbook'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'tex'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'if @var{tex}',
+ 'type' => 'raw'
+ }
+ ],
+ 'type' => 'elided_brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'else'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'var',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => ' tex'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'inlinefmtifelse',
+ 'extra' => {
+ 'expand_index' => 2,
+ 'format' => 'tex'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'latex'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'if @sc{latex}',
+ 'type' => 'raw'
+ }
+ ],
+ 'type' => 'elided_brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'else'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'sc',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => ' latex'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'inlinefmtifelse',
+ 'extra' => {
+ 'expand_index' => 2,
+ 'format' => 'latex'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'inlinefmtifelse_with_commands'} = '@inlinefmtifelse{html,if
@code{html},else @code{html}}.
+
+@inlinefmtifelse{plaintext,if @emph{plaintext},else @emph{plaintext}}.
+
+@inlinefmtifelse{xml,if xml @env{empty} second arg, xml @env{else}}.
+
+@inlinefmtifelse{ docbook , if docbook @string{spaces} , else @strong{docbook
spaces} }.
+
+@inlinefmtifelse{tex,if @var{tex},@var{else} tex}.
+
+@inlinefmtifelse{latex,if @sc{latex},@sc{else} latex}.
+';
+
+
+$result_texts{'inlinefmtifelse_with_commands'} = 'else html.
+
+else plaintext.
+
+xml else.
+
+else docbook spaces .
+
+else tex.
+
+ELSE latex.
+';
+
+$result_errors{'inlinefmtifelse_with_commands'} = [];
+
+
+$result_floats{'inlinefmtifelse_with_commands'} = {};
+
+
+
+$result_converted{'plaintext'}->{'inlinefmtifelse_with_commands'} = 'else
‘html’.
+
+ if @emph{plaintext}.
+
+ xml ‘else’.
+
+ else *docbook spaces* .
+
+ ELSE tex.
+
+ ELSE latex.
+';
+
+
+$result_converted{'html_text'}->{'inlinefmtifelse_with_commands'} = '<p>if
@code{html}.
+</p>
+<p>else <em class="emph">plaintext</em>.
+</p>
+<p>xml <code class="env">else</code>.
+</p>
+<p>else <strong class="strong">docbook spaces</strong> .
+</p>
+<p><var class="var">else</var> tex.
+</p>
+<p><small class="sc">ELSE</small> latex.
+</p>';
+
+
+$result_converted{'xml'}->{'inlinefmtifelse_with_commands'} =
'<para><inlinefmtifelse><inlinefmtifelseformat>html</inlinefmtifelseformat><inlinefmtifelsecontentif>if
@code{html}</inlinefmtifelsecontentif><inlinefmtifelsecontentelse>else
<code>html</code></inlinefmtifelsecontentelse></inlinefmtifelse>.
+</para>
+<para><inlinefmtifelse><inlinefmtifelseformat>plaintext</inlinefmtifelseformat><inlinefmtifelsecontentif>if
@emph{plaintext}</inlinefmtifelsecontentif><inlinefmtifelsecontentelse>else
<emph>plaintext</emph></inlinefmtifelsecontentelse></inlinefmtifelse>.
+</para>
+<para>.
+</para>
+<para><inlinefmtifelse><inlinefmtifelseformat spaces=" ">docbook
</inlinefmtifelseformat><inlinefmtifelsecontentif> if docbook @string{spaces}
</inlinefmtifelsecontentif><inlinefmtifelsecontentelse spaces=" ">else
<strong>docbook spaces</strong> </inlinefmtifelsecontentelse></inlinefmtifelse>.
+</para>
+<para><inlinefmtifelse><inlinefmtifelseformat>tex</inlinefmtifelseformat><inlinefmtifelsecontentif>if
@var{tex}</inlinefmtifelsecontentif><inlinefmtifelsecontentelse><var>else</var>
tex</inlinefmtifelsecontentelse></inlinefmtifelse>.
+</para>
+<para><inlinefmtifelse><inlinefmtifelseformat>latex</inlinefmtifelseformat><inlinefmtifelsecontentif>if
@sc{latex}</inlinefmtifelsecontentif><inlinefmtifelsecontentelse><sc>else</sc>
latex</inlinefmtifelsecontentelse></inlinefmtifelse>.
+</para>';
+
+
+$result_converted{'docbook'}->{'inlinefmtifelse_with_commands'} = '<para>else
<literal>html</literal>.
+</para>
+<para>else <emphasis>plaintext</emphasis>.
+</para>
+<para>xml <envar>else</envar>.
+</para>
+<para> if docbook @string{spaces} .
+</para>
+<para><replaceable>else</replaceable> tex.
+</para>
+<para>ELSE latex.
+</para>';
+
+
+$result_converted{'latex_text'}->{'inlinefmtifelse_with_commands'} = 'else
\\texttt{html}.
+
+else \\emph{plaintext}.
+
+xml \\texttt{else}.
+
+else \\textbf{docbook spaces} .
+
+\\Texinfocommandstyletextvar{else} tex.
+
+if @sc\\{latex\\}.
+';
+
+1;
diff --git a/tp/t/results/macro/macro_expansion_end_in_ignored_ifset_content.pl
b/tp/t/results/macro/macro_expansion_end_in_ignored_ifset_content.pl
new file mode 100644
index 0000000000..70ab3d99a0
--- /dev/null
+++ b/tp/t/results/macro/macro_expansion_end_in_ignored_ifset_content.pl
@@ -0,0 +1,202 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'macro_expansion_end_in_ignored_ifset_content'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'beginifsetcontent',
+ 'type' => 'macro_name'
+ }
+ ],
+ 'cmdname' => 'macro',
+ 'contents' => [
+ {
+ 'text' => '@ifset a
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => 'going
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'macro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'macro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' beginifsetcontent
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'extra' => {
+ 'name' => 'beginifsetcontent'
+ },
+ 'type' => 'macro_call'
+ },
+ 'position' => 1,
+ 'sourcemark_type' => 'macro_expansion',
+ 'status' => 'start'
+ },
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'a'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'ifset',
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'position' => 6,
+ 'sourcemark_type' => 'macro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'text' => 'going ',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => ' into the code
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'ifset'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'ifset'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 6,
+ 'macro' => 'beginifsetcontent'
+ }
+ },
+ 'position' => 1,
+ 'sourcemark_type' => 'ignored_conditional_block'
+ }
+ ],
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'macro_expansion_end_in_ignored_ifset_content'} = '@macro
beginifsetcontent
+@ifset a
+going
+@end macro
+
+';
+
+
+$result_texts{'macro_expansion_end_in_ignored_ifset_content'} = '
+';
+
+$result_errors{'macro_expansion_end_in_ignored_ifset_content'} = [];
+
+
+$result_floats{'macro_expansion_end_in_ignored_ifset_content'} = {};
+
+
+1;
diff --git
a/tp/t/results/macro/macro_expansion_end_in_ignored_nested_conditional.pl
b/tp/t/results/macro/macro_expansion_end_in_ignored_nested_conditional.pl
new file mode 100644
index 0000000000..be60725d43
--- /dev/null
+++ b/tp/t/results/macro/macro_expansion_end_in_ignored_nested_conditional.pl
@@ -0,0 +1,254 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'macro_expansion_end_in_ignored_nested_conditional'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'beginnestedcond',
+ 'type' => 'macro_name'
+ }
+ ],
+ 'cmdname' => 'macro',
+ 'contents' => [
+ {
+ 'text' => '@ifset a
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '@ifset b
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => 'GG
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'macro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'macro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' beginnestedcond
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'extra' => {
+ 'name' => 'beginnestedcond'
+ },
+ 'type' => 'macro_call'
+ },
+ 'position' => 1,
+ 'sourcemark_type' => 'macro_expansion',
+ 'status' => 'start'
+ },
+ {
+ 'counter' => 2,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'a'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'ifset',
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'cmdname' => 'ifset',
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'position' => 2,
+ 'sourcemark_type' => 'macro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'text' => 'GG',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'ifset'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'ifset'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => ''
+ }
+ }
+ ]
+ },
+ 'sourcemark_type' => 'ignored_conditional_block'
+ }
+ ],
+ 'text' => ''
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'ifset'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'ifset'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'beginnestedcond'
+ }
+ },
+ 'position' => 1,
+ 'sourcemark_type' => 'ignored_conditional_block'
+ }
+ ],
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'macro_expansion_end_in_ignored_nested_conditional'} = '@macro
beginnestedcond
+@ifset a
+@ifset b
+GG
+@end macro
+
+';
+
+
+$result_texts{'macro_expansion_end_in_ignored_nested_conditional'} = '
+';
+
+$result_errors{'macro_expansion_end_in_ignored_nested_conditional'} = [];
+
+
+$result_floats{'macro_expansion_end_in_ignored_nested_conditional'} = {};
+
+
+1;
diff --git
a/tp/t/results/macro/macro_expansion_end_in_ignored_nested_different_conditional.pl
b/tp/t/results/macro/macro_expansion_end_in_ignored_nested_different_conditional.pl
new file mode 100644
index 0000000000..eddf77aa64
--- /dev/null
+++
b/tp/t/results/macro/macro_expansion_end_in_ignored_nested_different_conditional.pl
@@ -0,0 +1,223 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'macro_expansion_end_in_ignored_nested_different_conditional'} =
{
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'beginnestedcond',
+ 'type' => 'macro_name'
+ }
+ ],
+ 'cmdname' => 'macro',
+ 'contents' => [
+ {
+ 'text' => '@ifset a
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '@ifclear b
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => 'GG
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'macro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'macro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' beginnestedcond
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'extra' => {
+ 'name' => 'beginnestedcond'
+ },
+ 'type' => 'macro_call'
+ },
+ 'position' => 1,
+ 'sourcemark_type' => 'macro_expansion',
+ 'status' => 'start'
+ },
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'a'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'ifset',
+ 'contents' => [
+ {
+ 'text' => '@ifclear b
+',
+ 'type' => 'raw'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'position' => 2,
+ 'sourcemark_type' => 'macro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'text' => 'GG',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'ifset'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'ifset'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'beginnestedcond'
+ }
+ },
+ 'position' => 1,
+ 'sourcemark_type' => 'ignored_conditional_block'
+ }
+ ],
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'macro_expansion_end_in_ignored_nested_different_conditional'} =
'@macro beginnestedcond
+@ifset a
+@ifclear b
+GG
+@end macro
+
+';
+
+
+$result_texts{'macro_expansion_end_in_ignored_nested_different_conditional'} =
'
+';
+
+$result_errors{'macro_expansion_end_in_ignored_nested_different_conditional'}
= [
+ {
+ 'error_line' => 'unmatched `@end ifclear\'
+',
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => '',
+ 'text' => 'unmatched `@end ifclear\'',
+ 'type' => 'error'
+ }
+];
+
+
+$result_floats{'macro_expansion_end_in_ignored_nested_different_conditional'}
= {};
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Makefile.tres, tp/t/60macro.t, tp/t/converters_tests.t: add macro_expansion_end_in_ignored_ifset_content, macro_expansion_end_in_ignored_nested_conditional, macro_expansion_end_in_ignored_nested_different_conditional tests in *macro.t and inlinefmtifelse_with_commands in converters_tests.t.,
Patrice Dumas <=
- Prev by Date:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_close_commands, _end_line_misc_line) (_process_remaining_on_line), tp/Texinfo/XS/parsetexi/close.c (close_commands), tp/Texinfo/XS/parsetexi/end_line.c (end_line_misc_line), tp/Texinfo/XS/parsetexi/parser.c (top_conditional_stack, process_remaining_on_line): process end of ignored conditional block in a similar way to other block commands. Do not change how it is detected.
- Next by Date:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_end_line_misc_line) (_end_line_starting_block, _parse_texi), tp/Texinfo/XS/parsetexi/api.c (store_source_mark_list), tp/Texinfo/XS/parsetexi/end_line.c (end_line_starting_block, end_line_misc_line), tp/Texinfo/XS/parsetexi/parser.c (push_conditional_stack) (pop_conditional_stack, top_conditional_stack), tp/Texinfo/XS/parsetexi/parser.h (CONDITIONAL_STACK_ITEM), tp/Texinfo/XS/parsetexi/source_marks.c (register_source_mark) (source_marks_reset_counters): add sou [...]
- Previous by thread:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_close_commands, _end_line_misc_line) (_process_remaining_on_line), tp/Texinfo/XS/parsetexi/close.c (close_commands), tp/Texinfo/XS/parsetexi/end_line.c (end_line_misc_line), tp/Texinfo/XS/parsetexi/parser.c (top_conditional_stack, process_remaining_on_line): process end of ignored conditional block in a similar way to other block commands. Do not change how it is detected.
- Next by thread:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_end_line_misc_line) (_end_line_starting_block, _parse_texi), tp/Texinfo/XS/parsetexi/api.c (store_source_mark_list), tp/Texinfo/XS/parsetexi/end_line.c (end_line_starting_block, end_line_misc_line), tp/Texinfo/XS/parsetexi/parser.c (push_conditional_stack) (pop_conditional_stack, top_conditional_stack), tp/Texinfo/XS/parsetexi/parser.h (CONDITIONAL_STACK_ITEM), tp/Texinfo/XS/parsetexi/source_marks.c (register_source_mark) (source_marks_reset_counters): add sou [...]
- Index(es):