[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Makefile.tres, tp/t/60macro.t: add macro_exp
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Makefile.tres, tp/t/60macro.t: add macro_expansion_end_in_conditional_line and macro_expansion_end_in_conditional_end tests. |
Date: |
Tue, 14 Feb 2023 16:59:15 -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 00e9c603dd * tp/Makefile.tres, tp/t/60macro.t: add
macro_expansion_end_in_conditional_line and
macro_expansion_end_in_conditional_end tests.
00e9c603dd is described below
commit 00e9c603dd146f961ddf2ae03de719e2c85a8a5f
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Feb 14 22:59:04 2023 +0100
* tp/Makefile.tres, tp/t/60macro.t: add
macro_expansion_end_in_conditional_line and
macro_expansion_end_in_conditional_end tests.
---
ChangeLog | 6 +
tp/Makefile.tres | 2 +
tp/TODO | 3 -
tp/t/60macro.t | 23 ++
.../macro_expansion_end_in_conditional_end.pl | 248 +++++++++++++++++++++
.../macro_expansion_end_in_conditional_line.pl | 236 ++++++++++++++++++++
6 files changed, 515 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3fbbd6e767..758f8837b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-02-14 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Makefile.tres, tp/t/60macro.t: add
+ macro_expansion_end_in_conditional_line and
+ macro_expansion_end_in_conditional_end tests.
+
2023-02-14 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/ParserNonXS.pm (_end_line_misc_line)
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index fddeab3e50..970dd04c38 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -1214,6 +1214,8 @@ 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_conditional_end.pl \
+ t/results/macro/macro_expansion_end_in_conditional_line.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 \
diff --git a/tp/TODO b/tp/TODO
index d4f527af0c..04c5c409ac 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -10,9 +10,6 @@ This is the todo list for texi2any
Before next release
===================
-Add source marks for non ignored @if blocks and the corresponding @end
-+ tests of source marks on the @-command lines.
-
Add elided raw output format content to the tree (there should already be a
test for
source mark there).
diff --git a/tp/t/60macro.t b/tp/t/60macro.t
index 3238753905..2374ba4b2b 100644
--- a/tp/t/60macro.t
+++ b/tp/t/60macro.t
@@ -885,6 +885,29 @@ GG
@end ifset
@end ifclear
'],
+['macro_expansion_end_in_conditional_line',
+'@macro begincond
+@ifset fl
+@end macro
+
+@set flag 1
+
+@begincond{}ag
+Defined
+@end ifset
+'],
+['macro_expansion_end_in_conditional_end',
+'@macro beginendcond
+@ifset flag
+Defined
+@end if
+@end macro
+
+@set flag 1
+
+@beginendcond{}set
+'],
+
# the use of @unmacro dates from the time when macros needed
# to be undefined before being redefined. Left as test.
# texi2dvi breaks.
diff --git a/tp/t/results/macro/macro_expansion_end_in_conditional_end.pl
b/tp/t/results/macro/macro_expansion_end_in_conditional_end.pl
new file mode 100644
index 0000000000..6637ee1332
--- /dev/null
+++ b/tp/t/results/macro/macro_expansion_end_in_conditional_end.pl
@@ -0,0 +1,248 @@
+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_conditional_end'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'beginendcond',
+ 'type' => 'macro_name'
+ }
+ ],
+ 'cmdname' => 'macro',
+ 'contents' => [
+ {
+ 'text' => '@ifset flag
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => 'Defined
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '@end if
+',
+ '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' => ' beginendcond
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'text' => 'flag',
+ 'type' => 'misc_arg'
+ },
+ {
+ 'text' => '1',
+ 'type' => 'misc_arg'
+ }
+ ],
+ 'cmdname' => 'set',
+ 'extra' => {
+ 'misc_args' => [
+ 'flag',
+ '1'
+ ]
+ },
+ 'info' => {
+ 'arg_line' => ' flag 1
+'
+ }
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'extra' => {
+ 'name' => 'beginendcond'
+ },
+ 'type' => 'macro_call'
+ },
+ 'position' => 1,
+ 'sourcemark_type' => 'macro_expansion',
+ 'status' => 'start'
+ },
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'flag'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'ifset',
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => 'beginendcond'
+ }
+ },
+ 'position' => 1,
+ 'sourcemark_type' => 'expanded_conditional_command',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'position' => 2,
+ 'sourcemark_type' => 'macro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ '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' => 'beginendcond'
+ }
+ },
+ 'position' => 8,
+ 'sourcemark_type' => 'expanded_conditional_command',
+ 'status' => 'end'
+ }
+ ],
+ 'text' => 'Defined
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'macro_expansion_end_in_conditional_end'} = '@macro beginendcond
+@ifset flag
+Defined
+@end if
+@end macro
+
+@set flag 1
+
+Defined
+';
+
+
+$result_texts{'macro_expansion_end_in_conditional_end'} = '
+
+Defined
+';
+
+$result_errors{'macro_expansion_end_in_conditional_end'} = [];
+
+
+$result_floats{'macro_expansion_end_in_conditional_end'} = {};
+
+
+1;
diff --git a/tp/t/results/macro/macro_expansion_end_in_conditional_line.pl
b/tp/t/results/macro/macro_expansion_end_in_conditional_line.pl
new file mode 100644
index 0000000000..dc2a3b9aaf
--- /dev/null
+++ b/tp/t/results/macro/macro_expansion_end_in_conditional_line.pl
@@ -0,0 +1,236 @@
+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_conditional_line'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'begincond',
+ 'type' => 'macro_name'
+ }
+ ],
+ 'cmdname' => 'macro',
+ 'contents' => [
+ {
+ 'text' => '@ifset fl
+',
+ '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' => 3,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' begincond
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'text' => 'flag',
+ 'type' => 'misc_arg'
+ },
+ {
+ 'text' => '1',
+ 'type' => 'misc_arg'
+ }
+ ],
+ 'cmdname' => 'set',
+ 'extra' => {
+ 'misc_args' => [
+ 'flag',
+ '1'
+ ]
+ },
+ 'info' => {
+ 'arg_line' => ' flag 1
+'
+ }
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'extra' => {
+ 'name' => 'begincond'
+ },
+ 'type' => 'macro_call'
+ },
+ 'position' => 1,
+ 'sourcemark_type' => 'macro_expansion',
+ 'status' => 'start'
+ },
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'position' => 2,
+ 'sourcemark_type' => 'macro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'text' => 'flag'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'ifset',
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'begincond'
+ }
+ },
+ 'position' => 1,
+ 'sourcemark_type' => 'expanded_conditional_command',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ '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' => ''
+ }
+ },
+ 'position' => 8,
+ 'sourcemark_type' => 'expanded_conditional_command',
+ 'status' => 'end'
+ }
+ ],
+ 'text' => 'Defined
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'macro_expansion_end_in_conditional_line'} = '@macro begincond
+@ifset fl
+@end macro
+
+@set flag 1
+
+Defined
+';
+
+
+$result_texts{'macro_expansion_end_in_conditional_line'} = '
+
+Defined
+';
+
+$result_errors{'macro_expansion_end_in_conditional_line'} = [];
+
+
+$result_floats{'macro_expansion_end_in_conditional_line'} = {};
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Makefile.tres, tp/t/60macro.t: add macro_expansion_end_in_conditional_line and macro_expansion_end_in_conditional_end tests.,
Patrice Dumas <=
- Prev 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 [...]
- Next by Date:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line), tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line): keep content in ignored rawpreformatted output block commands in elided_rawpreformatted container as raw text.
- Previous 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 [...]
- Next by thread:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line), tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line): keep content in ignored rawpreformatted output block commands in elided_rawpreformatted container as raw text.
- Index(es):