[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: |
Thu, 17 Mar 2011 21:01:03 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/03/17 21:01:03
Modified files:
tp : TODO
tp/Texinfo : Parser.pm
tp/t : 02coverage.t
Added files:
tp/t/results/coverage: not_i_j_in_dotless.pl
Log message:
Error when dotless argument is not i or j.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.111&r2=1.112
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.222&r2=1.223
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/02coverage.t?cvsroot=texinfo&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/coverage/not_i_j_in_dotless.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -b -r1.111 -r1.112
--- TODO 15 Mar 2011 20:29:11 -0000 1.111
+++ TODO 17 Mar 2011 21:01:01 -0000 1.112
@@ -110,9 +110,6 @@
in hyphenation: only text and accent commands, and should
only appear in toplevel
-dotless:
-"%c%s expects `i' or `j' as argument, not `%s'"
-
Missing warnings in
t/19def.t empty_def_arguments
for
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.222
retrieving revision 1.223
diff -u -b -r1.222 -r1.223
--- Texinfo/Parser.pm 17 Mar 2011 20:19:07 -0000 1.222
+++ Texinfo/Parser.pm 17 Mar 2011 21:01:02 -0000 1.223
@@ -3007,6 +3007,11 @@
if ($self->{'DEBUG'});
# FIXME this is different than usual tree, no content here
$current->{'args'} = [ { 'text' => $1, 'parent' => $current } ];
+ if ($current->{'cmdname'} eq 'dotless' and $1 ne 'i' and $1 ne
'j') {
+ $self->line_error (sprintf($self->
+ __("%c%s expects `i' or `j' as argument, not `%s'"),
+ ord('@'), $current->{'cmdname'}, $1), $line_nr);
+ }
if ($current->{'cmdname'} =~ /^[a-zA-Z]/) {
$current->{'args'}->[-1]->{'type'} = 'space_command_arg';
}
@@ -3900,6 +3905,18 @@
$self->line_error(
$self->__("address@hidden missing filename argument"),
$line_nr);
}
+ } elsif($current->{'parent'}->{'cmdname'} eq 'dotless') {
+ my $dotless = $current->{'parent'};
+ if (@{$current->{'contents'}}) {
+ my $text = $current->{'contents'}->[0]->{'text'};
+ if (!defined ($text)
+ or ($text ne 'i' and $text ne 'j')) {
+ $self->line_error (sprintf($self->
+ __("%c%s expects `i' or `j' as argument, not `%s'"),
+ ord('@'), $dotless->{'cmdname'},
+ Texinfo::Convert::Texinfo::convert($current)), $line_nr);
+ }
+ }
}
$self->_register_global_command($current->{'parent'}->{'cmdname'},
$current->{'parent'}, $line_nr);
Index: t/02coverage.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/02coverage.t,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- t/02coverage.t 14 Mar 2011 23:00:47 -0000 1.42
+++ t/02coverage.t 17 Mar 2011 21:01:02 -0000 1.43
@@ -516,6 +516,8 @@
['accent_no_closed_comment',
'@~{e @c comment
'],
+['not_i_j_in_dotless',
+'@dotless a bc, @address@hidden'],
['indicateurl_end_lines',
'@indicateurl{http://begin
continue on other line}
Index: t/results/coverage/not_i_j_in_dotless.pl
===================================================================
RCS file: t/results/coverage/not_i_j_in_dotless.pl
diff -N t/results/coverage/not_i_j_in_dotless.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/coverage/not_i_j_in_dotless.pl 17 Mar 2011 21:01:03 -0000
1.1
@@ -0,0 +1,115 @@
+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);
+
+use utf8;
+
+$result_trees{'not_i_j_in_dotless'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 'a',
+ 'type' => 'space_command_arg'
+ }
+ ],
+ 'cmdname' => 'dotless',
+ 'extra' => {
+ 'spaces' => ' '
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => ' bc, '
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'q'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'dotless',
+ 'contents' => [],
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => '^',
+ 'contents' => [],
+ 'line_nr' => {},
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '.'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'parent'}
= $result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[0];
+$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[0]{'parent'} =
$result_trees{'not_i_j_in_dotless'}{'contents'}[0];
+$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[1]{'parent'} =
$result_trees{'not_i_j_in_dotless'}{'contents'}[0];
+$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[2]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[2]{'args'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[2]{'args'}[0]{'contents'}[0]{'args'}[0]{'parent'}
=
$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[2]{'args'}[0]{'contents'}[0];
+$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[2]{'args'}[0];
+$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[2]{'args'}[0]{'parent'}
= $result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[2];
+$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[2]{'line_nr'} =
$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[2]{'args'}[0]{'contents'}[0]{'line_nr'};
+$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[2]{'parent'} =
$result_trees{'not_i_j_in_dotless'}{'contents'}[0];
+$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'contents'}[3]{'parent'} =
$result_trees{'not_i_j_in_dotless'}{'contents'}[0];
+$result_trees{'not_i_j_in_dotless'}{'contents'}[0]{'parent'} =
$result_trees{'not_i_j_in_dotless'};
+
+$result_texis{'not_i_j_in_dotless'} = '@dotless a bc, @address@hidden';
+
+
+$result_texts{'not_i_j_in_dotless'} = 'a bc, q^.';
+
+$result_errors{'not_i_j_in_dotless'} = [
+ {
+ 'error_line' => ':1: @dotless expects `i\' or `j\' as argument, not `a\'
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => '@dotless expects `i\' or `j\' as argument, not `a\'',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => ':1: @dotless expects `i\' or `j\' as argument, not `q\'
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => '@dotless expects `i\' or `j\' as argument, not `q\'',
+ 'type' => 'error'
+ }
+];
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp TODO Texinfo/Parser.pm t/02coverage....,
Patrice Dumas <=