[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[5184] * tp/Texinfo/Parser.pm: better handling of comments in @ -command
From: |
Patrice Dumas |
Subject: |
[5184] * tp/Texinfo/Parser.pm: better handling of comments in @ -commands |
Date: |
Fri, 22 Feb 2013 20:05:51 +0000 |
Revision: 5184
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5184
Author: pertusus
Date: 2013-02-22 20:05:50 +0000 (Fri, 22 Feb 2013)
Log Message:
-----------
* tp/Texinfo/Parser.pm: better handling of comments in @-commands
with line specially handled (@set, @ifset, @unmacro...).
Accept @set and @clear almost everywhere.
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/Texinfo/Parser.pm
trunk/tp/maintain/all_tests.sh
trunk/tp/t/50value.t
trunk/tp/t/55conditionals.t
trunk/tp/t/60macro.t
trunk/tp/t/results/macro/bad_argument.pl
trunk/tp/t/results/value/bad_syntax.pl
trunk/tp/t/results/value/simple.pl
Added Paths:
-----------
trunk/tp/t/results/conditionals/bad_ifclear_argument.pl
trunk/tp/t/results/conditionals/bad_ifset_argument.pl
trunk/tp/t/results/conditionals/comment_on_ifset_line.pl
trunk/tp/t/results/value/comment_on_set_line.pl
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2013-02-22 00:47:03 UTC (rev 5183)
+++ trunk/ChangeLog 2013-02-22 20:05:50 UTC (rev 5184)
@@ -1,3 +1,9 @@
+2013-02-22 Patrice Dumas <address@hidden>
+
+ * tp/Texinfo/Parser.pm: better handling of comments in @-commands
+ with line specially handled (@set, @ifset, @unmacro...).
+ Accept @set and @clear almost everywhere.
+
2013-02-21 Karl Berry <address@hidden>
* NEWS: mention incompatibilities of text outside @item
Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm 2013-02-22 00:47:03 UTC (rev 5183)
+++ trunk/tp/Texinfo/Parser.pm 2013-02-22 20:05:50 UTC (rev 5184)
@@ -305,7 +305,9 @@
$forbidden_index_name{$other_forbidden_index_name} = 1;
}
+# @-commands that do not start a paragraph
my %default_no_paragraph_commands;
+# @-commands that should be at a line beginning
my %begin_line_commands;
foreach my $command ('node', 'end') {
@@ -366,7 +368,7 @@
$in_full_text_commands{$command} = 1;
}
foreach my $misc_command_in_full_text('c', 'comment', 'refill', 'noindent',
- 'indent', 'columnfractions') {
+ 'indent', 'columnfractions', 'set', 'clear') {
$in_full_text_commands{$misc_command_in_full_text} = 1;
}
@@ -383,7 +385,7 @@
# commands that may happen on lines where everything is
# permitted
my %in_full_line_commands = %in_full_text_commands;
-foreach my $not_in_full_line_commands('noindent', 'indent') {
+foreach my $not_in_full_line_commands('noindent', 'indent', 'set', 'clear') {
delete $in_full_line_commands{$not_in_full_line_commands};
}
@@ -1096,6 +1098,8 @@
@args = split(/\s*,\s*/, $1);
}
+ # accept an @-command after the arguments in case there is a @c or
+ # @comment
if ($args_def =~ /address@hidden/) {
$self->line_error(sprintf($self->__("bad syntax for address@hidden
argument: %s"),
$command, $args_def),
@@ -1120,10 +1124,14 @@
$macro->{'extra'}->{'args_index'}->{$formal_arg} = $index;
$index++;
}
- } else {
+ } elsif ($line !~ /\S/) {
$self->line_error(sprintf($self->
__("%c%s requires a name"), ord('@'), $command), $line_nr);
$macro->{'extra'}->{'invalid_syntax'} = 1;
+ } else {
+ $self->line_error(sprintf($self->
+ __("bad name for address@hidden"), $command), $line_nr);
+ $macro->{'extra'}->{'invalid_syntax'} = 1;
}
return $macro;
}
@@ -4578,7 +4586,7 @@
my $ifvalue_true = 0;
if ($command eq 'ifclear' or $command eq 'ifset') {
# REVALUE
- if ($line =~ /^\s+([\w\-]+)/) {
+ if ($line =~ /^\s+([\w\-]+)\s*(\@(c|comment)((\@|\s+).*)?)?$/) {
my $name = $1;
if ((exists($self->{'values'}->{$name}) and $command eq
'ifset')
or (!exists($self->{'values'}->{$name})
@@ -4586,14 +4594,17 @@
$ifvalue_true = 1;
}
print STDERR "CONDITIONAL address@hidden $name:
$ifvalue_true\n" if ($self->{'DEBUG'});
+ } elsif ($line !~ /\S/) {
+ $self->line_error(sprintf($self->
+ __("%c%s requires a name"), ord('@'), $command), $line_nr);
} else {
- $self->line_error(sprintf($self->__("%c%s requires a name"),
- ord('@'), $command), $line_nr);
+ $self->line_error(sprintf($self->
+ __("bad name for address@hidden"), $command), $line_nr);
}
} elsif ($command eq 'ifcommanddefined'
or $command eq 'ifcommandnotdefined') {
# REMACRO
- if ($line =~ /^\s+([[:alnum:]][[:alnum:]\-]*)/) {
+ if ($line =~
/^\s+([[:alnum:]][[:alnum:]\-]*)\s*(\@(c|comment)((\@|\s+).*)?)?$/) {
my $name = $1;
my $command_is_defined = (
exists($Texinfo::Common::all_commands{$name})
@@ -4609,9 +4620,12 @@
$ifvalue_true = 1;
}
print STDERR "CONDITIONAL address@hidden $name:
$ifvalue_true\n" if ($self->{'DEBUG'});
+ } elsif ($line !~ /\S/) {
+ $self->line_error(sprintf($self->
+ __("%c%s requires a name"), ord('@'), $command), $line_nr);
} else {
- $self->line_error(sprintf($self->__("%c%s requires a name"),
- ord('@'), $command), $line_nr);
+ $self->line_error(sprintf($self->
+ __("bad name for address@hidden"), $command), $line_nr);
}
} elsif ($command =~ /^ifnot(.*)/) {
$ifvalue_true = 1 if !($self->{'expanded_formats_hash'}->{$1}
@@ -5264,38 +5278,54 @@
my $line_nr = shift;
my $args = [];
+ my $remaining;
if ($command eq 'set') {
# REVALUE
- if ($line =~ /^\s+([\w\-]+)\s*(.*?)\s*$/) {
+ #if ($line =~ s/^\s+([\w\-]+)(\s+(.*?))\s*$//) {
+ if ($line =~ /^\s+([\w\-]+)(\@(c|comment)((\@|\s+).*)?|\s+(.*?))?\s*$/) {
+ $line =~ s/\@(c|comment)((\@|\s+).*)?$//;
+ $line =~ /^\s+([\w\-]+)(\s+(.*?))?\s*$/;
my $name = $1;
- my $arg = $2;
+ my $arg = $3;
+ $arg = '' if (!defined($arg));
$args = [$name, $arg];
$self->{'values'}->{$name} = $arg
unless(_ignore_global_commands($self));
+ } elsif ($line !~ /\S/) {
+ $self->line_error(sprintf($self->
+ __("%c%s requires a name"), ord('@'), $command), $line_nr);
} else {
$self->line_error(sprintf($self->
- __("%c%s requires a name"), ord('@'), $command), $line_nr);
+ __("bad name for address@hidden"), $command), $line_nr);
}
} elsif ($command eq 'clear') {
# REVALUE
- if ($line =~ /^\s+([\w\-]+)/) {
+ if ($line =~ /^\s+([\w\-]+)\s*(\@(c|comment)((\@|\s+).*)?)?$/) {
$args = [$1];
delete $self->{'values'}->{$1}
unless(_ignore_global_commands($self));
+ #$remaining = $line;
+ #$remaining =~ s/^\s+([\w\-]+)\s*(\@(c|comment)((\@|\s+).*)?)?//;
+ } elsif ($line !~ /\S/) {
+ $self->line_error(sprintf($self->
+ __("%c%s requires a name"), ord('@'), $command), $line_nr);
} else {
$self->line_error(sprintf($self->
- __("%c%s requires a name"), ord('@'), $command), $line_nr);
+ __("bad name for address@hidden"), $command), $line_nr);
}
} elsif ($command eq 'unmacro') {
# REMACRO
- if ($line =~ /^\s+([[:alnum:]][[:alnum:]\-]*)/) {
+ if ($line =~
/^\s+([[:alnum:]][[:alnum:]\-]*)\s*(\@(c|comment)((\@|\s+).*)?)?$/) {
$args = [$1];
delete $self->{'macros'}->{$1}
unless(_ignore_global_commands($self));
print STDERR "UNMACRO $1\n" if ($self->{'DEBUG'});
+ } elsif ($line !~ /\S/) {
+ $self->line_error(sprintf($self->
+ __("%c%s requires a name"), ord('@'), $command), $line_nr);
} else {
$self->line_error(sprintf($self->
- __("%c%s requires a name"), ord('@'), $command), $line_nr);
+ __("bad name for address@hidden"), $command), $line_nr);
}
} elsif ($command eq 'clickstyle') {
# REMACRO
@@ -5303,11 +5333,8 @@
$args = ['@'.$1];
$self->{'clickstyle'} = $1
unless(_ignore_global_commands($self));
- my $remaining = $line;
- $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*//;
- $self->line_warn(sprintf($self->__(
- "remaining argument on address@hidden line: %s"),
- $command, $remaining), $line_nr) if ($remaining);
+ $remaining = $line;
+ $remaining =~
s/^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*(\@(c|comment)((\@|\s+).*)?)?//;
} else {
$self->line_error (sprintf($self->__(
"address@hidden should only accept a address@hidden as
argument, not `%s'"),
@@ -5316,6 +5343,14 @@
} else {
die $self->_bug_message("Unknown special command $command", $line_nr);
}
+ if (defined($remaining)) {
+ chomp($remaining);
+ if ($remaining ne '') {
+ $self->line_warn(sprintf($self->__(
+ "remaining argument on address@hidden line: %s"),
+ $command, $remaining), $line_nr);
+ }
+ }
return ($args);
}
Modified: trunk/tp/maintain/all_tests.sh
===================================================================
--- trunk/tp/maintain/all_tests.sh 2013-02-22 00:47:03 UTC (rev 5183)
+++ trunk/tp/maintain/all_tests.sh 2013-02-22 20:05:50 UTC (rev 5184)
@@ -25,7 +25,7 @@
done
for result in t/results/*/*/res*/; do
out=`echo $result | sed 's;res\([^/]*/\)$;out\1;'`
- diff -a -u --exclude=CVS -r $result $out
+ diff -a -u --exclude=CVS --exclude=.svn -r $result $out
done
else
for result in t/results/$test_name/*.pl; do
Modified: trunk/tp/t/50value.t
===================================================================
--- trunk/tp/t/50value.t 2013-02-22 00:47:03 UTC (rev 5183)
+++ trunk/tp/t/50value.t 2013-02-22 20:05:50 UTC (rev 5184)
@@ -15,7 +15,11 @@
@set
@set ?
@set :-/ hey!
address@hidden a#b
address@hidden aaa ggg
address@hidden and&other
+
@value{gurgl
@value{unknown}
@@ -25,6 +29,14 @@
@value {var}
'],
+['comment_on_set_line',
+'@set address@hidden
address@hidden y @c
address@hidden z address@hidden
address@hidden t a vv @address@hidden
+
address@hidden, address@hidden, address@hidden, address@hidden
+'],
['value_zero',
'@set zero 0
Value
Modified: trunk/tp/t/55conditionals.t
===================================================================
--- trunk/tp/t/55conditionals.t 2013-02-22 00:47:03 UTC (rev 5183)
+++ trunk/tp/t/55conditionals.t 2013-02-22 20:05:50 UTC (rev 5184)
@@ -13,6 +13,28 @@
@end ifset
'],
+['comment_on_ifset_line',
+'@set x
+
address@hidden address@hidden
+Y1
address@hidden ifset
address@hidden address@hidden comm
+Y2
address@hidden ifset
address@hidden address@hidden@ggg
+Y3
address@hidden ifset
address@hidden x @c
+Y4
address@hidden ifset
address@hidden x @c comm
+Y5
address@hidden ifset
address@hidden x @address@hidden
+Y6
address@hidden ifset
+'],
['nested_ignore',
'@ignore
@ignore
@@ -160,7 +182,7 @@
@set a
@ifset a
address@hidden ok - ok, ignored
address@hidden ok @c - ok, ignored
@end junky - ok, ignored
@end ifset
@c WRONG - missing @end ifset.
@@ -273,6 +295,17 @@
@end ifset
'],
+['bad_ifset_argument',
+'@ifset a&b
+Ra&b
address@hidden ifset
+'],
+['bad_ifclear_argument',
+'
address@hidden #something
+R#something
address@hidden ifclear
+'],
['ignore_not_closed',
'@ignore
Modified: trunk/tp/t/60macro.t
===================================================================
--- trunk/tp/t/60macro.t 2013-02-22 00:47:03 UTC (rev 5183)
+++ trunk/tp/t/60macro.t 2013-02-22 20:05:50 UTC (rev 5184)
@@ -60,6 +60,10 @@
@macro aftername {ggg} more
in macro
@end macro
+
address@hidden #badname
+in #
address@hidden macro
'],
['bad_macro_name_with_underscore',
'@macro the_macro {arg1, arg2}
Added: trunk/tp/t/results/conditionals/bad_ifclear_argument.pl
===================================================================
--- trunk/tp/t/results/conditionals/bad_ifclear_argument.pl
(rev 0)
+++ trunk/tp/t/results/conditionals/bad_ifclear_argument.pl 2013-02-22
20:05:50 UTC (rev 5184)
@@ -0,0 +1,41 @@
+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);
+
+use utf8;
+
+$result_trees{'bad_ifclear_argument'} = {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'bad_ifclear_argument'}{'contents'}[0]{'parent'} =
$result_trees{'bad_ifclear_argument'};
+
+$result_texis{'bad_ifclear_argument'} = '
+';
+
+
+$result_texts{'bad_ifclear_argument'} = '
+';
+
+$result_errors{'bad_ifclear_argument'} = [
+ {
+ 'error_line' => ':2: bad name for @ifclear
+',
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => '',
+ 'text' => 'bad name for @ifclear',
+ 'type' => 'error'
+ }
+];
+
+
+1;
Added: trunk/tp/t/results/conditionals/bad_ifset_argument.pl
===================================================================
--- trunk/tp/t/results/conditionals/bad_ifset_argument.pl
(rev 0)
+++ trunk/tp/t/results/conditionals/bad_ifset_argument.pl 2013-02-22
20:05:50 UTC (rev 5184)
@@ -0,0 +1,31 @@
+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);
+
+use utf8;
+
+$result_trees{'bad_ifset_argument'} = {
+ 'contents' => [],
+ 'type' => 'text_root'
+};
+
+$result_texis{'bad_ifset_argument'} = '';
+
+
+$result_texts{'bad_ifset_argument'} = '';
+
+$result_errors{'bad_ifset_argument'} = [
+ {
+ 'error_line' => ':1: bad name for @ifset
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => 'bad name for @ifset',
+ 'type' => 'error'
+ }
+];
+
+
+1;
Added: trunk/tp/t/results/conditionals/comment_on_ifset_line.pl
===================================================================
--- trunk/tp/t/results/conditionals/comment_on_ifset_line.pl
(rev 0)
+++ trunk/tp/t/results/conditionals/comment_on_ifset_line.pl 2013-02-22
20:05:50 UTC (rev 5184)
@@ -0,0 +1,114 @@
+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);
+
+use utf8;
+
+$result_trees{'comment_on_ifset_line'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 'x',
+ 'type' => 'misc_arg'
+ },
+ {
+ 'parent' => {},
+ 'text' => '',
+ 'type' => 'misc_arg'
+ }
+ ],
+ 'cmdname' => 'set',
+ 'extra' => {
+ 'arg_line' => ' x
+',
+ 'misc_args' => [
+ 'x',
+ ''
+ ]
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'Y1
+'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'Y2
+'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'Y3
+'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'Y4
+'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'Y5
+'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'Y6
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'comment_on_ifset_line'}{'contents'}[0]{'args'}[0]{'parent'} =
$result_trees{'comment_on_ifset_line'}{'contents'}[0];
+$result_trees{'comment_on_ifset_line'}{'contents'}[0]{'args'}[1]{'parent'} =
$result_trees{'comment_on_ifset_line'}{'contents'}[0];
+$result_trees{'comment_on_ifset_line'}{'contents'}[0]{'parent'} =
$result_trees{'comment_on_ifset_line'};
+$result_trees{'comment_on_ifset_line'}{'contents'}[1]{'parent'} =
$result_trees{'comment_on_ifset_line'};
+$result_trees{'comment_on_ifset_line'}{'contents'}[2]{'contents'}[0]{'parent'}
= $result_trees{'comment_on_ifset_line'}{'contents'}[2];
+$result_trees{'comment_on_ifset_line'}{'contents'}[2]{'contents'}[1]{'parent'}
= $result_trees{'comment_on_ifset_line'}{'contents'}[2];
+$result_trees{'comment_on_ifset_line'}{'contents'}[2]{'contents'}[2]{'parent'}
= $result_trees{'comment_on_ifset_line'}{'contents'}[2];
+$result_trees{'comment_on_ifset_line'}{'contents'}[2]{'contents'}[3]{'parent'}
= $result_trees{'comment_on_ifset_line'}{'contents'}[2];
+$result_trees{'comment_on_ifset_line'}{'contents'}[2]{'contents'}[4]{'parent'}
= $result_trees{'comment_on_ifset_line'}{'contents'}[2];
+$result_trees{'comment_on_ifset_line'}{'contents'}[2]{'contents'}[5]{'parent'}
= $result_trees{'comment_on_ifset_line'}{'contents'}[2];
+$result_trees{'comment_on_ifset_line'}{'contents'}[2]{'parent'} =
$result_trees{'comment_on_ifset_line'};
+
+$result_texis{'comment_on_ifset_line'} = '@set x
+
+Y1
+Y2
+Y3
+Y4
+Y5
+Y6
+';
+
+
+$result_texts{'comment_on_ifset_line'} = '
+Y1
+Y2
+Y3
+Y4
+Y5
+Y6
+';
+
+$result_errors{'comment_on_ifset_line'} = [];
+
+
+1;
Modified: trunk/tp/t/results/macro/bad_argument.pl
===================================================================
--- trunk/tp/t/results/macro/bad_argument.pl 2013-02-22 00:47:03 UTC (rev
5183)
+++ trunk/tp/t/results/macro/bad_argument.pl 2013-02-22 20:05:50 UTC (rev
5184)
@@ -157,6 +157,51 @@
},
'parent' => {}
},
+ {},
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'macro',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'in #',
+ 'type' => 'raw'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'last_raw_newline'
+ }
+ ],
+ 'extra' => {
+ 'arg_line' => ' #badname
+',
+ 'invalid_syntax' => 1,
+ 'macrobody' => 'in #
+',
+ 'spaces_after_command' => {
+ 'extra' => {
+ 'command' => {}
+ },
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ }
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 13,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ },
{}
],
'type' => 'text_root'
@@ -184,6 +229,13 @@
$result_trees{'bad_argument'}{'contents'}[6]{'extra'}{'spaces_after_command'}{'parent'}
= $result_trees{'bad_argument'};
$result_trees{'bad_argument'}{'contents'}[6]{'parent'} =
$result_trees{'bad_argument'};
$result_trees{'bad_argument'}{'contents'}[7] =
$result_trees{'bad_argument'}{'contents'}[6]{'extra'}{'spaces_after_command'};
+$result_trees{'bad_argument'}{'contents'}[8]{'parent'} =
$result_trees{'bad_argument'};
+$result_trees{'bad_argument'}{'contents'}[9]{'contents'}[0]{'parent'} =
$result_trees{'bad_argument'}{'contents'}[9];
+$result_trees{'bad_argument'}{'contents'}[9]{'contents'}[1]{'parent'} =
$result_trees{'bad_argument'}{'contents'}[9];
+$result_trees{'bad_argument'}{'contents'}[9]{'extra'}{'spaces_after_command'}{'extra'}{'command'}
= $result_trees{'bad_argument'}{'contents'}[9];
+$result_trees{'bad_argument'}{'contents'}[9]{'extra'}{'spaces_after_command'}{'parent'}
= $result_trees{'bad_argument'};
+$result_trees{'bad_argument'}{'contents'}[9]{'parent'} =
$result_trees{'bad_argument'};
+$result_trees{'bad_argument'}{'contents'}[10] =
$result_trees{'bad_argument'}{'contents'}[9]{'extra'}{'spaces_after_command'};
$result_texis{'bad_argument'} = '@macro
in macro
@@ -196,11 +248,16 @@
@macro aftername {ggg} more
in macro
@end macro
+
address@hidden #badname
+in #
address@hidden macro
';
$result_texts{'bad_argument'} = '
+
';
$result_errors{'bad_argument'} = [
@@ -230,6 +287,15 @@
'macro' => '',
'text' => 'bad syntax for @macro argument: more',
'type' => 'error'
+ },
+ {
+ 'error_line' => ':13: bad name for @macro
+',
+ 'file_name' => '',
+ 'line_nr' => 13,
+ 'macro' => '',
+ 'text' => 'bad name for @macro',
+ 'type' => 'error'
}
];
Modified: trunk/tp/t/results/value/bad_syntax.pl
===================================================================
--- trunk/tp/t/results/value/bad_syntax.pl 2013-02-22 00:47:03 UTC (rev
5183)
+++ trunk/tp/t/results/value/bad_syntax.pl 2013-02-22 20:05:50 UTC (rev
5184)
@@ -46,9 +46,39 @@
'parent' => {}
},
{
+ 'cmdname' => 'set',
+ 'extra' => {
+ 'arg_line' => ' a#b
+'
+ },
+ 'parent' => {}
+ },
+ {
'parent' => {},
'text' => '
',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'clear',
+ 'extra' => {
+ 'arg_line' => ' aaa ggg
+'
+ },
+ 'parent' => {}
+ },
+ {
+ 'cmdname' => 'clear',
+ 'extra' => {
+ 'arg_line' => ' and&other
+'
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
'type' => 'empty_spaces_before_paragraph'
},
{
@@ -91,18 +121,26 @@
$result_trees{'bad_syntax'}{'contents'}[3]{'parent'} =
$result_trees{'bad_syntax'};
$result_trees{'bad_syntax'}{'contents'}[4]{'parent'} =
$result_trees{'bad_syntax'};
$result_trees{'bad_syntax'}{'contents'}[5]{'parent'} =
$result_trees{'bad_syntax'};
-$result_trees{'bad_syntax'}{'contents'}[6]{'contents'}[0]{'parent'} =
$result_trees{'bad_syntax'}{'contents'}[6];
$result_trees{'bad_syntax'}{'contents'}[6]{'parent'} =
$result_trees{'bad_syntax'};
$result_trees{'bad_syntax'}{'contents'}[7]{'parent'} =
$result_trees{'bad_syntax'};
$result_trees{'bad_syntax'}{'contents'}[8]{'parent'} =
$result_trees{'bad_syntax'};
+$result_trees{'bad_syntax'}{'contents'}[9]{'parent'} =
$result_trees{'bad_syntax'};
+$result_trees{'bad_syntax'}{'contents'}[10]{'contents'}[0]{'parent'} =
$result_trees{'bad_syntax'}{'contents'}[10];
$result_trees{'bad_syntax'}{'contents'}[10]{'parent'} =
$result_trees{'bad_syntax'};
+$result_trees{'bad_syntax'}{'contents'}[11]{'parent'} =
$result_trees{'bad_syntax'};
+$result_trees{'bad_syntax'}{'contents'}[12]{'parent'} =
$result_trees{'bad_syntax'};
+$result_trees{'bad_syntax'}{'contents'}[14]{'parent'} =
$result_trees{'bad_syntax'};
$result_texis{'bad_syntax'} = '
@set
@set
@set ?
@set :-/ hey!
address@hidden a#b
address@hidden aaa ggg
address@hidden and&other
+
gurgl
@value{unknown}
@@ -110,6 +148,7 @@
$result_texts{'bad_syntax'} = '
+
gurgl
@@ -135,46 +174,73 @@
'type' => 'error'
},
{
- 'error_line' => ':4: @set requires a name
+ 'error_line' => ':4: bad name for @set
',
'file_name' => '',
'line_nr' => 4,
'macro' => '',
- 'text' => '@set requires a name',
+ 'text' => 'bad name for @set',
'type' => 'error'
},
{
- 'error_line' => ':5: @set requires a name
+ 'error_line' => ':5: bad name for @set
',
'file_name' => '',
'line_nr' => 5,
'macro' => '',
- 'text' => '@set requires a name',
+ 'text' => 'bad name for @set',
'type' => 'error'
},
{
- 'error_line' => ':7: bad syntax for @value
+ 'error_line' => ':6: bad name for @set
',
'file_name' => '',
- 'line_nr' => 7,
+ 'line_nr' => 6,
'macro' => '',
+ 'text' => 'bad name for @set',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => ':8: bad name for @clear
+',
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => '',
+ 'text' => 'bad name for @clear',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => ':9: bad name for @clear
+',
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => '',
+ 'text' => 'bad name for @clear',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => ':11: bad syntax for @value
+',
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => '',
'text' => 'bad syntax for @value',
'type' => 'error'
},
{
- 'error_line' => ':7: misplaced {
+ 'error_line' => ':11: misplaced {
',
'file_name' => '',
- 'line_nr' => 7,
+ 'line_nr' => 11,
'macro' => '',
'text' => 'misplaced {',
'type' => 'error'
},
{
- 'error_line' => ':9: warning: undefined flag: unknown
+ 'error_line' => ':13: warning: undefined flag: unknown
',
'file_name' => '',
- 'line_nr' => 9,
+ 'line_nr' => 13,
'macro' => '',
'text' => 'undefined flag: unknown',
'type' => 'warning'
Added: trunk/tp/t/results/value/comment_on_set_line.pl
===================================================================
--- trunk/tp/t/results/value/comment_on_set_line.pl
(rev 0)
+++ trunk/tp/t/results/value/comment_on_set_line.pl 2013-02-22 20:05:50 UTC
(rev 5184)
@@ -0,0 +1,158 @@
+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);
+
+use utf8;
+
+$result_trees{'comment_on_set_line'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 'x',
+ 'type' => 'misc_arg'
+ },
+ {
+ 'parent' => {},
+ 'text' => '',
+ 'type' => 'misc_arg'
+ }
+ ],
+ 'cmdname' => 'set',
+ 'extra' => {
+ 'arg_line' => ' address@hidden
+',
+ 'misc_args' => [
+ 'x',
+ ''
+ ]
+ },
+ 'parent' => {}
+ },
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 'y',
+ 'type' => 'misc_arg'
+ },
+ {
+ 'parent' => {},
+ 'text' => '',
+ 'type' => 'misc_arg'
+ }
+ ],
+ 'cmdname' => 'set',
+ 'extra' => {
+ 'arg_line' => ' y @c
+',
+ 'misc_args' => [
+ 'y',
+ ''
+ ]
+ },
+ 'parent' => {}
+ },
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 'z',
+ 'type' => 'misc_arg'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'g',
+ 'type' => 'misc_arg'
+ }
+ ],
+ 'cmdname' => 'set',
+ 'extra' => {
+ 'arg_line' => ' z address@hidden
+',
+ 'misc_args' => [
+ 'z',
+ 'g'
+ ]
+ },
+ 'parent' => {}
+ },
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 't',
+ 'type' => 'misc_arg'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'a vv',
+ 'type' => 'misc_arg'
+ }
+ ],
+ 'cmdname' => 'set',
+ 'extra' => {
+ 'arg_line' => ' t a vv @address@hidden
+',
+ 'misc_args' => [
+ 't',
+ 'a vv'
+ ]
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '!!, !!, !g!, !a vv!
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'comment_on_set_line'}{'contents'}[0]{'args'}[0]{'parent'} =
$result_trees{'comment_on_set_line'}{'contents'}[0];
+$result_trees{'comment_on_set_line'}{'contents'}[0]{'args'}[1]{'parent'} =
$result_trees{'comment_on_set_line'}{'contents'}[0];
+$result_trees{'comment_on_set_line'}{'contents'}[0]{'parent'} =
$result_trees{'comment_on_set_line'};
+$result_trees{'comment_on_set_line'}{'contents'}[1]{'args'}[0]{'parent'} =
$result_trees{'comment_on_set_line'}{'contents'}[1];
+$result_trees{'comment_on_set_line'}{'contents'}[1]{'args'}[1]{'parent'} =
$result_trees{'comment_on_set_line'}{'contents'}[1];
+$result_trees{'comment_on_set_line'}{'contents'}[1]{'parent'} =
$result_trees{'comment_on_set_line'};
+$result_trees{'comment_on_set_line'}{'contents'}[2]{'args'}[0]{'parent'} =
$result_trees{'comment_on_set_line'}{'contents'}[2];
+$result_trees{'comment_on_set_line'}{'contents'}[2]{'args'}[1]{'parent'} =
$result_trees{'comment_on_set_line'}{'contents'}[2];
+$result_trees{'comment_on_set_line'}{'contents'}[2]{'parent'} =
$result_trees{'comment_on_set_line'};
+$result_trees{'comment_on_set_line'}{'contents'}[3]{'args'}[0]{'parent'} =
$result_trees{'comment_on_set_line'}{'contents'}[3];
+$result_trees{'comment_on_set_line'}{'contents'}[3]{'args'}[1]{'parent'} =
$result_trees{'comment_on_set_line'}{'contents'}[3];
+$result_trees{'comment_on_set_line'}{'contents'}[3]{'parent'} =
$result_trees{'comment_on_set_line'};
+$result_trees{'comment_on_set_line'}{'contents'}[4]{'parent'} =
$result_trees{'comment_on_set_line'};
+$result_trees{'comment_on_set_line'}{'contents'}[5]{'contents'}[0]{'parent'} =
$result_trees{'comment_on_set_line'}{'contents'}[5];
+$result_trees{'comment_on_set_line'}{'contents'}[5]{'parent'} =
$result_trees{'comment_on_set_line'};
+
+$result_texis{'comment_on_set_line'} = '@set address@hidden
address@hidden y @c
address@hidden z address@hidden
address@hidden t a vv @address@hidden
+
+!!, !!, !g!, !a vv!
+';
+
+
+$result_texts{'comment_on_set_line'} = '
+!!, !!, !g!, !a vv!
+';
+
+$result_errors{'comment_on_set_line'} = [];
+
+
+1;
Modified: trunk/tp/t/results/value/simple.pl
===================================================================
--- trunk/tp/t/results/value/simple.pl 2013-02-22 00:47:03 UTC (rev 5183)
+++ trunk/tp/t/results/value/simple.pl 2013-02-22 20:05:50 UTC (rev 5184)
@@ -16,7 +16,7 @@
},
{
'parent' => {},
- 'text' => 'the value @b{b} @c comment',
+ 'text' => 'the value @b{b}',
'type' => 'misc_arg'
}
],
@@ -26,7 +26,7 @@
',
'misc_args' => [
'a-_5b',
- 'the value @b{b} @c comment'
+ 'the value @b{b}'
]
},
'parent' => {}
@@ -67,25 +67,8 @@
},
{
'parent' => {},
- 'text' => ' '
- },
- {
- 'args' => [
- {
- 'parent' => {},
- 'text' => ' comment After value.
-',
- 'type' => 'misc_arg'
- }
- ],
- 'cmdname' => 'c',
- 'extra' => {
- 'misc_args' => [
- ' comment After value.
+ 'text' => ' After value.
'
- ]
- },
- 'parent' => {}
}
],
'parent' => {},
@@ -103,18 +86,17 @@
$result_trees{'simple'}{'contents'}[2]{'contents'}[1]{'args'}[0]{'parent'} =
$result_trees{'simple'}{'contents'}[2]{'contents'}[1];
$result_trees{'simple'}{'contents'}[2]{'contents'}[1]{'parent'} =
$result_trees{'simple'}{'contents'}[2];
$result_trees{'simple'}{'contents'}[2]{'contents'}[2]{'parent'} =
$result_trees{'simple'}{'contents'}[2];
-$result_trees{'simple'}{'contents'}[2]{'contents'}[3]{'args'}[0]{'parent'} =
$result_trees{'simple'}{'contents'}[2]{'contents'}[3];
-$result_trees{'simple'}{'contents'}[2]{'contents'}[3]{'parent'} =
$result_trees{'simple'}{'contents'}[2];
$result_trees{'simple'}{'contents'}[2]{'parent'} = $result_trees{'simple'};
$result_texis{'simple'} = '@set a-_5b the value @b{b} @c comment
-the value @b{b} @c comment After value.
+the value @b{b} After value.
';
$result_texts{'simple'} = '
-the value b ';
+the value b After value.
+';
$result_errors{'simple'} = [];
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [5184] * tp/Texinfo/Parser.pm: better handling of comments in @ -commands,
Patrice Dumas <=