[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo tp/TODO tp/Texinfo/Common.pm tp/Texinfo...
From: |
Patrice Dumas |
Subject: |
texinfo tp/TODO tp/Texinfo/Common.pm tp/Texinfo... |
Date: |
Mon, 12 Dec 2011 22:45:00 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/12/12 22:45:00
Modified files:
tp : TODO
tp/Texinfo : Common.pm Parser.pm
tp/t : 60macro.t
util : txicmdlist
Added files:
tp/t/results/macro: redefine_texinfo_macro.pl
Log message:
Warn when redefining texinfo language @-commands.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.229&r2=1.230
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Common.pm?cvsroot=texinfo&r1=1.103&r2=1.104
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.340&r2=1.341
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/60macro.t?cvsroot=texinfo&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/redefine_texinfo_macro.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/util/txicmdlist?cvsroot=texinfo&r1=1.3&r2=1.4
Patches:
Index: tp/TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.229
retrieving revision 1.230
diff -u -b -r1.229 -r1.230
--- tp/TODO 3 Dec 2011 18:44:22 -0000 1.229
+++ tp/TODO 12 Dec 2011 22:44:58 -0000 1.230
@@ -86,6 +86,12 @@
Future features
===============
+Add some elements of texinfo that are not of interest in the
+tree, like beginning and end of included file, @ protecting
+end of line in @def*, begin and end of user defined macro
+or value expansion. Maybe call the key for these elements
+'sourcemark'?
+
Right now VERBOSE is almost not used.
Handle better @exdent in html? (there is a FIXME in the code)
Index: tp/Texinfo/Common.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Common.pm,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -b -r1.103 -r1.104
--- tp/Texinfo/Common.pm 4 Dec 2011 02:55:20 -0000 1.103
+++ tp/Texinfo/Common.pm 12 Dec 2011 22:44:59 -0000 1.104
@@ -729,6 +729,17 @@
$root_commands{'node'} = 1;
+our %all_commands;
+foreach my $command (
+ keys(%Texinfo::Common::block_commands),
+ keys(%Texinfo::Common::brace_commands),
+ keys(%Texinfo::Common::misc_commands),
+ keys(%Texinfo::Common::no_brace_commands),
+ qw(value),
+ ) {
+ $all_commands{$command} = 1;
+}
+
our @MONTH_NAMES =
(
'January', 'February', 'March', 'April', 'May',
@@ -1385,6 +1396,10 @@
=over
+=item %all_commands
+
+All the @-commands.
+
=item %no_brace_commands
Commands without brace with a single character as name, like C<*>
Index: tp/Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.340
retrieving revision 1.341
diff -u -b -r1.340 -r1.341
--- tp/Texinfo/Parser.pm 8 Dec 2011 20:34:41 -0000 1.340
+++ tp/Texinfo/Parser.pm 12 Dec 2011 22:44:59 -0000 1.341
@@ -258,6 +258,7 @@
my %code_style_commands = %Texinfo::Common::code_style_commands;
my %in_heading_commands = %Texinfo::Common::in_heading_commands;
my %explained_commands = %Texinfo::Common::explained_commands;
+my %all_commands = %Texinfo::Common::all_commands;
my %keep_line_nr_brace_commands = %context_brace_commands;
foreach my $keep_line_nr_brace_command ('titlefont', 'anchor') {
@@ -3392,6 +3393,10 @@
$self->line_warn (sprintf($self->__("here is the previous
definition of `%s'"),
$name),
$self->{'macros'}->{$name}->{'line_nr'});
}
+ if ($all_commands{$name}) {
+ $self->line_warn (sprintf($self->__("Redefining Texinfo
language command address@hidden"),
+ $name), $current->{'line_nr'});
+ }
$self->{'macros'}->{$current->{'args'}->[0]->{'text'}} = $current
unless ($current->{'extra'}->{'invalid_syntax'});
}
Index: tp/t/60macro.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/60macro.t,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- tp/t/60macro.t 15 Oct 2011 19:52:46 -0000 1.35
+++ tp/t/60macro.t 12 Dec 2011 22:44:59 -0000 1.36
@@ -935,7 +935,14 @@
@end macro
@witherror{aaa}
-']
+'],
+['redefine_texinfo_macro',
+'@macro code{arg}
address@hidden
address@hidden macro
+
address@hidden
+'],
);
my @todo =(
Index: util/txicmdlist
===================================================================
RCS file: /sources/texinfo/texinfo/util/txicmdlist,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- util/txicmdlist 27 Mar 2011 14:20:25 -0000 1.3
+++ util/txicmdlist 12 Dec 2011 22:44:59 -0000 1.4
@@ -26,12 +26,4 @@
use Texinfo::Common;
-my @all_commands = (
- keys(%Texinfo::Common::block_commands),
- keys(%Texinfo::Common::brace_commands),
- keys(%Texinfo::Common::misc_commands),
- keys(%Texinfo::Common::no_brace_commands),
- qw(value),
-);
-
-print map { "address@hidden" } sort (@all_commands);
+print map { "address@hidden" } sort (keys(%Texinfo::Common::all_commands));
Index: tp/t/results/macro/redefine_texinfo_macro.pl
===================================================================
RCS file: tp/t/results/macro/redefine_texinfo_macro.pl
diff -N tp/t/results/macro/redefine_texinfo_macro.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tp/t/results/macro/redefine_texinfo_macro.pl 12 Dec 2011 22:44:59
-0000 1.1
@@ -0,0 +1,143 @@
+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{'redefine_texinfo_macro'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'parent' => {},
+ 'text' => 'code',
+ 'type' => 'macro_name'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'arg',
+ 'type' => 'macro_arg'
+ }
+ ],
+ 'cmdname' => 'macro',
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '@emph{\\arg\\}',
+ 'type' => 'raw'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'last_raw_newline'
+ }
+ ],
+ 'extra' => {
+ 'arg_line' => ' code{arg}
+',
+ 'args_index' => {
+ 'arg' => 0
+ },
+ 'macrobody' => '@emph{\\arg\\}
+'
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ },
+ {
+ 'extra' => {
+ 'command' => {}
+ },
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'code'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'emph',
+ 'contents' => [],
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => 'code'
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'redefine_texinfo_macro'}{'contents'}[0]{'args'}[0]{'parent'} =
$result_trees{'redefine_texinfo_macro'}{'contents'}[0];
+$result_trees{'redefine_texinfo_macro'}{'contents'}[0]{'args'}[1]{'parent'} =
$result_trees{'redefine_texinfo_macro'}{'contents'}[0];
+$result_trees{'redefine_texinfo_macro'}{'contents'}[0]{'contents'}[0]{'parent'}
= $result_trees{'redefine_texinfo_macro'}{'contents'}[0];
+$result_trees{'redefine_texinfo_macro'}{'contents'}[0]{'contents'}[1]{'parent'}
= $result_trees{'redefine_texinfo_macro'}{'contents'}[0];
+$result_trees{'redefine_texinfo_macro'}{'contents'}[0]{'parent'} =
$result_trees{'redefine_texinfo_macro'};
+$result_trees{'redefine_texinfo_macro'}{'contents'}[1]{'extra'}{'command'} =
$result_trees{'redefine_texinfo_macro'}{'contents'}[0];
+$result_trees{'redefine_texinfo_macro'}{'contents'}[1]{'parent'} =
$result_trees{'redefine_texinfo_macro'};
+$result_trees{'redefine_texinfo_macro'}{'contents'}[2]{'parent'} =
$result_trees{'redefine_texinfo_macro'};
+$result_trees{'redefine_texinfo_macro'}{'contents'}[3]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'redefine_texinfo_macro'}{'contents'}[3]{'contents'}[0]{'args'}[0];
+$result_trees{'redefine_texinfo_macro'}{'contents'}[3]{'contents'}[0]{'args'}[0]{'parent'}
= $result_trees{'redefine_texinfo_macro'}{'contents'}[3]{'contents'}[0];
+$result_trees{'redefine_texinfo_macro'}{'contents'}[3]{'contents'}[0]{'parent'}
= $result_trees{'redefine_texinfo_macro'}{'contents'}[3];
+$result_trees{'redefine_texinfo_macro'}{'contents'}[3]{'contents'}[1]{'parent'}
= $result_trees{'redefine_texinfo_macro'}{'contents'}[3];
+$result_trees{'redefine_texinfo_macro'}{'contents'}[3]{'parent'} =
$result_trees{'redefine_texinfo_macro'};
+
+$result_texis{'redefine_texinfo_macro'} = '@macro code{arg}
address@hidden
address@hidden macro
+
address@hidden
+';
+
+
+$result_texts{'redefine_texinfo_macro'} = '
+code
+';
+
+$result_errors{'redefine_texinfo_macro'} = [
+ {
+ 'error_line' => ':1: warning: Redefining Texinfo language command @code
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => 'Redefining Texinfo language command @code',
+ 'type' => 'warning'
+ }
+];
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo tp/TODO tp/Texinfo/Common.pm tp/Texinfo...,
Patrice Dumas <=