From 5ccf330e4c0912bbca921fd5ac76aa89c0e195b9 Mon Sep 17 00:00:00 2001
From: Fred Drake <fdrake@acm.org>
Date: Fri, 17 Apr 1998 20:04:09 +0000
Subject: next_optional_argument():  Don't include the square brackets in the
 return 	value.

ArabictoRoman():  Acquired function from Robert Donohue
	<donahue@cfassp48.harvard.edu>; might be useful someday, and I don't
	want to figure it out again!
---
 Doc/perl/python.perl | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl
index b7c425a..08ed98a 100644
--- a/Doc/perl/python.perl
+++ b/Doc/perl/python.perl
@@ -24,7 +24,7 @@ sub next_argument{
 
 sub next_optional_argument{
     my($param,$rx) = ('', "^\\s*(\\[([^]]*)\\])?");
-    s/$rx/$param=$1;''/eo;
+    s/$rx/$param=$2;''/eo;
     $param;
 }
 
@@ -32,6 +32,29 @@ sub swallow_newline{
     s/[\n]?//o;
 }
 
+sub ArabictoRoman {
+    # Written by Robert Donohue <donahue@cfassp48.harvard.edu>,
+    # fixed by Fred Drake <fdrake@acm.org>,
+    # kept around in case it becomes useful.
+    my $a = @_;
+    my($b,@c,$i);
+    my(@D0,@D1,@D2);
+
+    @D0 = ("", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX");
+    @D1 = ("", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC");
+    @D2 = ("", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM");
+
+    $b = $a;
+    $i = 0;
+    while($b > 0) {
+	$c[$i] = ($b % 10);
+	$b -= ($b % 10);
+	$b /= 10;
+	$i++;
+    }
+    $D2[$c[2]] . $D1[$c[1]] . $D0[$c[0]];
+}
+
 # words typeset in a special way (not in HTML though)
 
 sub do_cmd_ABC{ 'ABC' . @_[0]; }
@@ -600,6 +623,21 @@ sub do_env_memberdesc{
 }
 
 
+sub do_cmd_memberline{
+    local($_) = @_;
+    my $class = next_optional_argument();
+    my($member,$br_id) = next_argument_id();
+    $class = $THIS_CLASS
+        unless $class;
+    my $extra = '';
+    $extra = " ($class_name attribute)"
+        if (!($class eq ''));
+    my $idx = make_str_index_entry($br_id, "<tt>$member</tt>$extra");
+    $idx =~ s/ \(.*\)//;
+    $idx =~ s/\(\)//;
+    "<dt><b>$idx</b><dd>" . $_;
+}
+
 sub do_env_memberdescni{
     local($_) = @_;
     next_optional_argument();
@@ -608,6 +646,13 @@ sub do_env_memberdescni{
 }
 
 
+sub do_cmd_memberlineni{
+    local($_) = @_;
+    next_optional_argument();
+    my $member = next_argument();
+    "<dt><b>$member</b><dd>" . $_;
+}
+
 @col_aligns = ("<td>", "<td>", "<td>");
 
 sub setup_column_alignments{
-- 
cgit v0.12

