[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp TODO Texinfo/Parser.pm t/02coverage....
From: |
Patrice Dumas |
Subject: |
texinfo/tp TODO Texinfo/Parser.pm t/02coverage.... |
Date: |
Sun, 10 Oct 2010 23:23:03 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 10/10/10 23:23:03
Modified files:
tp : TODO
tp/Texinfo : Parser.pm
tp/t : 02coverage.t 10menu.t 50value.t 60macro.t
Added files:
tp/t/results/coverage: table_command_comment.pl
tp/t/results/macro: macro_for_end.pl macro_in_end_argument.pl
tp/t/results/menu: bad_beginning.pl
tp/t/results/value: value_after_accent.pl
Log message:
Little cleanups.
Add FIXME for all the places that still need to be modified for playing
nice with user-defined macros.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.60&r2=1.61
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/02coverage.t?cvsroot=texinfo&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/10menu.t?cvsroot=texinfo&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/50value.t?cvsroot=texinfo&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/60macro.t?cvsroot=texinfo&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/coverage/table_command_comment.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/macro_for_end.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/macro_in_end_argument.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/menu/bad_beginning.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/value/value_after_accent.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- TODO 10 Oct 2010 19:03:16 -0000 1.9
+++ TODO 10 Oct 2010 23:23:02 -0000 1.10
@@ -13,6 +13,8 @@
test invalid, especially commands not closed/bad nesting
test root_commands, like nodes and sections
+Test for @columnfractions in a random place and something like
address@hidden aaa @columnfractions 0.3 0.7
parse @sp a bit more.
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -b -r1.60 -r1.61
--- Texinfo/Parser.pm 10 Oct 2010 18:48:13 -0000 1.60
+++ Texinfo/Parser.pm 10 Oct 2010 23:23:03 -0000 1.61
@@ -103,6 +103,7 @@
# file names
'setfilename' => {'arg' => 'line'},
'verbatiminclude'=> {'arg' => 'line'},
+ 'include'=> {'arg' => 'line'},
'raisesections' => {'skip' => 'line'}, # no arg
'lowersections' => {'skip' => 'line'}, # no arg
@@ -424,8 +425,8 @@
$begin_line_commands{$command} = $command;
}
-foreach my $no_paragraph_command ('unmacro', 'rmacro', 'titlefont', 'include',
- '*', 'caption', 'shortcaption', 'image') {
+foreach my $no_paragraph_command ('titlefont', 'caption', 'shortcaption',
+ 'image', '*') {
$default_no_paragraph_commands{$no_paragraph_command} = 1;
}
@@ -522,17 +523,22 @@
return $parser;
}
+# split a scalar text in an array lines.
sub _text_to_lines($)
{
my $text = shift;
die if (!defined($text));
- my $chomped = chomp($text);
+ my $had_final_end_line = chomp($text);
my $lines = [ map {$_."\n"} split (/\n/, $text, -1) ];
$lines = [''] if (address@hidden);
- chomp($lines->[-1]) unless ($chomped);
+ chomp($lines->[-1]) unless ($had_final_end_line);
return $lines;
}
+# construct a line numbers array matching a lines array, based on information
+# supplied.
+# If $fixed_line_number is set the line number is not increased, otherwise
+# it is increased, beginning at $first_line.
sub _complete_line_nr($$;$$$)
{
my $lines = shift;
@@ -540,23 +546,24 @@
my $file = shift;
my $macro = shift;
my $fixed_line_number = shift;
+
+ return if (!defined($first_line));
+
$macro = '' if (!defined($macro));
$file = '' if (!defined($file));
my $lines_nr;
my $line_index = $first_line;
- if (defined($first_line)) {
$lines_nr = [];
foreach my $index(0..scalar(@$lines)-1) {
$line_index = $index+$first_line if (!$fixed_line_number);
-
$lines_nr->[$index] = { 'line_nr' => $line_index,
'file_name' => $file, 'macro' => $macro };
}
- }
return $lines_nr;
}
+# The main entry point
sub parse_texi_text($$;$)
{
my $self = shift;
@@ -609,6 +616,7 @@
return "$cmd$type : $args $text $contents\n$parent_string";
}
+# format a line warning
sub _line_warn($$$)
{
my $parser = shift;
@@ -634,9 +642,7 @@
%{$line_number} };
}
-# if ($error_nrs >= $parser->{'error_limit'}) {
-# warn $parser->__("Too many errors! Gave up.\n")
-
+# format a line error
sub _line_error($$$)
{
my $parser = shift;
@@ -658,6 +664,7 @@
$parser->{'error_nrs'}++;
}
+# parse a macro line
sub _parse_macro_command($$$$$;$)
{
my $self = shift;
@@ -704,6 +711,7 @@
return $macro;
}
+# start a paragraph if in a context where paragraphs are to be started.
sub _begin_paragraph ($$)
{
my $self = shift;
@@ -736,6 +744,8 @@
return 0;
}
+# currently doesn't do much more than
+# return $_[0]->{'parent'}->{'parent'}
sub _close_brace_command($$$)
{
my $self = shift;
@@ -753,6 +763,8 @@
return $current;
}
+# close brace commands, that don't set a new context (ie @caption, @footnote)
+# and then the paragraph
sub _end_paragraph ($$$)
{
my $self = shift;
@@ -810,11 +822,12 @@
and exists
$context_brace_commands{$current->{'parent'}->{'cmdname'}}) {
$current = _close_brace_command($self, $current, $line_nr);
pop @{$self->{'context_stack'}};
- } else { # silently close containers and @-commands without @end
+ } else { # silently close containers and @-commands without brace nor @end
$current = $current->{'parent'};
}
- $current = _end_paragraph($self, $current, $line_nr);
+ # FIXME could there still be a paragraph to close?
+ #$current = _end_paragraph($self, $current, $line_nr);
}
if ($command and $current->{'cmdname'}
@@ -866,6 +879,7 @@
return $current;
}
+# return the parent if in a item_container command, itemize or enumerate
sub _item_container_parent($)
{
my $current = shift;
@@ -878,6 +892,7 @@
return undef;
}
+# return the parent if in a item_line command, @*table
sub _item_line_parent($)
{
my $current = shift;
@@ -893,6 +908,7 @@
return undef;
}
+# return the parent if in a multitable
sub _item_multitable_parent($)
{
my $current = shift;
@@ -909,6 +925,7 @@
return undef;
}
+# collect text and line numbers until an end of line is found.
sub _new_line ($$)
{
my $text = shift;
@@ -918,10 +935,6 @@
while (@$text) {
my $new_text = shift @$text;
- # This may happen with user defined macro, although it is unclear in
- # which case. Example in macro/expansion_order
- #next if ($new_text eq '');
- #die if ($new_text eq '');
$new_line .= $new_text;
$line_nr = shift @$lines_array;
@@ -1054,6 +1067,9 @@
return $result;
}
+# each time a new line appeared, a container is opened to hold the text
+# consisting only of spaces. This container is removed here, typically
+# this is called when non-space happens on a line.
sub _abort_empty_line($$;$)
{
my $self = shift;
@@ -1075,12 +1091,14 @@
return 0;
}
+# close constructs and do stuff at end of line (or end of the document)
sub _end_line($$$)
{
my $self = shift;
my $current = shift;
my $line_nr = shift;
+ # a line consisting only of spaces.
if ($current->{'contents'} and @{$current->{'contents'}}
and $current->{'contents'}->[-1]->{'type'}
and $current->{'contents'}->[-1]->{'type'} eq 'empty_line') {
@@ -1104,6 +1122,8 @@
'contents' => [] };
$current = $current->{'contents'}->[-1];
}
+
+ # end of a menu line.
} elsif ($current->{'type'}
and ($current->{'type'} eq 'menu_entry_name'
or $current->{'type'} eq 'menu_entry_node')) {
@@ -1164,14 +1184,14 @@
print STDERR "MENU ENTRY END LINE\n" if ($self->{'debug'});
$current = $current->{'parent'};
push @{$current->{'args'}}, { 'type' => 'menu_entry_description',
- 'contents' => [],
- 'parent' => $current };
+ 'contents' => [], 'parent' => $current };
$current = $current->{'args'}->[-1];
if (defined($end_comment)) {
$end_comment->{'parent'} = $current;
push @{$current->{'contents'}}, $end_comment;
}
}
+
# def line
} elsif ($current->{'parent'}
and $current->{'parent'}->{'type'}
@@ -1180,6 +1200,7 @@
die "BUG: def_context $def_context "._print_current($current)
if ($def_context ne 'def');
$current = $current->{'parent'}->{'parent'};
+
# other block command lines
} elsif ($current->{'type'}
and $current->{'type'} eq 'block_line_arg') {
@@ -1238,6 +1259,7 @@
'contents' => [], 'parent', $current };
$current = $current->{'contents'}->[-1];
}
+
# misc command line arguments
} elsif ($current->{'type'}
and $current->{'type'} eq 'misc_line_arg') {
@@ -1252,6 +1274,7 @@
$current->{'special'}->{'misc_args'} = $args if (defined($args));
}
$current = $current->{'parent'};
+ # columnfractions
if ($command eq 'columnfractions') {
# in a multitable, we are in a block_line_arg
if (!$current->{'parent'} or !$current->{'parent'}->{'cmdname'}
@@ -1271,6 +1294,8 @@
}
return $current;
}
+
+# the different types
#c 'menu_entry'
#c 'menu_entry'
# t 'menu_entry_leading_text'
@@ -1305,7 +1330,6 @@
my $no_para = shift;
my $root = { 'contents' => [] };
- $self->{'tree'} = $root;
my $current = $root;
$self->{'conditionals_stack'} = [];
@@ -1341,7 +1365,7 @@
# not def line
and $self->{'context_stack'}->[-1] ne 'def') {
print STDERR "BEGIN LINE\n" if ($self->{'debug'});
- $line =~ s/([ \t]*)//;
+ $line =~ s/([^\S\n]*)//;
push @{$current->{'contents'}}, { 'type' => 'empty_line',
'text' => $1,
'parent' => $current };
@@ -1354,7 +1378,7 @@
$block_commands{$current->{'cmdname'}} and
($block_commands{$current->{'cmdname'}} eq 'raw'
or $block_commands{$current->{'cmdname'}} eq 'conditional')) {
- # special case for macro that may be nested
+ # r?macro may be nested
if (($current->{'cmdname'} eq 'macro'
or $current->{'cmdname'} eq 'rmacro')
and $line =~ /address@hidden/) {
@@ -1365,6 +1389,7 @@
'special' => {'macro_line' => $line }};
$current = $current->{'contents'}->[-1];
last;
+ # ifclear/ifset may be nested
} elsif (($current->{'cmdname'} eq 'ifclear'
or $current->{'cmdname'} eq 'ifset')
and $line =~ /address@hidden>{'cmdname'}/) {
@@ -1401,6 +1426,12 @@
($line, $line_nr) = _new_line($text, $lines_array)
if (@$text);
}
+ # FIXME the following last is meant to have the end of line ignored
+ # if there are only spaces after a @end command.
+ # However if a user macro is being expanded, the text and the
+ # end of line following on the line may be in a different
+ # text unit. Moreover, user-defined macros may follow oon the
+ # line and lead to spaces only.
last unless ($line =~ /\S/);
} else {
push @{$current->{'contents'}},
@@ -1436,7 +1467,7 @@
}
# this mostly happens in the following cases:
- # after the expansion of a user defined macro
+ # after expansion of user defined macro that doesn't end with EOL
# after a protection of @\n in @def* line
while ($line eq '')
{
@@ -1446,11 +1477,13 @@
$line = shift @$text;
$line_nr = shift @$lines_array;
} else {
+ # end of the document
$current = _end_line($self, $current, $line_nr);
$current = _end_block_command($self, $current, $line_nr);
return $root;
}
}
+
# handle user defined macros before anything else since
# their expansion may lead to changes in the line
# REMACRO
@@ -1502,10 +1535,14 @@
$line_nr = shift @$new_lines_nr;
unshift @$text, @$expanded_lines;
unshift @$lines_array, @$new_lines_nr;
- # REMACRO
+
# Now handle all the cases that may lead to command closing
# or following character association with an @-command, especially
- # accent command.
+ # accent command, that is handle @-command with braces that don't
+ # always need a brace.
+
+ # The condition below is only caught right after command opening,
+ # otherwise we are in the 'args' and not right in the command container.
} elsif ($current->{'cmdname'} and
(defined($brace_commands{$current->{'cmdname'}}) or
$self->{'definfoenclose'}->{$current->{'cmdname'}})
@@ -1519,11 +1556,11 @@
delete $current->{'contents'};
$current->{'type'} = 'command_as_argument';
$current = $current->{'parent'};
+ # now accent commands
} elsif ($accent_commands{$current->{'cmdname'}}) {
- if ($line =~ /^\s/ and $line !~ /^\n/) {
+ if ($line =~ /^[^\S\n]/) {
if ($current->{'cmdname'} =~ /^[a-zA-Z]/) {
- # could also be \s+ but then it may swallow end of line
- $line =~ s/^\s//;
+ $line =~ s/^[^\S\n]+//;
} else {
_line_warn ($self, sprintf($self->
__("Accent command address@hidden' must not be followed by
whitespace"),
@@ -1559,7 +1596,7 @@
$current->{'cmdname'}), $line_nr);
$current = $current->{'parent'};
}
- # maybe a menu entry beginning
+ # maybe a menu entry beginning: a * at the beginning of a menu line
} elsif ($line =~ /^\*/ and $current->{'type'}
and ($current->{'type'} eq 'menu_comment'
or $current->{'type'} eq 'menu_entry_description')
@@ -1572,11 +1609,13 @@
$line =~ s/^\*//;
push @{$current->{'contents'}}, { 'type' => 'menu_star',
'text' => '*' };
+ # a space after a * at the beginning of a menu line
} elsif ($line =~ /^\s+/ and $current->{'contents'}
and @{$current->{'contents'}}
and $current->{'contents'}->[-1]->{'type'}
and $current->{'contents'}->[-1]->{'type'} eq 'menu_star') {
print STDERR "MENU ENTRY (certainly)\n" if ($self->{'debug'});
+ # this is the menu star collected previously
pop @{$current->{'contents'}};
$line =~ s/^(\s+)//;
my $leading_text = '*' . $1;
@@ -1657,7 +1696,6 @@
if (exists($self->{'aliases'}->{$command}));
print STDERR "COMMAND $command\n" if ($self->{'debug'});
-
if ($command eq 'value') {
if ($line =~ s/^{([\w\-]+)}//) {
my $value = $1;
@@ -1892,8 +1930,11 @@
'contents' => [] };
$current = $current->{'contents'}->[-1];
}
+ # FIXME ignore what is remaining on the line, to eat
+ # the end of line?
last;
} else {
+ # FIXME this won't work with macro expanded
$line =~ s/\s*//;
# the def command holds a line_def* which corresponds with the
# definition line. This allows to have a treatement similar
@@ -1937,6 +1978,7 @@
push @{$self->{'context_stack'}}, 'menu';
$current = $current->{'contents'}->[-1];
}
+ # FIXME still problematic with user defined macros
last unless ($line =~ /\S/);
}
}
@@ -2086,6 +2128,7 @@
return $root;
}
+# expand a tree to the corresponding texinfo.
sub tree_to_texi ($)
{
my $root = shift;
@@ -2124,6 +2167,7 @@
return $result;
}
+# expand a command argument as texinfo.
sub _expand_cmd_args_to_texi ($) {
my $cmd = shift;
my $cmdname = $cmd->{'cmdname'};
@@ -2217,7 +2261,8 @@
return $result;
}
-# return the line after preserving things according to misc_commands map.
+# parse special line @-commands, unmacro, set, clear, clickstyle.
+# Also remove spaces or ignore text, as specified in the misc_commands hash.
sub _parse_misc_command($$$$)
{
my $self = shift;
@@ -2236,7 +2281,6 @@
if (defined($self->{'misc_commands'}->{$command}->{'arg'}));
#print STDERR "HHHHHHHHH $line $command arg_spec $arg_spec skip_spec
$skip_spec\n";
-
if ($command eq 'set') {
# REVALUE
if ($line =~ /^\s+([\w\-]+)\s*(.*?)\s*$/) {
@@ -2284,7 +2328,7 @@
}
$line = '';
} elsif ($arg_spec) {
- $line =~ s/^[ \t]*// unless ($command eq 'c' or $command eq 'comment');
+ $line =~ s/^[^\S\n]*// unless ($command eq 'c' or $command eq 'comment');
#$args = [ $line ];
if ($arg_spec ne 'lineraw') {
$line_arg = $line;
@@ -2298,17 +2342,19 @@
if ($skip_spec eq 'line') {
$line = '';
}
+ # FIXME if there are user defined macros, some space may still be there.
elsif ($skip_spec eq 'whitespace') {
$line =~ s/^(\s*)//o;
}
elsif ($skip_spec eq 'space') {
- $line =~ s/^([ \t]*)//o;
+ $line =~ s/^([^\S\n]*)//o;
}
- # FIXME is the following useful?
- $line = '' if (!defined($line));
return ($line, $args, $line_arg, $special);
}
+# at the end of a @-command line with arguments, parse the resulting
+# text, to collect aliases, definfoenclose and collect errors on
+# wrong arguments.
sub _parse_line_command_args($$$)
{
my $self = shift;
@@ -2357,7 +2403,7 @@
return undef if (!defined($arg->{'contents'}->[0]->{'text'}));
my $line = $arg->{'contents'}->[0]->{'text'};
- $line =~ s/^[ \t]*//;
+ $line =~ s/^[^\S\n]*//;
if ($command eq 'alias') {
# REMACRO
Index: t/02coverage.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/02coverage.t,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- t/02coverage.t 4 Oct 2010 23:20:21 -0000 1.13
+++ t/02coverage.t 10 Oct 2010 23:23:03 -0000 1.14
@@ -71,6 +71,11 @@
@end vtable
'],
+['table_command_comment',
+'@table @address@hidden in comment
address@hidden item
address@hidden table'
+],
['multitable','
@multitable @columnfractions 6 7
@headitem mu--ltitable headitem @tab another tab
Index: t/10menu.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/10menu.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- t/10menu.t 27 Sep 2010 07:33:47 -0000 1.2
+++ t/10menu.t 10 Oct 2010 23:23:03 -0000 1.3
@@ -66,6 +66,14 @@
* a: (f)b3c.c, address@hidden c
@end menu
'],
+['bad_beginning',
+'@menu
+*
+*
+*something::
address@hidden code}::
address@hidden menu'
+]
);
our ($arg_test_case, $arg_generate, $arg_debug);
Index: t/50value.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/50value.t,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- t/50value.t 9 Oct 2010 11:21:29 -0000 1.6
+++ t/50value.t 10 Oct 2010 23:23:03 -0000 1.7
@@ -72,6 +72,11 @@
@node BarFoo, , @value{a--foo}, (dir)
@chapter bar
'],
+['value_after_accent',
+'@set a_letter a
address@hidden @value{a_letter}
address@hidden@value{a_letter}'
+],
['value_in_line_commands',
'@set cp cp
@set fn fn
Index: t/60macro.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/60macro.t,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- t/60macro.t 10 Oct 2010 18:53:06 -0000 1.16
+++ t/60macro.t 10 Oct 2010 23:23:03 -0000 1.17
@@ -200,6 +200,22 @@
@space{} text after space.
'],
+['macro_in_end_argument',
+'@macro a-cartouche
+cartouche
address@hidden macro
+
address@hidden
address@hidden @a-cartouche{}
+'],
+['macro_for_end',
+'@macro my-end
address@hidden
address@hidden macro
+
address@hidden
address@hidden cartouche
+'],
['macro_in_menu',
'
@macro star
Index: t/results/coverage/table_command_comment.pl
===================================================================
RCS file: t/results/coverage/table_command_comment.pl
diff -N t/results/coverage/table_command_comment.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/coverage/table_command_comment.pl 10 Oct 2010 23:23:03 -0000
1.1
@@ -0,0 +1,78 @@
+use vars qw(%result_texts %result_trees %result_errors);
+
+$result_trees{'table_command_comment'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'cmdname' => 'code',
+ 'parent' => {},
+ 'type' => 'command_as_argument'
+ },
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => ' in comment
+',
+ 'type' => 'misc_arg'
+ }
+ ],
+ 'cmdname' => 'c',
+ 'parent' => {}
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'table',
+ 'contents' => [
+ {
+ 'contents' => [],
+ 'parent' => {},
+ 'type' => 'before_item'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'item
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'item',
+ 'parent' => {}
+ }
+ ],
+ 'parent' => {},
+ 'remaining_args' => 0
+ }
+ ]
+};
+$result_trees{'table_command_comment'}{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'table_command_comment'}{'contents'}[0]{'args'}[0];
+$result_trees{'table_command_comment'}{'contents'}[0]{'args'}[0]{'contents'}[1]{'args'}[0]{'parent'}
=
$result_trees{'table_command_comment'}{'contents'}[0]{'args'}[0]{'contents'}[1];
+$result_trees{'table_command_comment'}{'contents'}[0]{'args'}[0]{'contents'}[1]{'parent'}
= $result_trees{'table_command_comment'}{'contents'}[0]{'args'}[0];
+$result_trees{'table_command_comment'}{'contents'}[0]{'args'}[0]{'parent'} =
$result_trees{'table_command_comment'}{'contents'}[0];
+$result_trees{'table_command_comment'}{'contents'}[0]{'contents'}[0]{'parent'}
= $result_trees{'table_command_comment'}{'contents'}[0];
+$result_trees{'table_command_comment'}{'contents'}[0]{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'table_command_comment'}{'contents'}[0]{'contents'}[1]{'args'}[0];
+$result_trees{'table_command_comment'}{'contents'}[0]{'contents'}[1]{'args'}[0]{'parent'}
= $result_trees{'table_command_comment'}{'contents'}[0]{'contents'}[1];
+$result_trees{'table_command_comment'}{'contents'}[0]{'contents'}[1]{'parent'}
= $result_trees{'table_command_comment'}{'contents'}[0];
+$result_trees{'table_command_comment'}{'contents'}[0]{'parent'} =
$result_trees{'table_command_comment'};
+
+$result_texts{'table_command_comment'} = '@table @address@hidden in comment
address@hidden item
address@hidden table
+';
+
+$result_errors{'table_command_comment'} = [];
+
+
Index: t/results/macro/macro_for_end.pl
===================================================================
RCS file: t/results/macro/macro_for_end.pl
diff -N t/results/macro/macro_for_end.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/macro/macro_for_end.pl 10 Oct 2010 23:23:03 -0000 1.1
@@ -0,0 +1,89 @@
+use vars qw(%result_texts %result_trees %result_errors);
+
+$result_trees{'macro_for_end'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 'my-end',
+ 'type' => 'macro_name'
+ }
+ ],
+ 'cmdname' => 'macro',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '@end
+',
+ 'type' => 'raw'
+ }
+ ],
+ 'parent' => {},
+ 'special' => {
+ 'macro_line' => ' my-end
+',
+ 'macrobody' => '@end
+'
+ }
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'cartouche',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => ' '
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'cartouche
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'parent' => {}
+ }
+ ]
+};
+$result_trees{'macro_for_end'}{'contents'}[0]{'args'}[0]{'parent'} =
$result_trees{'macro_for_end'}{'contents'}[0];
+$result_trees{'macro_for_end'}{'contents'}[0]{'contents'}[0]{'parent'} =
$result_trees{'macro_for_end'}{'contents'}[0];
+$result_trees{'macro_for_end'}{'contents'}[0]{'parent'} =
$result_trees{'macro_for_end'};
+$result_trees{'macro_for_end'}{'contents'}[1]{'parent'} =
$result_trees{'macro_for_end'};
+$result_trees{'macro_for_end'}{'contents'}[2]{'contents'}[0]{'parent'} =
$result_trees{'macro_for_end'}{'contents'}[2];
+$result_trees{'macro_for_end'}{'contents'}[2]{'contents'}[1]{'contents'}[0]{'parent'}
= $result_trees{'macro_for_end'}{'contents'}[2]{'contents'}[1];
+$result_trees{'macro_for_end'}{'contents'}[2]{'contents'}[1]{'parent'} =
$result_trees{'macro_for_end'}{'contents'}[2];
+$result_trees{'macro_for_end'}{'contents'}[2]{'parent'} =
$result_trees{'macro_for_end'};
+
+$result_texts{'macro_for_end'} = '@macro my-end
address@hidden
address@hidden macro
+
address@hidden
+ cartouche
address@hidden cartouche
+';
+
+$result_errors{'macro_for_end'} = [
+ {
+ 'error_line' => ':6: No matching address@hidden cartouche\'
+',
+ 'file_name' => '',
+ 'line_nr' => 6,
+ 'macro' => '',
+ 'text' => 'No matching address@hidden cartouche\'',
+ 'type' => 'error'
+ }
+];
+
+
Index: t/results/macro/macro_in_end_argument.pl
===================================================================
RCS file: t/results/macro/macro_in_end_argument.pl
diff -N t/results/macro/macro_in_end_argument.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/macro/macro_in_end_argument.pl 10 Oct 2010 23:23:03 -0000
1.1
@@ -0,0 +1,89 @@
+use vars qw(%result_texts %result_trees %result_errors);
+
+$result_trees{'macro_in_end_argument'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 'a-cartouche',
+ 'type' => 'macro_name'
+ }
+ ],
+ 'cmdname' => 'macro',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'cartouche
+',
+ 'type' => 'raw'
+ }
+ ],
+ 'parent' => {},
+ 'special' => {
+ 'macro_line' => ' a-cartouche
+',
+ 'macrobody' => 'cartouche
+'
+ }
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'cartouche',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => ' '
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'cartouche
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'parent' => {}
+ }
+ ]
+};
+$result_trees{'macro_in_end_argument'}{'contents'}[0]{'args'}[0]{'parent'} =
$result_trees{'macro_in_end_argument'}{'contents'}[0];
+$result_trees{'macro_in_end_argument'}{'contents'}[0]{'contents'}[0]{'parent'}
= $result_trees{'macro_in_end_argument'}{'contents'}[0];
+$result_trees{'macro_in_end_argument'}{'contents'}[0]{'parent'} =
$result_trees{'macro_in_end_argument'};
+$result_trees{'macro_in_end_argument'}{'contents'}[1]{'parent'} =
$result_trees{'macro_in_end_argument'};
+$result_trees{'macro_in_end_argument'}{'contents'}[2]{'contents'}[0]{'parent'}
= $result_trees{'macro_in_end_argument'}{'contents'}[2];
+$result_trees{'macro_in_end_argument'}{'contents'}[2]{'contents'}[1]{'contents'}[0]{'parent'}
= $result_trees{'macro_in_end_argument'}{'contents'}[2]{'contents'}[1];
+$result_trees{'macro_in_end_argument'}{'contents'}[2]{'contents'}[1]{'parent'}
= $result_trees{'macro_in_end_argument'}{'contents'}[2];
+$result_trees{'macro_in_end_argument'}{'contents'}[2]{'parent'} =
$result_trees{'macro_in_end_argument'};
+
+$result_texts{'macro_in_end_argument'} = '@macro a-cartouche
+cartouche
address@hidden macro
+
address@hidden
+ cartouche
address@hidden cartouche
+';
+
+$result_errors{'macro_in_end_argument'} = [
+ {
+ 'error_line' => ':6: No matching address@hidden cartouche\'
+',
+ 'file_name' => '',
+ 'line_nr' => 6,
+ 'macro' => '',
+ 'text' => 'No matching address@hidden cartouche\'',
+ 'type' => 'error'
+ }
+];
+
+
Index: t/results/menu/bad_beginning.pl
===================================================================
RCS file: t/results/menu/bad_beginning.pl
diff -N t/results/menu/bad_beginning.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/menu/bad_beginning.pl 10 Oct 2010 23:23:03 -0000 1.1
@@ -0,0 +1,78 @@
+use vars qw(%result_texts %result_trees %result_errors);
+
+$result_trees{'bad_beginning'} = {
+ 'contents' => [
+ {
+ 'cmdname' => 'menu',
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '*
+'
+ },
+ {
+ 'parent' => {},
+ 'text' => '*
+'
+ },
+ {
+ 'text' => '*something::
+'
+ },
+ {
+ 'text' => '*'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'in code'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'code',
+ 'contents' => [],
+ 'parent' => {},
+ 'remaining_args' => 0
+ },
+ {
+ 'parent' => {},
+ 'text' => '::
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'menu_comment'
+ }
+ ],
+ 'parent' => {}
+ }
+ ]
+};
+$result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0]{'contents'}[0]{'parent'}
= $result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0];
+$result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0]{'contents'}[1]{'parent'}
= $result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0];
+$result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0]{'contents'}[4]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0]{'contents'}[4]{'args'}[0];
+$result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0]{'contents'}[4]{'args'}[0]{'parent'}
= $result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0]{'contents'}[4];
+$result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0]{'contents'}[4]{'parent'}
= $result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0];
+$result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0]{'contents'}[5]{'parent'}
= $result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0];
+$result_trees{'bad_beginning'}{'contents'}[0]{'contents'}[0]{'parent'} =
$result_trees{'bad_beginning'}{'contents'}[0];
+$result_trees{'bad_beginning'}{'contents'}[0]{'parent'} =
$result_trees{'bad_beginning'};
+
+$result_texts{'bad_beginning'} = '@menu
+*
+*
+*something::
address@hidden code}::
address@hidden menu
+';
+
+$result_errors{'bad_beginning'} = [];
+
+
Index: t/results/value/value_after_accent.pl
===================================================================
RCS file: t/results/value/value_after_accent.pl
diff -N t/results/value/value_after_accent.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/value/value_after_accent.pl 10 Oct 2010 23:23:03 -0000
1.1
@@ -0,0 +1,82 @@
+use vars qw(%result_texts %result_trees %result_errors);
+
+$result_trees{'value_after_accent'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 'a_letter',
+ 'type' => 'misc_arg'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'a',
+ 'type' => 'misc_arg'
+ }
+ ],
+ 'cmdname' => 'set',
+ 'parent' => {}
+ },
+ {
+ 'contents' => [
+ {
+ 'cmdname' => 'ringaccent',
+ 'contents' => [],
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => 'a
+'
+ },
+ {
+ 'cmdname' => '~',
+ 'contents' => [],
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => 'a'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ]
+};
+$result_trees{'value_after_accent'}{'contents'}[0]{'args'}[0]{'parent'} =
$result_trees{'value_after_accent'}{'contents'}[0];
+$result_trees{'value_after_accent'}{'contents'}[0]{'args'}[1]{'parent'} =
$result_trees{'value_after_accent'}{'contents'}[0];
+$result_trees{'value_after_accent'}{'contents'}[0]{'parent'} =
$result_trees{'value_after_accent'};
+$result_trees{'value_after_accent'}{'contents'}[1]{'contents'}[0]{'parent'} =
$result_trees{'value_after_accent'}{'contents'}[1];
+$result_trees{'value_after_accent'}{'contents'}[1]{'contents'}[1]{'parent'} =
$result_trees{'value_after_accent'}{'contents'}[1];
+$result_trees{'value_after_accent'}{'contents'}[1]{'contents'}[2]{'parent'} =
$result_trees{'value_after_accent'}{'contents'}[1];
+$result_trees{'value_after_accent'}{'contents'}[1]{'contents'}[3]{'parent'} =
$result_trees{'value_after_accent'}{'contents'}[1];
+$result_trees{'value_after_accent'}{'contents'}[1]{'parent'} =
$result_trees{'value_after_accent'};
+
+$result_texts{'value_after_accent'} = '@set a_letter a
address@hidden
address@hidden';
+
+$result_errors{'value_after_accent'} = [
+ {
+ 'error_line' => ':2: Use braces to give a command as an argument to
@ringaccent
+',
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => '',
+ 'text' => 'Use braces to give a command as an argument to @ringaccent',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => ':3: Use braces to give a command as an argument to @~
+',
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => '',
+ 'text' => 'Use braces to give a command as an argument to @~',
+ 'type' => 'error'
+ }
+];
+
+
- texinfo/tp TODO Texinfo/Parser.pm t/02coverage....,
Patrice Dumas <=