[Python-checkins] CVS: python/dist/src/Doc/perl python.perl,1.83,1.84
Fred L. Drake
python-dev@python.org
Thu, 14 Sep 2000 13:17:26 -0700
Update of /cvsroot/python/python/dist/src/Doc/perl
In directory slayer.i.sourceforge.net:/tmp/cvs-serv16071/perl
Modified Files:
python.perl
Log Message:
do_cmd_shortversion(),
do_cmd_setshortversion(): Implementation for new markup.
convert_args(): New helper function.
do_cmd_optional(): Modified to understand when it is called from within
a convert_args() invocation.
do_env_funcdesc(),
do_env_funcdescni(),
do_cmd_funcline(),
do_cmd_funclineni(),
handle_classlike_descriptor(),
do_env_methoddesc(),
do_end_methoddescni(),
do_cmd_methodline(),
do_cmd_methodlineni(): Modified to use helper convert_args().
The convert_args() helper and related changes fix the generation of HTML
for the \optional markup, so that bogus </var>...<var> is not generated.
This closes SourceForge bug #113800.
Index: python.perl
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -r1.83 -r1.84
*** python.perl 2000/09/12 17:52:33 1.83
--- python.perl 2000/09/14 20:17:23 1.84
***************
*** 72,78 ****
--- 72,80 ----
$DEVELOPER_ADDRESS = '';
+ $SHORT_VERSION = '';
$PYTHON_VERSION = '';
sub do_cmd_version{ $PYTHON_VERSION . @_[0]; }
+ sub do_cmd_shortversion{ $SHORT_VERSION . @_[0]; }
sub do_cmd_release{
local($_) = @_;
***************
*** 81,84 ****
--- 83,92 ----
}
+ sub do_cmd_setshortversion{
+ local($_) = @_;
+ $SHORT_VERSION = next_argument();
+ return $_;
+ }
+
sub do_cmd_authoraddress{
local($_) = @_;
***************
*** 110,116 ****
}
sub do_cmd_optional{
! return use_wrappers(@_[0], "</var><big>\[</big><var>",
! "</var><big>\]</big><var>");
}
--- 118,130 ----
}
+ $IN_DESC_HANDLER = 0;
sub do_cmd_optional{
! if ($IN_DESC_HANDLER) {
! return use_wrappers(@_[0], "</var><big>\[</big><var>",
! "</var><big>\]</big><var>");
! }
! else {
! return use_wrappers(@_[0], "<big>\[</big>", "<big>\]</big>");
! }
}
***************
*** 721,730 ****
}
sub do_env_funcdesc{
local($_) = @_;
my $function_name = next_argument();
! my $arg_list = next_argument();
my $idx = make_str_index_entry("<tt class='function'>$function_name()</tt>"
. get_indexsubitem());
$idx =~ s/ \(.*\)//;
$idx =~ s/\(\)<\/tt>/<\/tt>/;
--- 735,751 ----
}
+ sub convert_args($){
+ local($IN_DESC_HANDLER) = 1;
+ local($_) = @_;
+ return translate_commands($_);
+ }
+
sub do_env_funcdesc{
local($_) = @_;
my $function_name = next_argument();
! my $arg_list = convert_args(next_argument());
my $idx = make_str_index_entry("<tt class='function'>$function_name()</tt>"
. get_indexsubitem());
+ print "\n--- funcdesc arg_list:\n$arg_list\n===";
$idx =~ s/ \(.*\)//;
$idx =~ s/\(\)<\/tt>/<\/tt>/;
***************
*** 735,739 ****
local($_) = @_;
my $function_name = next_argument();
! my $arg_list = next_argument();
return "<dl><dt><b><tt class='function'>$function_name</tt></b>"
. " (<var>$arg_list</var>)\n"
--- 756,760 ----
local($_) = @_;
my $function_name = next_argument();
! my $arg_list = convert_args(next_argument());
return "<dl><dt><b><tt class='function'>$function_name</tt></b>"
. " (<var>$arg_list</var>)\n"
***************
*** 746,750 ****
local($_) = @_;
my $function_name = next_argument();
! my $arg_list = next_argument();
my $prefix = "<tt class='function'>$function_name()</tt>";
my $idx = make_str_index_entry($prefix . get_indexsubitem());
--- 767,771 ----
local($_) = @_;
my $function_name = next_argument();
! my $arg_list = convert_args(next_argument());
my $prefix = "<tt class='function'>$function_name()</tt>";
my $idx = make_str_index_entry($prefix . get_indexsubitem());
***************
*** 757,761 ****
local($_) = @_;
my $function_name = next_argument();
! my $arg_list = next_argument();
my $prefix = "<tt class='function'>$function_name</tt>";
--- 778,782 ----
local($_) = @_;
my $function_name = next_argument();
! my $arg_list = convert_args(next_argument());
my $prefix = "<tt class='function'>$function_name</tt>";
***************
*** 835,839 ****
local($_, $what) = @_;
$THIS_CLASS = next_argument();
! my $arg_list = next_argument();
$idx = make_str_index_entry(
"<tt class='$what'>$THIS_CLASS</tt> ($what in $THIS_MODULE)" );
--- 856,860 ----
local($_, $what) = @_;
$THIS_CLASS = next_argument();
! my $arg_list = convert_args(next_argument());
$idx = make_str_index_entry(
"<tt class='$what'>$THIS_CLASS</tt> ($what in $THIS_MODULE)" );
***************
*** 857,861 ****
unless $class_name;
my $method = next_argument();
! my $arg_list = next_argument();
my $extra = '';
if ($class_name) {
--- 878,882 ----
unless $class_name;
my $method = next_argument();
! my $arg_list = convert_args(next_argument());
my $extra = '';
if ($class_name) {
***************
*** 875,879 ****
unless $class_name;
my $method = next_argument();
! my $arg_list = next_argument();
my $extra = '';
if ($class_name) {
--- 896,900 ----
unless $class_name;
my $method = next_argument();
! my $arg_list = convert_args(next_argument());
my $extra = '';
if ($class_name) {
***************
*** 892,896 ****
next_optional_argument();
my $method = next_argument();
! my $arg_list = next_argument();
return "<dt><b>$method</b> (<var>$arg_list</var>)\n<dd>"
. $_;
--- 913,917 ----
next_optional_argument();
my $method = next_argument();
! my $arg_list = convert_args(next_argument());
return "<dt><b>$method</b> (<var>$arg_list</var>)\n<dd>"
. $_;
***************
*** 901,905 ****
next_optional_argument();
my $method = next_argument();
! my $arg_list = next_argument();
return "<dl><dt><b>$method</b> (<var>$arg_list</var>)\n<dd>"
. $_
--- 922,926 ----
next_optional_argument();
my $method = next_argument();
! my $arg_list = convert_args(next_argument());
return "<dl><dt><b>$method</b> (<var>$arg_list</var>)\n<dd>"
. $_