[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp TODO Texinfo/Parser.pm t/58alias.t t...
From: |
Patrice Dumas |
Subject: |
texinfo/tp TODO Texinfo/Parser.pm t/58alias.t t... |
Date: |
Fri, 19 Aug 2011 18:31:24 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/08/19 18:31:24
Modified files:
tp : TODO
tp/Texinfo : Parser.pm
tp/t : 58alias.t
Added files:
tp/t/results/alias: block_command_alias.pl
Log message:
Warn when an @alias is done on a block command.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.155&r2=1.156
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.276&r2=1.277
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/58alias.t?cvsroot=texinfo&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/alias/block_command_alias.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -b -r1.155 -r1.156
--- TODO 15 Aug 2011 12:53:24 -0000 1.155
+++ TODO 19 Aug 2011 18:31:23 -0000 1.156
@@ -59,10 +59,7 @@
Add an API for everything used in conf, for example in page_head, use
$self->title_string() and so on and so forth.
-In Texinfo::Parser.pm put preformatted in menu_entry_description when in
-preformatted. It means adding a _begin_preformatted*, but also taking
-care of it in the code handling entry that was not, in the end a menu
-entry (which is a mess and maybe should be redone).
+add --output-encoding.
html tests which should be right:
sectioning setfilename_on_top_and_after_node
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.276
retrieving revision 1.277
diff -u -b -r1.276 -r1.277
--- Texinfo/Parser.pm 16 Aug 2011 22:07:20 -0000 1.276
+++ Texinfo/Parser.pm 19 Aug 2011 18:31:24 -0000 1.277
@@ -4611,8 +4611,15 @@
if ($command eq 'alias') {
# REMACRO
if ($line =~
s/^([[:alnum:]][[:alnum:]-]*)(\s*=\s*)([[:alnum:]][[:alnum:]-]*)$//) {
- $self->{'aliases'}->{$1} = $3;
+ my $new_command = $1;
+ my $existing_command = $3;
$args = [$1, $3];
+ $self->{'aliases'}->{$new_command} = $existing_command;
+ if (exists($block_commands{$existing_command})) {
+ $self->line_warn (sprintf($self->
+ __("Environment command %s as argument to
address@hidden"),
+ $existing_command, $command), $line_nr);
+ }
} else {
$self->line_error (sprintf($self->
__("Bad argument to address@hidden"), $command),
$line_nr);
Index: t/58alias.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/58alias.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- t/58alias.t 23 Oct 2010 15:36:53 -0000 1.3
+++ t/58alias.t 19 Aug 2011 18:31:24 -0000 1.4
@@ -21,7 +21,14 @@
@alias garbage-on-line =cmd garbage
@alias garbage-on-line =cmd @code{in code}
-']
+'],
+['block_command_alias',
+'@alias lang=lisp
+
address@hidden
+in lang
address@hidden lang
+'],
);
our ($arg_test_case, $arg_generate, $arg_debug);
Index: t/results/alias/block_command_alias.pl
===================================================================
RCS file: t/results/alias/block_command_alias.pl
diff -N t/results/alias/block_command_alias.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/alias/block_command_alias.pl 19 Aug 2011 18:31:24 -0000
1.1
@@ -0,0 +1,192 @@
+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{'block_command_alias'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'command' => {}
+ },
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'lang=lisp'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'spaces_at_end'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'alias',
+ 'extra' => {
+ 'misc_args' => [
+ 'lang',
+ 'lisp'
+ ]
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'lisp',
+ 'contents' => [
+ {
+ 'extra' => {
+ 'command' => {}
+ },
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'in lang
+'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'command' => {}
+ },
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'lang'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'spaces_at_end'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'lang'
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'preformatted'
+ }
+ ],
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'block_command_alias'}{'contents'}[0]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
= $result_trees{'block_command_alias'}{'contents'}[0];
+$result_trees{'block_command_alias'}{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'block_command_alias'}{'contents'}[0]{'args'}[0];
+$result_trees{'block_command_alias'}{'contents'}[0]{'args'}[0]{'contents'}[1]{'parent'}
= $result_trees{'block_command_alias'}{'contents'}[0]{'args'}[0];
+$result_trees{'block_command_alias'}{'contents'}[0]{'args'}[0]{'contents'}[2]{'parent'}
= $result_trees{'block_command_alias'}{'contents'}[0]{'args'}[0];
+$result_trees{'block_command_alias'}{'contents'}[0]{'args'}[0]{'parent'} =
$result_trees{'block_command_alias'}{'contents'}[0];
+$result_trees{'block_command_alias'}{'contents'}[0]{'parent'} =
$result_trees{'block_command_alias'};
+$result_trees{'block_command_alias'}{'contents'}[1]{'parent'} =
$result_trees{'block_command_alias'};
+$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[0]{'extra'}{'command'}
= $result_trees{'block_command_alias'}{'contents'}[2];
+$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[0]{'parent'} =
$result_trees{'block_command_alias'}{'contents'}[2];
+$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'contents'}[0]{'parent'}
= $result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1];
+$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'contents'}[1]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
=
$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'contents'}[1];
+$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'contents'}[1]{'args'}[0];
+$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'contents'}[1]{'args'}[0]{'contents'}[1]{'parent'}
=
$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'contents'}[1]{'args'}[0];
+$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'contents'}[1]{'args'}[0]{'contents'}[2]{'parent'}
=
$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'contents'}[1]{'args'}[0];
+$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'contents'}[1]{'args'}[0]{'parent'}
=
$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'contents'}[1];
+$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'contents'}[1]{'parent'}
= $result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1];
+$result_trees{'block_command_alias'}{'contents'}[2]{'contents'}[1]{'parent'} =
$result_trees{'block_command_alias'}{'contents'}[2];
+$result_trees{'block_command_alias'}{'contents'}[2]{'parent'} =
$result_trees{'block_command_alias'};
+
+$result_texis{'block_command_alias'} = '@alias lang=lisp
+
address@hidden
+in lang
address@hidden lang
address@hidden lisp
+';
+
+
+$result_texts{'block_command_alias'} = '
+in lang
+';
+
+$result_errors{'block_command_alias'} = [
+ {
+ 'error_line' => ':1: warning: Environment command lisp as argument to
@alias
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => 'Environment command lisp as argument to @alias',
+ 'type' => 'warning'
+ },
+ {
+ 'error_line' => ':5: warning: Unknown @end lang
+',
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => '',
+ 'text' => 'Unknown @end lang',
+ 'type' => 'warning'
+ },
+ {
+ 'error_line' => ':5: No matching address@hidden lisp\'
+',
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => '',
+ 'text' => 'No matching address@hidden lisp\'',
+ 'type' => 'error'
+ }
+];
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp TODO Texinfo/Parser.pm t/58alias.t t...,
Patrice Dumas <=