[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/t/65linemacro.t, tp/Makefile.tres: add tests
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/t/65linemacro.t, tp/Makefile.tres: add tests of @linemacro. |
Date: |
Mon, 27 Mar 2023 09:40:59 -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 d8cd8fd701 * tp/t/65linemacro.t, tp/Makefile.tres: add tests of
@linemacro.
d8cd8fd701 is described below
commit d8cd8fd701e3f921a27d506a56b38d2bedad36ff
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Mar 27 15:40:50 2023 +0200
* tp/t/65linemacro.t, tp/Makefile.tres: add tests of @linemacro.
---
ChangeLog | 4 +
tp/Makefile.tres | 11 +
tp/t/65linemacro.t | 162 ++
tp/t/results/linemacro/api_doc_with_linemacro.pl | 1612 ++++++++++++++++++++
tp/t/results/linemacro/braces_after_text.pl | 249 +++
tp/t/results/linemacro/empty_last_argument.pl | 798 ++++++++++
.../results/linemacro/last_argument_with_braces.pl | 1115 ++++++++++++++
.../linemacro/newline_and_continuation_in_brace.pl | 480 ++++++
tp/t/results/linemacro/protected_spaces_on_line.pl | 1056 +++++++++++++
.../linemacro/spaces_after_command_in_call.pl | 407 +++++
tp/t/results/linemacro/spaces_in_args.pl | 388 +++++
tp/t/results/linemacro/spaces_in_call.pl | 374 +++++
tp/t/results/linemacro/text_arguments.pl | 223 +++
13 files changed, 6879 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index e2fbb2fa19..f3b638b82b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2023-03-27 Patrice Dumas <pertusus@free.fr>
+
+ * tp/t/65linemacro.t, tp/Makefile.tres: add tests of @linemacro.
+
2023-03-27 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/ParserNonXS.pm (_split_def_args)
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 7183bbd327..bb9e88b1a7 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -27,6 +27,7 @@ test_tap_files_generated_list = \
t/57invalid_nestings.t \
t/58alias.t \
t/60macro.t \
+ t/65linemacro.t \
t/70value_and_macro.t \
t/80include.t \
t/accents.t \
@@ -1204,6 +1205,16 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/layout/no_monolithic/res_html \
t/results/layout/no_monolithic_only_toc_out.pl \
t/results/layout/no_monolithic_only_toc_out/res_html \
+ t/results/linemacro/api_doc_with_linemacro.pl \
+ t/results/linemacro/braces_after_text.pl \
+ t/results/linemacro/empty_last_argument.pl \
+ t/results/linemacro/last_argument_with_braces.pl \
+ t/results/linemacro/newline_and_continuation_in_brace.pl \
+ t/results/linemacro/protected_spaces_on_line.pl \
+ t/results/linemacro/spaces_after_command_in_call.pl \
+ t/results/linemacro/spaces_in_args.pl \
+ t/results/linemacro/spaces_in_call.pl \
+ t/results/linemacro/text_arguments.pl \
t/results/macro/arg_body_expansion_order.pl \
t/results/macro/arg_not_closed.pl \
t/results/macro/backslash_in_arg.pl \
diff --git a/tp/t/65linemacro.t b/tp/t/65linemacro.t
new file mode 100644
index 0000000000..c496259520
--- /dev/null
+++ b/tp/t/65linemacro.t
@@ -0,0 +1,162 @@
+use strict;
+
+use lib '.';
+use Texinfo::ModulePath (undef, undef, undef, 'updirs' => 2);
+
+require 't/test_utils.pl';
+
+my @test_cases = (
+['text_arguments',
+'@linemacro nospace{one, two, three}
+\three\@bullet{}\two\@minus{}\one\
+@end linemacro
+
+@nospace X Y Z
+'],
+['empty_last_argument',
+'@defcodeindex BI
+@linemacro defbuiltin {symbol, rest}
+@BIindex \symbol\
+@defline Builtin \symbol\ \rest\
+@end linemacro
+
+@defblock
+@defbuiltin foo {}
+
+@defbuiltin foo
+
+@defbuiltin foo {{}}
+@end defblock
+'],
+# arguments should 'my foo' 'a last {} arg{ument}'
+# 'my foo' '{} {}'
+# 'my foo' '{second arg} remaining on {line}'
+['last_argument_with_braces',
+'@linemacro defbuiltin {symbol, rest}
+@defline \symbol\ f r
+@defline expand Builtin and \rest\
+@end linemacro
+
+@defblock
+@defbuiltin {my foo} a last {} arg{ument}
+
+@defbuiltin {my foo} {} {}
+
+@defbuiltin {my foo} {second arg} remaining on {line}
+@end defblock
+'],
+# arguments should be 'text{in paren}' rest{in paren}' ''
+# FIXME This is not currently the result, but result is incorrect for @def*
+['braces_after_text',
+'@linemacro mymacro {a, b, c}
+expand \a\ \b\ \c\
+@end linemacro
+
+@mymacro text{in paren} rest{in paren} {}
+'],
+# continuation with the first call, with @@ there is no continuation
+['protected_spaces_on_line',
+'@linemacro test {first, rest}
+@deffn Function \first\ \rest\
+something
+@end deffn
+@end linemacro
+
+@test foo (bar, baz)@
+ continuation line
+
+@test foo@ b (bar, baz) rest@ and more
+
+@test foo (bar, baz)@@
+ another with double at
+
+'],
+# should have braces and protected end of lines kept
+['newline_and_continuation_in_brace',
+'
+@linemacro mylinecommand {first, second, rest}
+@defline category \first\ \second\ \rest\
+@end linemacro
+
+@defblock
+@mylinecommand a@code{b c}d {some arg @
+ b} {next @
+ last} line
+@end defblock
+'],
+# arguments should be '@abc {d}' '@ringaccent b'
+['spaces_after_command_in_call',
+'@linemacro mylinecommand {first, second, rest}
+@defblock
+@defline category \first\ A \second\ B \rest\
+@end defblock
+@end linemacro
+
+@mylinecommand @abc {d} @ringaccent b rest
+'],
+# first argument should be {a b}{c d}{rest}
+# FIXME not currently ok
+['spaces_in_call',
+'@linemacro mylinecommand {first, second, rest}
+@defblock
+@defline category \first\ A \second\ B \rest\
+@end defblock
+@end linemacro
+
+@mylinecommand{a b}{c d}{rest}
+'],
+['spaces_in_args',
+'@linemacro mylinecommand {first, second, rest}
+@defblock
+@defline category \first\ A \second\ B \rest\
+@end defblock
+@end linemacro
+
+@mylinecommand { a } { d } { rest}
+'],
+['api_doc_with_linemacro',
+'@linemacro param {param, type}
+@defline Parameter @var{\param\} @code{ : \type\}
+@end linemacro
+@linemacro returns {param, type}
+@defline {Return Value} @var{\param\} @code{ : \type\}
+@end linemacro
+@linemacro raises {exception}
+@defline {Exception} \exception\
+@end linemacro
+
+@set txidefnamenospace
+@clear txicodevaristt
+
+@defblock
+@defline Function fft.fft (a, n=@code{None}, axis=@code{-1}, norm=@code{None})
+Compute the one-dimensional discrete Fourier Transform.
+
+@defblock
+@param a array_like
+Input array, can be complex.
+
+@param n int, optional
+Length of the transformed axis of the output.
+If @var{n} is smaller than the length of the input, the input is cropped.
+
+@param axis int, optional
+Axis over which to compute the FFT.
+
+@returns out complex ndarray
+The truncated or zero-padded input.
+
+@raises IndexError
+If @var{axis} is not a valid axis of @var{a}.
+
+@end defblock
+
+@end defblock
+']
+# TODO add linemacro call in linemacro
+# add recurrsive linemacro call
+# add macro call in linemacro
+);
+
+
+run_all('linemacro', \@test_cases);
diff --git a/tp/t/results/linemacro/api_doc_with_linemacro.pl
b/tp/t/results/linemacro/api_doc_with_linemacro.pl
new file mode 100644
index 0000000000..8f95537cd7
--- /dev/null
+++ b/tp/t/results/linemacro/api_doc_with_linemacro.pl
@@ -0,0 +1,1612 @@
+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{'api_doc_with_linemacro'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'param',
+ 'type' => 'macro_name'
+ },
+ {
+ 'text' => 'param',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'type',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'linemacro',
+ 'contents' => [
+ {
+ 'text' => '@defline Parameter @var{\\param\\} @code{ : \\type\\}
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'linemacro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'linemacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' param {param, type}
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'text' => 'returns',
+ 'type' => 'macro_name'
+ },
+ {
+ 'text' => 'param',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'type',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'linemacro',
+ 'contents' => [
+ {
+ 'text' => '@defline {Return Value} @var{\\param\\} @code{ :
\\type\\}
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'linemacro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'linemacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 6,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' returns {param, type}
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'text' => 'raises',
+ 'type' => 'macro_name'
+ },
+ {
+ 'text' => 'exception',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'linemacro',
+ 'contents' => [
+ {
+ 'text' => '@defline {Exception} \\exception\\
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'linemacro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'linemacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' raises {exception}
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'text' => 'txidefnamenospace',
+ 'type' => 'rawline_arg'
+ },
+ {
+ 'text' => '',
+ 'type' => 'rawline_arg'
+ }
+ ],
+ 'cmdname' => 'set',
+ 'info' => {
+ 'arg_line' => ' txidefnamenospace
+'
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'text' => 'txicodevaristt',
+ 'type' => 'rawline_arg'
+ }
+ ],
+ 'cmdname' => 'clear',
+ 'info' => {
+ 'arg_line' => ' txicodevaristt
+'
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'defblock',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'Function'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'fft.fft'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => '(',
+ 'type' => 'delimiter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'a'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => ',',
+ 'type' => 'delimiter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'n='
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'None'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 15,
+ 'macro' => ''
+ }
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => ',',
+ 'type' => 'delimiter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'axis='
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '-1'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 15,
+ 'macro' => ''
+ }
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => ',',
+ 'type' => 'delimiter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'norm='
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'None'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 15,
+ 'macro' => ''
+ }
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => ')',
+ 'type' => 'delimiter'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'omit_def_name_space' => 1,
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 15,
+ 'macro' => ''
+ },
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Compute the one-dimensional discrete Fourier
Transform.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'defblock',
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'a'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'array_like'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'param'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 19,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'Parameter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'a'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'var',
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 19,
+ 'macro' => 'param'
+ }
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => ' : array_like'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 19,
+ 'macro' => 'param'
+ }
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'omit_def_name_space' => 1,
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 19,
+ 'macro' => 'param'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Input array, can be complex.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 2,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'n'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'int,'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'optional'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'param'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 22,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'Parameter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'n'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'var',
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 22,
+ 'macro' => 'param'
+ }
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => ' : int, optional'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 22,
+ 'macro' => 'param'
+ }
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'omit_def_name_space' => 1,
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 22,
+ 'macro' => 'param'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 2,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Length of the transformed axis of the
output.
+'
+ },
+ {
+ 'text' => 'If '
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'n'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'var',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 24,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => ' is smaller than the length of the
input, the input is cropped.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 3,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'axis'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'int,'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'optional'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'param'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 26,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'Parameter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'axis'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'var',
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 26,
+ 'macro' => 'param'
+ }
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => ' : int, optional'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 26,
+ 'macro' => 'param'
+ }
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'omit_def_name_space' => 1,
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 26,
+ 'macro' => 'param'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 3,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Axis over which to compute the FFT.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 4,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'out'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'complex'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'ndarray'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'returns'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 29,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Return Value'
+ }
+ ],
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 29,
+ 'macro' => 'returns'
+ },
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'out'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'var',
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 29,
+ 'macro' => 'returns'
+ }
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => ' : complex ndarray'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 29,
+ 'macro' => 'returns'
+ }
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'omit_def_name_space' => 1,
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 29,
+ 'macro' => 'returns'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 4,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'The truncated or zero-padded input.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 5,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'IndexError'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'raises'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 32,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Exception'
+ }
+ ],
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 32,
+ 'macro' => 'raises'
+ },
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'IndexError'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'omit_def_name_space' => 1,
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 32,
+ 'macro' => 'raises'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 5,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'If '
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'axis'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'var',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 33,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => ' is not a valid axis of '
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'a'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'var',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 33,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '.
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'defblock'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'defblock'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 35,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 18,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'defblock'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'defblock'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 37,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 14,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'api_doc_with_linemacro'}{'contents'}[0]{'contents'}[7]{'contents'}[0]{'extra'}{'def_index_element'}
=
$result_trees{'api_doc_with_linemacro'}{'contents'}[0]{'contents'}[7]{'contents'}[0]{'args'}[0]{'contents'}[2];
+$result_trees{'api_doc_with_linemacro'}{'contents'}[0]{'contents'}[7]{'contents'}[1]{'contents'}[2]{'contents'}[1]{'extra'}{'def_index_element'}
=
$result_trees{'api_doc_with_linemacro'}{'contents'}[0]{'contents'}[7]{'contents'}[1]{'contents'}[2]{'contents'}[1]{'args'}[0]{'contents'}[2];
+$result_trees{'api_doc_with_linemacro'}{'contents'}[0]{'contents'}[7]{'contents'}[1]{'contents'}[2]{'contents'}[3]{'extra'}{'def_index_element'}
=
$result_trees{'api_doc_with_linemacro'}{'contents'}[0]{'contents'}[7]{'contents'}[1]{'contents'}[2]{'contents'}[3]{'args'}[0]{'contents'}[2];
+$result_trees{'api_doc_with_linemacro'}{'contents'}[0]{'contents'}[7]{'contents'}[1]{'contents'}[2]{'contents'}[5]{'extra'}{'def_index_element'}
=
$result_trees{'api_doc_with_linemacro'}{'contents'}[0]{'contents'}[7]{'contents'}[1]{'contents'}[2]{'contents'}[5]{'args'}[0]{'contents'}[2];
+$result_trees{'api_doc_with_linemacro'}{'contents'}[0]{'contents'}[7]{'contents'}[1]{'contents'}[2]{'contents'}[7]{'extra'}{'def_index_element'}
=
$result_trees{'api_doc_with_linemacro'}{'contents'}[0]{'contents'}[7]{'contents'}[1]{'contents'}[2]{'contents'}[7]{'args'}[0]{'contents'}[2];
+$result_trees{'api_doc_with_linemacro'}{'contents'}[0]{'contents'}[7]{'contents'}[1]{'contents'}[2]{'contents'}[9]{'extra'}{'def_index_element'}
=
$result_trees{'api_doc_with_linemacro'}{'contents'}[0]{'contents'}[7]{'contents'}[1]{'contents'}[2]{'contents'}[9]{'args'}[0]{'contents'}[2];
+
+$result_texis{'api_doc_with_linemacro'} = '@linemacro param {param, type}
+@defline Parameter @var{\\param\\} @code{ : \\type\\}
+@end linemacro
+@linemacro returns {param, type}
+@defline {Return Value} @var{\\param\\} @code{ : \\type\\}
+@end linemacro
+@linemacro raises {exception}
+@defline {Exception} \\exception\\
+@end linemacro
+
+@set txidefnamenospace
+@clear txicodevaristt
+
+@defblock
+@defline Function fft.fft (a, n=@code{None}, axis=@code{-1}, norm=@code{None})
+Compute the one-dimensional discrete Fourier Transform.
+
+@defblock
+@defline Parameter @var{a} @code{ : array_like}
+Input array, can be complex.
+
+@defline Parameter @var{n} @code{ : int, optional}
+Length of the transformed axis of the output.
+If @var{n} is smaller than the length of the input, the input is cropped.
+
+@defline Parameter @var{axis} @code{ : int, optional}
+Axis over which to compute the FFT.
+
+@defline {Return Value} @var{out} @code{ : complex ndarray}
+The truncated or zero-padded input.
+
+@defline {Exception} IndexError
+If @var{axis} is not a valid axis of @var{a}.
+
+@end defblock
+
+@end defblock
+';
+
+
+$result_texts{'api_doc_with_linemacro'} = '
+
+Function: fft.fft (a, n=None, axis=-1, norm=None)
+Compute the one-dimensional discrete Fourier Transform.
+
+Parameter: a : array_like
+Input array, can be complex.
+
+Parameter: n : int, optional
+Length of the transformed axis of the output.
+If n is smaller than the length of the input, the input is cropped.
+
+Parameter: axis : int, optional
+Axis over which to compute the FFT.
+
+Return Value: out : complex ndarray
+The truncated or zero-padded input.
+
+Exception: IndexError
+If axis is not a valid axis of a.
+
+
+';
+
+$result_errors{'api_doc_with_linemacro'} = [];
+
+
+$result_floats{'api_doc_with_linemacro'} = {};
+
+
+1;
diff --git a/tp/t/results/linemacro/braces_after_text.pl
b/tp/t/results/linemacro/braces_after_text.pl
new file mode 100644
index 0000000000..abc3f71c17
--- /dev/null
+++ b/tp/t/results/linemacro/braces_after_text.pl
@@ -0,0 +1,249 @@
+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{'braces_after_text'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'mymacro',
+ 'type' => 'macro_name'
+ },
+ {
+ 'text' => 'a',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'b',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'c',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'linemacro',
+ 'contents' => [
+ {
+ 'text' => 'expand \\a\\ \\b\\ \\c\\
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'linemacro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'linemacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' mymacro {a, b, c}
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'text'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'in paren'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'rest'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'in paren'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'type' => 'bracketed_arg'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'mymacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'position' => 35,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'text' => 'expand text in paren restin paren
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'braces_after_text'} = '@linemacro mymacro {a, b, c}
+expand \\a\\ \\b\\ \\c\\
+@end linemacro
+
+expand text in paren restin paren
+';
+
+
+$result_texts{'braces_after_text'} = '
+expand text in paren restin paren
+';
+
+$result_errors{'braces_after_text'} = [
+ {
+ 'error_line' => 'misplaced { (possibly involving @mymacro)
+',
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => 'mymacro',
+ 'text' => 'misplaced {',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => 'misplaced } (possibly involving @mymacro)
+',
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => 'mymacro',
+ 'text' => 'misplaced }',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => 'misplaced { (possibly involving @mymacro)
+',
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => 'mymacro',
+ 'text' => 'misplaced {',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => 'misplaced } (possibly involving @mymacro)
+',
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => 'mymacro',
+ 'text' => 'misplaced }',
+ 'type' => 'error'
+ }
+];
+
+
+$result_floats{'braces_after_text'} = {};
+
+
+1;
diff --git a/tp/t/results/linemacro/empty_last_argument.pl
b/tp/t/results/linemacro/empty_last_argument.pl
new file mode 100644
index 0000000000..3ce39c3ab8
--- /dev/null
+++ b/tp/t/results/linemacro/empty_last_argument.pl
@@ -0,0 +1,798 @@
+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{'empty_last_argument'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'BI'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defcodeindex',
+ 'extra' => {
+ 'misc_args' => [
+ 'BI'
+ ]
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'text' => 'defbuiltin',
+ 'type' => 'macro_name'
+ },
+ {
+ 'text' => 'symbol',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'rest',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'linemacro',
+ 'contents' => [
+ {
+ 'text' => '@BIindex \\symbol\\
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '@defline Builtin \\symbol\\ \\rest\\
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'linemacro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'linemacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' defbuiltin {symbol, rest}
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'defblock',
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'foo'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'type' => 'bracketed_arg'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'defbuiltin'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'foo'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'BIindex',
+ 'extra' => {
+ 'index_entry' => [
+ 'BI',
+ 1
+ ]
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'index_entry_command'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'Builtin'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'foo'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => 'defbuiltin'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 2,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'foo'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'defbuiltin'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'foo'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'BIindex',
+ 'extra' => {
+ 'index_entry' => [
+ 'BI',
+ 2
+ ]
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'index_entry_command'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'Builtin'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'foo'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => 'defbuiltin'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 2,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 3,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'foo'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '{}'
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 12,
+ 'macro' => ''
+ },
+ 'type' => 'balanced_braces'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'defbuiltin'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 12,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'foo'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'BIindex',
+ 'extra' => {
+ 'index_entry' => [
+ 'BI',
+ 3
+ ]
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 12,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'index_entry_command'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'Builtin'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'foo'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 12,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'bracketed_arg'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 12,
+ 'macro' => 'defbuiltin'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 3,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'type' => 'def_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'defblock'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'defblock'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 13,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'empty_last_argument'}{'contents'}[0]{'contents'}[3]{'contents'}[1]{'extra'}{'def_index_element'}
=
$result_trees{'empty_last_argument'}{'contents'}[0]{'contents'}[3]{'contents'}[1]{'args'}[0]{'contents'}[2];
+$result_trees{'empty_last_argument'}{'contents'}[0]{'contents'}[3]{'contents'}[3]{'extra'}{'def_index_element'}
=
$result_trees{'empty_last_argument'}{'contents'}[0]{'contents'}[3]{'contents'}[3]{'args'}[0]{'contents'}[2];
+$result_trees{'empty_last_argument'}{'contents'}[0]{'contents'}[3]{'contents'}[5]{'extra'}{'def_index_element'}
=
$result_trees{'empty_last_argument'}{'contents'}[0]{'contents'}[3]{'contents'}[5]{'args'}[0]{'contents'}[2];
+
+$result_texis{'empty_last_argument'} = '@defcodeindex BI
+@linemacro defbuiltin {symbol, rest}
+@BIindex \\symbol\\
+@defline Builtin \\symbol\\ \\rest\\
+@end linemacro
+
+@defblock
+@BIindex foo
+@defline Builtin foo
+
+@BIindex foo
+@defline Builtin foo
+
+@BIindex foo
+@defline Builtin foo {}
+@end defblock
+';
+
+
+$result_texts{'empty_last_argument'} = '
+Builtin: foo
+
+Builtin: foo
+
+Builtin: foo
+';
+
+$result_errors{'empty_last_argument'} = [
+ {
+ 'error_line' => 'warning: entry for index `BI\' outside of any node
(possibly involving @defbuiltin)
+',
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => 'defbuiltin',
+ 'text' => 'entry for index `BI\' outside of any node',
+ 'type' => 'warning'
+ },
+ {
+ 'error_line' => 'warning: entry for index `BI\' outside of any node
(possibly involving @defbuiltin)
+',
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => 'defbuiltin',
+ 'text' => 'entry for index `BI\' outside of any node',
+ 'type' => 'warning'
+ },
+ {
+ 'error_line' => 'warning: entry for index `BI\' outside of any node
(possibly involving @defbuiltin)
+',
+ 'file_name' => '',
+ 'line_nr' => 12,
+ 'macro' => 'defbuiltin',
+ 'text' => 'entry for index `BI\' outside of any node',
+ 'type' => 'warning'
+ }
+];
+
+
+$result_indices{'empty_last_argument'} = {
+ 'index_names' => {
+ 'BI' => {
+ 'contained_indices' => {
+ 'BI' => 1
+ },
+ 'in_code' => 1,
+ 'name' => 'BI'
+ },
+ 'cp' => {
+ 'contained_indices' => {
+ 'cp' => 1
+ },
+ 'in_code' => 0,
+ 'name' => 'cp'
+ },
+ 'fn' => {
+ 'contained_indices' => {
+ 'fn' => 1
+ },
+ 'in_code' => 1,
+ 'name' => 'fn'
+ },
+ 'ky' => {
+ 'contained_indices' => {
+ 'ky' => 1
+ },
+ 'in_code' => 1,
+ 'name' => 'ky'
+ },
+ 'pg' => {
+ 'contained_indices' => {
+ 'pg' => 1
+ },
+ 'in_code' => 1,
+ 'name' => 'pg'
+ },
+ 'tp' => {
+ 'contained_indices' => {
+ 'tp' => 1
+ },
+ 'in_code' => 1,
+ 'name' => 'tp'
+ },
+ 'vr' => {
+ 'contained_indices' => {
+ 'vr' => 1
+ },
+ 'in_code' => 1,
+ 'name' => 'vr'
+ }
+ }
+};
+
+
+$result_floats{'empty_last_argument'} = {};
+
+
+$result_indices_sort_strings{'empty_last_argument'} = {
+ 'BI' => [
+ 'foo',
+ 'foo',
+ 'foo'
+ ]
+};
+
+
+1;
diff --git a/tp/t/results/linemacro/last_argument_with_braces.pl
b/tp/t/results/linemacro/last_argument_with_braces.pl
new file mode 100644
index 0000000000..0e8295d238
--- /dev/null
+++ b/tp/t/results/linemacro/last_argument_with_braces.pl
@@ -0,0 +1,1115 @@
+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{'last_argument_with_braces'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'defbuiltin',
+ 'type' => 'macro_name'
+ },
+ {
+ 'text' => 'symbol',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'rest',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'linemacro',
+ 'contents' => [
+ {
+ 'text' => '@defline \\symbol\\ f r
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '@defline expand Builtin and \\rest\\
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'linemacro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'linemacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' defbuiltin {symbol, rest}
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'defblock',
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'my foo'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'a'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'last'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'ument'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'defbuiltin'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'my'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'foo'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'f'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'r'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'def_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'expand'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'Builtin'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'and'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'a'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'last'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'ument'
+ }
+ ],
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'bracketed_arg'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'defbuiltin'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 2,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'my foo'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'type' => 'bracketed_arg'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'defbuiltin'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'my'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'foo'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'f'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'r'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'def_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'expand'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'Builtin'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'and'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'bracketed_arg'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => 'defbuiltin'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 2,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 3,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'my foo'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'second arg'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'remaining'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'on'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'line'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'defbuiltin'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'my'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'foo'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'f'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'r'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'def_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'expand'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'Builtin'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'and'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'second arg'
+ }
+ ],
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'remaining'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'on'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'line'
+ }
+ ],
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => 'defbuiltin'
+ },
+ 'type' => 'bracketed_arg'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => 'defbuiltin'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 3,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'type' => 'def_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'defblock'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'defblock'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 12,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 6,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'last_argument_with_braces'}{'contents'}[0]{'contents'}[2]{'contents'}[1]{'extra'}{'def_index_element'}
=
$result_trees{'last_argument_with_braces'}{'contents'}[0]{'contents'}[2]{'contents'}[1]{'args'}[0]{'contents'}[2];
+$result_trees{'last_argument_with_braces'}{'contents'}[0]{'contents'}[2]{'contents'}[2]{'extra'}{'def_index_element'}
=
$result_trees{'last_argument_with_braces'}{'contents'}[0]{'contents'}[2]{'contents'}[2]{'args'}[0]{'contents'}[2];
+$result_trees{'last_argument_with_braces'}{'contents'}[0]{'contents'}[2]{'contents'}[4]{'extra'}{'def_index_element'}
=
$result_trees{'last_argument_with_braces'}{'contents'}[0]{'contents'}[2]{'contents'}[4]{'args'}[0]{'contents'}[2];
+$result_trees{'last_argument_with_braces'}{'contents'}[0]{'contents'}[2]{'contents'}[5]{'extra'}{'def_index_element'}
=
$result_trees{'last_argument_with_braces'}{'contents'}[0]{'contents'}[2]{'contents'}[5]{'args'}[0]{'contents'}[2];
+$result_trees{'last_argument_with_braces'}{'contents'}[0]{'contents'}[2]{'contents'}[7]{'extra'}{'def_index_element'}
=
$result_trees{'last_argument_with_braces'}{'contents'}[0]{'contents'}[2]{'contents'}[7]{'args'}[0]{'contents'}[2];
+$result_trees{'last_argument_with_braces'}{'contents'}[0]{'contents'}[2]{'contents'}[8]{'extra'}{'def_index_element'}
=
$result_trees{'last_argument_with_braces'}{'contents'}[0]{'contents'}[2]{'contents'}[8]{'args'}[0]{'contents'}[2];
+
+$result_texis{'last_argument_with_braces'} = '@linemacro defbuiltin {symbol,
rest}
+@defline \\symbol\\ f r
+@defline expand Builtin and \\rest\\
+@end linemacro
+
+@defblock
+@defline my foo f r
+@defline expand Builtin and a last {} arg{ument}
+
+@defline my foo f r
+@defline expand Builtin and {} {}
+
+@defline my foo f r
+@defline expand Builtin and {second arg} remaining on {line}
+@end defblock
+';
+
+
+$result_texts{'last_argument_with_braces'} = '
+my: foo f r
+expand: Builtin and a last argument
+
+my: foo f r
+expand: Builtin and
+
+my: foo f r
+expand: Builtin and second arg remaining on line
+';
+
+$result_errors{'last_argument_with_braces'} = [];
+
+
+$result_floats{'last_argument_with_braces'} = {};
+
+
+1;
diff --git a/tp/t/results/linemacro/newline_and_continuation_in_brace.pl
b/tp/t/results/linemacro/newline_and_continuation_in_brace.pl
new file mode 100644
index 0000000000..1f57b62963
--- /dev/null
+++ b/tp/t/results/linemacro/newline_and_continuation_in_brace.pl
@@ -0,0 +1,480 @@
+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{'newline_and_continuation_in_brace'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'text' => 'mylinecommand',
+ 'type' => 'macro_name'
+ },
+ {
+ 'text' => 'first',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'second',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'rest',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'linemacro',
+ 'contents' => [
+ {
+ 'text' => '@defline category \\first\\ \\second\\ \\rest\\
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'linemacro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'linemacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' mylinecommand {first, second, rest}
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'defblock',
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'a'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'b c'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => 'd'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'some arg '
+ },
+ {
+ 'cmdname' => '
+'
+ },
+ {
+ 'text' => ' b'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'next '
+ },
+ {
+ 'cmdname' => '
+'
+ },
+ {
+ 'text' => ' last'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'line'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'mylinecommand'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'category'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'a'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'b c'
+ }
+ ],
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => 'mylinecommand'
+ }
+ },
+ {
+ 'text' => 'd'
+ }
+ ],
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'type' => 'def_aggregate'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'some'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'position' => 1,
+ 'sourcemark_type' => 'defline_continuation'
+ }
+ ],
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'b'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 2,
+ 'position' => 5,
+ 'sourcemark_type' => 'defline_continuation'
+ }
+ ],
+ 'text' => 'next last'
+ }
+ ],
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => 'mylinecommand'
+ },
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'line'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => 'mylinecommand'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'type' => 'def_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'defblock'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'defblock'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 6,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'newline_and_continuation_in_brace'}{'contents'}[0]{'contents'}[3]{'contents'}[1]{'extra'}{'def_index_element'}
=
$result_trees{'newline_and_continuation_in_brace'}{'contents'}[0]{'contents'}[3]{'contents'}[1]{'args'}[0]{'contents'}[2];
+
+$result_texis{'newline_and_continuation_in_brace'} = '
+@linemacro mylinecommand {first, second, rest}
+@defline category \\first\\ \\second\\ \\rest\\
+@end linemacro
+
+@defblock
+@defline category a@code{b c}d some arg b {next last} line
+@end defblock
+';
+
+
+$result_texts{'newline_and_continuation_in_brace'} = '
+
+category: ab cd some arg b next last line
+';
+
+$result_errors{'newline_and_continuation_in_brace'} = [];
+
+
+$result_floats{'newline_and_continuation_in_brace'} = {};
+
+
+1;
diff --git a/tp/t/results/linemacro/protected_spaces_on_line.pl
b/tp/t/results/linemacro/protected_spaces_on_line.pl
new file mode 100644
index 0000000000..1b623cc22c
--- /dev/null
+++ b/tp/t/results/linemacro/protected_spaces_on_line.pl
@@ -0,0 +1,1056 @@
+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{'protected_spaces_on_line'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'test',
+ 'type' => 'macro_name'
+ },
+ {
+ 'text' => 'first',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'rest',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'linemacro',
+ 'contents' => [
+ {
+ 'text' => '@deffn Function \\first\\ \\rest\\
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => 'something
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '@end deffn
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'linemacro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'linemacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' test {first, rest}
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'foo'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => '(bar,'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'baz)'
+ },
+ {
+ 'cmdname' => '
+'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'continuation'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'line'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'test'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'deffn',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'Function'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'foo'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => '(',
+ 'type' => 'delimiter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'bar'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => ',',
+ 'type' => 'delimiter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'baz'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'position' => 1,
+ 'sourcemark_type' => 'defline_continuation'
+ }
+ ],
+ 'text' => ')',
+ 'type' => 'delimiter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'continuation'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'line'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'extra' => {
+ 'def_command' => 'deffn',
+ 'def_index_element' => {},
+ 'index_entry' => [
+ 'fn',
+ 1
+ ],
+ 'original_def_cmdname' => 'deffn'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => 'test'
+ },
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'something
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'deffn'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'deffn'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => 'test'
+ }
+ }
+ ],
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => 'test'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ]
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 2,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'foo'
+ },
+ {
+ 'cmdname' => ' '
+ },
+ {
+ 'text' => 'b'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => '(bar,'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'baz)'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'rest'
+ },
+ {
+ 'cmdname' => ' '
+ },
+ {
+ 'text' => 'and'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'more'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'test'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'deffn',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'Function'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'foo'
+ },
+ {
+ 'cmdname' => ' '
+ },
+ {
+ 'text' => 'b'
+ }
+ ],
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'type' => 'def_aggregate'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => '(',
+ 'type' => 'delimiter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'bar'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => ',',
+ 'type' => 'delimiter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'baz'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => ')',
+ 'type' => 'delimiter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'rest'
+ },
+ {
+ 'cmdname' => ' ',
+ 'extra' => {
+ 'def_role' => 'arg'
+ }
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'and'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'more'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'extra' => {
+ 'def_command' => 'deffn',
+ 'def_index_element' => {},
+ 'index_entry' => [
+ 'fn',
+ 2
+ ],
+ 'original_def_cmdname' => 'deffn'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => 'test'
+ },
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'something
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'deffn'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'deffn'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => 'test'
+ }
+ }
+ ],
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => 'test'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 2,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ]
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 3,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'foo'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => '(bar,'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'baz)'
+ },
+ {
+ 'cmdname' => '@'
+ }
+ ],
+ 'type' => 'def_aggregate'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'test'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 12,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'deffn',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'Function'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'foo'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => '(',
+ 'type' => 'delimiter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'bar'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => ',',
+ 'type' => 'delimiter'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'baz'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'delimiter'
+ },
+ 'text' => ')',
+ 'type' => 'delimiter'
+ },
+ {
+ 'cmdname' => '@',
+ 'extra' => {
+ 'def_role' => 'arg'
+ }
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'extra' => {
+ 'def_command' => 'deffn',
+ 'def_index_element' => {},
+ 'index_entry' => [
+ 'fn',
+ 3
+ ],
+ 'original_def_cmdname' => 'deffn'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 12,
+ 'macro' => 'test'
+ },
+ 'type' => 'def_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'something
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'def_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'deffn'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'deffn'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 12,
+ 'macro' => 'test'
+ }
+ }
+ ],
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 12,
+ 'macro' => 'test'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 3,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ]
+ },
+ {
+ 'text' => ' ',
+ 'type' => 'spaces_before_paragraph'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'another with double at
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'protected_spaces_on_line'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'extra'}{'def_index_element'}
=
$result_trees{'protected_spaces_on_line'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'args'}[0]{'contents'}[2];
+$result_trees{'protected_spaces_on_line'}{'contents'}[0]{'contents'}[6]{'contents'}[0]{'extra'}{'def_index_element'}
=
$result_trees{'protected_spaces_on_line'}{'contents'}[0]{'contents'}[6]{'contents'}[0]{'args'}[0]{'contents'}[2];
+$result_trees{'protected_spaces_on_line'}{'contents'}[0]{'contents'}[9]{'contents'}[0]{'extra'}{'def_index_element'}
=
$result_trees{'protected_spaces_on_line'}{'contents'}[0]{'contents'}[9]{'contents'}[0]{'args'}[0]{'contents'}[2];
+
+$result_texis{'protected_spaces_on_line'} = '@linemacro test {first, rest}
+@deffn Function \\first\\ \\rest\\
+something
+@end deffn
+@end linemacro
+
+@deffn Function foo (bar, baz) continuation line
+something
+@end deffn
+
+@deffn Function foo@ b (bar, baz) rest@ and more
+something
+@end deffn
+
+@deffn Function foo (bar, baz)@@
+something
+@end deffn
+ another with double at
+
+';
+
+
+$result_texts{'protected_spaces_on_line'} = '
+Function: foo (bar, baz) continuation line
+something
+
+Function: foo b (bar, baz) rest and more
+something
+
+Function: foo (bar, baz)@
+something
+another with double at
+
+';
+
+$result_errors{'protected_spaces_on_line'} = [
+ {
+ 'error_line' => 'warning: entry for index `fn\' outside of any node
(possibly involving @test)
+',
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => 'test',
+ 'text' => 'entry for index `fn\' outside of any node',
+ 'type' => 'warning'
+ },
+ {
+ 'error_line' => 'warning: entry for index `fn\' outside of any node
(possibly involving @test)
+',
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => 'test',
+ 'text' => 'entry for index `fn\' outside of any node',
+ 'type' => 'warning'
+ },
+ {
+ 'error_line' => 'warning: entry for index `fn\' outside of any node
(possibly involving @test)
+',
+ 'file_name' => '',
+ 'line_nr' => 12,
+ 'macro' => 'test',
+ 'text' => 'entry for index `fn\' outside of any node',
+ 'type' => 'warning'
+ }
+];
+
+
+$result_floats{'protected_spaces_on_line'} = {};
+
+
+$result_indices_sort_strings{'protected_spaces_on_line'} = {
+ 'fn' => [
+ 'foo',
+ 'foo',
+ 'foo b'
+ ]
+};
+
+
+1;
diff --git a/tp/t/results/linemacro/spaces_after_command_in_call.pl
b/tp/t/results/linemacro/spaces_after_command_in_call.pl
new file mode 100644
index 0000000000..dfa239004f
--- /dev/null
+++ b/tp/t/results/linemacro/spaces_after_command_in_call.pl
@@ -0,0 +1,407 @@
+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{'spaces_after_command_in_call'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'mylinecommand',
+ 'type' => 'macro_name'
+ },
+ {
+ 'text' => 'first',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'second',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'rest',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'linemacro',
+ 'contents' => [
+ {
+ 'text' => '@defblock
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '@defline category \\first\\ A \\second\\ B \\rest\\
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '@end defblock
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'linemacro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'linemacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' mylinecommand {first, second, rest}
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'd'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'b'
+ }
+ ],
+ 'type' => 'following_arg'
+ }
+ ],
+ 'cmdname' => 'ringaccent',
+ 'info' => {
+ 'spaces_after_cmd_before_arg' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ }
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'rest'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'mylinecommand'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'defblock',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'category'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'd'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'A'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'b'
+ }
+ ],
+ 'type' => 'following_arg'
+ }
+ ],
+ 'cmdname' => 'ringaccent',
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'info' => {
+ 'spaces_after_cmd_before_arg' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'mylinecommand'
+ }
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'B'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'rest'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'mylinecommand'
+ },
+ 'type' => 'def_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'defblock'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'defblock'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'mylinecommand'
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'mylinecommand'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ]
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'spaces_after_command_in_call'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'extra'}{'def_index_element'}
=
$result_trees{'spaces_after_command_in_call'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'args'}[0]{'contents'}[2];
+
+$result_texis{'spaces_after_command_in_call'} = '@linemacro mylinecommand
{first, second, rest}
+@defblock
+@defline category \\first\\ A \\second\\ B \\rest\\
+@end defblock
+@end linemacro
+
+@defblock
+@defline category d A @ringaccent b B rest
+@end defblock
+';
+
+
+$result_texts{'spaces_after_command_in_call'} = '
+category: d A b* B rest
+';
+
+$result_errors{'spaces_after_command_in_call'} = [
+ {
+ 'error_line' => 'unknown command `abc\'
+',
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => '',
+ 'text' => 'unknown command `abc\'',
+ 'type' => 'error'
+ }
+];
+
+
+$result_floats{'spaces_after_command_in_call'} = {};
+
+
+1;
diff --git a/tp/t/results/linemacro/spaces_in_args.pl
b/tp/t/results/linemacro/spaces_in_args.pl
new file mode 100644
index 0000000000..85ce8a04e2
--- /dev/null
+++ b/tp/t/results/linemacro/spaces_in_args.pl
@@ -0,0 +1,388 @@
+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{'spaces_in_args'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'mylinecommand',
+ 'type' => 'macro_name'
+ },
+ {
+ 'text' => 'first',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'second',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'rest',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'linemacro',
+ 'contents' => [
+ {
+ 'text' => '@defblock
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '@defline category \\first\\ A \\second\\ B \\rest\\
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '@end defblock
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'linemacro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'linemacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' mylinecommand {first, second, rest}
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'a'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => ' '
+ },
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'd'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => ' '
+ },
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'rest'
+ }
+ ],
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'type' => 'bracketed_arg'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'mylinecommand'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'defblock',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'category'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'a'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'A'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'd'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'B'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'rest'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'mylinecommand'
+ },
+ 'type' => 'def_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'defblock'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'defblock'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'mylinecommand'
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'mylinecommand'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ]
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'spaces_in_args'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'extra'}{'def_index_element'}
=
$result_trees{'spaces_in_args'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'args'}[0]{'contents'}[2];
+
+$result_texis{'spaces_in_args'} = '@linemacro mylinecommand {first, second,
rest}
+@defblock
+@defline category \\first\\ A \\second\\ B \\rest\\
+@end defblock
+@end linemacro
+
+@defblock
+@defline category a A d B rest
+@end defblock
+';
+
+
+$result_texts{'spaces_in_args'} = '
+category: a A d B rest
+';
+
+$result_errors{'spaces_in_args'} = [];
+
+
+$result_floats{'spaces_in_args'} = {};
+
+
+1;
diff --git a/tp/t/results/linemacro/spaces_in_call.pl
b/tp/t/results/linemacro/spaces_in_call.pl
new file mode 100644
index 0000000000..21cd032c0b
--- /dev/null
+++ b/tp/t/results/linemacro/spaces_in_call.pl
@@ -0,0 +1,374 @@
+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{'spaces_in_call'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'mylinecommand',
+ 'type' => 'macro_name'
+ },
+ {
+ 'text' => 'first',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'second',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'rest',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'linemacro',
+ 'contents' => [
+ {
+ 'text' => '@defblock
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '@defline category \\first\\ A \\second\\ B \\rest\\
+',
+ 'type' => 'raw'
+ },
+ {
+ 'text' => '@end defblock
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'linemacro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'linemacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' mylinecommand {first, second, rest}
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'a b'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'c d'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'rest'
+ }
+ ],
+ 'type' => 'bracketed_arg'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'mylinecommand'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'defblock',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'def_role' => 'category'
+ },
+ 'text' => 'category'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'name'
+ },
+ 'text' => 'a'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'b'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'A'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'c'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'd'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'B'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'arg'
+ },
+ 'text' => 'rest'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'defline',
+ 'extra' => {
+ 'def_command' => 'defline',
+ 'def_index_element' => {},
+ 'original_def_cmdname' => 'defline'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'mylinecommand'
+ },
+ 'type' => 'def_line'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'defblock'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'defblock'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'mylinecommand'
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => 'mylinecommand'
+ },
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ]
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'spaces_in_call'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'extra'}{'def_index_element'}
=
$result_trees{'spaces_in_call'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'args'}[0]{'contents'}[2];
+
+$result_texis{'spaces_in_call'} = '@linemacro mylinecommand {first, second,
rest}
+@defblock
+@defline category \\first\\ A \\second\\ B \\rest\\
+@end defblock
+@end linemacro
+
+@defblock
+@defline category a b A c d B rest
+@end defblock
+';
+
+
+$result_texts{'spaces_in_call'} = '
+category: a b A c d B rest
+';
+
+$result_errors{'spaces_in_call'} = [];
+
+
+$result_floats{'spaces_in_call'} = {};
+
+
+1;
diff --git a/tp/t/results/linemacro/text_arguments.pl
b/tp/t/results/linemacro/text_arguments.pl
new file mode 100644
index 0000000000..ebecd5b225
--- /dev/null
+++ b/tp/t/results/linemacro/text_arguments.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{'text_arguments'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'text' => 'nospace',
+ 'type' => 'macro_name'
+ },
+ {
+ 'text' => 'one',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'two',
+ 'type' => 'macro_arg'
+ },
+ {
+ 'text' => 'three',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'linemacro',
+ 'contents' => [
+ {
+ 'text' => '\\three\\@bullet{}\\two\\@minus{}\\one\\
+',
+ 'type' => 'raw'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'linemacro'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'linemacro'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'info' => {
+ 'arg_line' => ' nospace{one, two, three}
+'
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'element' => {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'X'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'Y'
+ },
+ {
+ 'extra' => {
+ 'def_role' => 'spaces'
+ },
+ 'text' => ' ',
+ 'type' => 'spaces'
+ },
+ {
+ 'text' => 'Z'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'extra' => {
+ 'name' => 'nospace'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ },
+ 'type' => 'linemacro_call'
+ },
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'start'
+ }
+ ],
+ 'text' => '',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'Z'
+ },
+ {
+ 'args' => [
+ {
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'bullet',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => 'nospace'
+ }
+ },
+ {
+ 'text' => 'Y'
+ },
+ {
+ 'args' => [
+ {
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'minus',
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => 'nospace'
+ }
+ },
+ {
+ 'source_marks' => [
+ {
+ 'counter' => 1,
+ 'position' => 2,
+ 'sourcemark_type' => 'linemacro_expansion',
+ 'status' => 'end'
+ }
+ ],
+ 'text' => 'X
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'text_arguments'} = '@linemacro nospace{one, two, three}
+\\three\\@bullet{}\\two\\@minus{}\\one\\
+@end linemacro
+
+Z@bullet{}Y@minus{}X
+';
+
+
+$result_texts{'text_arguments'} = '
+Z*Y-X
+';
+
+$result_errors{'text_arguments'} = [];
+
+
+$result_floats{'text_arguments'} = {};
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/t/65linemacro.t, tp/Makefile.tres: add tests of @linemacro.,
Patrice Dumas <=