[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp Texinfo/Parser.pm t/60macro.t t/resu...
From: |
Patrice Dumas |
Subject: |
texinfo/tp Texinfo/Parser.pm t/60macro.t t/resu... |
Date: |
Sat, 19 Feb 2011 13:35:08 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/02/19 13:35:08
Modified files:
tp/Texinfo : Parser.pm
tp/t : 60macro.t
tp/t/results/macro: bad_argument.pl
tp/t/results/value_and_macro: value_in_macro_formal_arg.pl
Added files:
tp/t/results/macro: bad_macro_name_with_underscore.pl
Log message:
Try a better error message for bad macro syntax.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.199&r2=1.200
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/60macro.t?cvsroot=texinfo&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/bad_argument.pl?cvsroot=texinfo&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/bad_macro_name_with_underscore.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/value_and_macro/value_in_macro_formal_arg.pl?cvsroot=texinfo&r1=1.19&r2=1.20
Patches:
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -b -r1.199 -r1.200
--- Texinfo/Parser.pm 19 Feb 2011 12:21:48 -0000 1.199
+++ Texinfo/Parser.pm 19 Feb 2011 13:35:07 -0000 1.200
@@ -934,11 +934,12 @@
my @args;
if ($args_def =~ s/^\s*{\s*(.*?)\s*}\s*//) {
- @args = split(/\s*,\s*/ , $1);
+ @args = split(/\s*,\s*/, $1);
}
if ($args_def =~ /address@hidden/) {
- $self->line_error(sprintf($self->__("Bad syntax for address@hidden"),
$command),
+ $self->line_error(sprintf($self->__("Bad syntax for address@hidden
argument: %s"),
+ $command, $args_def),
$line_nr);
}
print STDERR "MACRO address@hidden $macro_name\n" if ($self->{'DEBUG'});
Index: t/60macro.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/60macro.t,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- t/60macro.t 1 Dec 2010 22:39:44 -0000 1.26
+++ t/60macro.t 19 Feb 2011 13:35:07 -0000 1.27
@@ -39,6 +39,11 @@
in macro
@end macro
'],
+['bad_macro_name_with_underscore',
+'@macro the_macro {arg1, arg2}
+In macro
address@hidden macro
+'],
['bad_formal_arg',
'
@macro bad { , not_empty}
Index: t/results/macro/bad_argument.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/macro/bad_argument.pl,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- t/results/macro/bad_argument.pl 7 Dec 2010 20:34:29 -0000 1.17
+++ t/results/macro/bad_argument.pl 19 Feb 2011 13:35:07 -0000 1.18
@@ -172,21 +172,21 @@
'type' => 'error'
},
{
- 'error_line' => ':5: Bad syntax for @rmacro
+ 'error_line' => ':5: Bad syntax for @rmacro argument: aaa
',
'file_name' => '',
'line_nr' => 5,
'macro' => '',
- 'text' => 'Bad syntax for @rmacro',
+ 'text' => 'Bad syntax for @rmacro argument: aaa',
'type' => 'error'
},
{
- 'error_line' => ':9: Bad syntax for @macro
+ 'error_line' => ':9: Bad syntax for @macro argument: more
',
'file_name' => '',
'line_nr' => 9,
'macro' => '',
- 'text' => 'Bad syntax for @macro',
+ 'text' => 'Bad syntax for @macro argument: more',
'type' => 'error'
}
];
Index: t/results/value_and_macro/value_in_macro_formal_arg.pl
===================================================================
RCS file:
/sources/texinfo/texinfo/tp/t/results/value_and_macro/value_in_macro_formal_arg.pl,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- t/results/value_and_macro/value_in_macro_formal_arg.pl 19 Feb 2011
02:26:42 -0000 1.19
+++ t/results/value_and_macro/value_in_macro_formal_arg.pl 19 Feb 2011
13:35:07 -0000 1.20
@@ -161,12 +161,12 @@
$result_errors{'value_in_macro_formal_arg'} = [
{
- 'error_line' => ':3: Bad syntax for @macro
+ 'error_line' => ':3: Bad syntax for @macro argument: }
',
'file_name' => '',
'line_nr' => 3,
'macro' => '',
- 'text' => 'Bad syntax for @macro',
+ 'text' => 'Bad syntax for @macro argument: }',
'type' => 'error'
},
{
Index: t/results/macro/bad_macro_name_with_underscore.pl
===================================================================
RCS file: t/results/macro/bad_macro_name_with_underscore.pl
diff -N t/results/macro/bad_macro_name_with_underscore.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/macro/bad_macro_name_with_underscore.pl 19 Feb 2011 13:35:07
-0000 1.1
@@ -0,0 +1,72 @@
+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_trees{'bad_macro_name_with_underscore'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 'the',
+ 'type' => 'macro_name'
+ }
+ ],
+ 'cmdname' => 'macro',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'In macro
+',
+ 'type' => 'raw'
+ }
+ ],
+ 'extra' => {
+ 'arg_line' => ' the_macro {arg1, arg2}
+',
+ 'macrobody' => 'In macro
+'
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'bad_macro_name_with_underscore'}{'contents'}[0]{'args'}[0]{'parent'}
= $result_trees{'bad_macro_name_with_underscore'}{'contents'}[0];
+$result_trees{'bad_macro_name_with_underscore'}{'contents'}[0]{'contents'}[0]{'parent'}
= $result_trees{'bad_macro_name_with_underscore'}{'contents'}[0];
+$result_trees{'bad_macro_name_with_underscore'}{'contents'}[0]{'parent'} =
$result_trees{'bad_macro_name_with_underscore'};
+$result_trees{'bad_macro_name_with_underscore'}{'contents'}[1]{'parent'} =
$result_trees{'bad_macro_name_with_underscore'};
+
+$result_texis{'bad_macro_name_with_underscore'} = '@macro the_macro {arg1,
arg2}
+In macro
address@hidden macro
+';
+
+
+$result_texts{'bad_macro_name_with_underscore'} = '';
+
+$result_errors{'bad_macro_name_with_underscore'} = [
+ {
+ 'error_line' => ':1: Bad syntax for @macro argument: _macro {arg1, arg2}
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => 'Bad syntax for @macro argument: _macro {arg1, arg2}',
+ 'type' => 'error'
+ }
+];
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp Texinfo/Parser.pm t/60macro.t t/resu...,
Patrice Dumas <=