From 9597daf2200e4634af3acf7124bc391c070ba95e Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Mon, 22 Dec 1997 22:37:34 +0000 Subject: [PATCH] do_env_tableii(), do_cmd_lineii(), do_env_tableiii(), do_cmd_lineiii(): New functions to handle tableii and tableiii environments. Small changes to not add a superfluous space between a function name and the comma in the index. --- Doc/myformat.perl | 92 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 86 insertions(+), 6 deletions(-) diff --git a/Doc/myformat.perl b/Doc/myformat.perl index 1838de379ff..9ec56d244eb 100644 --- a/Doc/myformat.perl +++ b/Doc/myformat.perl @@ -183,12 +183,18 @@ sub do_cmd_refstmodindex{ &my_module_index_helper('standard', @_, 'REF'); } sub do_cmd_nodename{ &do_cmd_label(@_); } $any_next_pair_rx3 = "$O(\\d+)$C([\\s\\S]*)$O\\3$C"; +$any_next_pair_rx5 = "$O(\\d+)$C([\\s\\S]*)$O\\5$C"; +$any_next_pair_rx7 = "$O(\\d+)$C([\\s\\S]*)$O\\7$C"; +$any_next_pair_rx9 = "$O(\\d+)$C([\\s\\S]*)$O\\9$C"; +$any_next_pair_pr_rx_5 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\5$CP"; +$any_next_pair_pr_rx_7 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\7$CP"; +$any_next_pair_pr_rx_9 = "$OP(\\d+)$CP([\\s\\S]*)$OP\\9$CP"; $new_command{"indexsubitem"} = ""; sub get_indexsubitem{ local($result) = $new_command{"indexsubitem"}; #print "\nget_indexsubitem ==> $result\n"; - $result; + $result ? " $result" : ''; } # similar to make_index_entry(), but includes the string in the result @@ -216,7 +222,7 @@ sub do_env_cfuncdesc{ $function_name = "$4"; $arg_list = "$6"; $idx = &make_str_index_entry($3, - "$function_name " . &get_indexsubitem); + "$function_name" . &get_indexsubitem); } $* = 0; "
$return_type $idx" . @@ -232,7 +238,7 @@ sub do_env_ctypedesc{ if (/$cfuncdesc_rx/o) { $type_name = "$2"; $idx = &make_str_index_entry($1, - "$type_name " . &get_indexsubitem); + "$type_name" . &get_indexsubitem); } $* = 0; "
$idx\n
$'\n
" @@ -247,7 +253,7 @@ sub do_env_cvardesc{ if (/$cfuncdesc_rx/o) { $var_type = "$2"; $var_name = "$4"; - $idx = &make_str_index_entry($3,"$var_name " . &get_indexsubitem); + $idx = &make_str_index_entry($3,"$var_name" . &get_indexsubitem); } $* = 0; "
$var_type $idx\n" . @@ -263,7 +269,7 @@ sub do_env_funcdesc{ $function_name = "$2"; $arg_list = "$4"; $idx = &make_str_index_entry($3, - "$function_name " . &get_indexsubitem); + "$function_name" . &get_indexsubitem); } $* = 0; "
$idx ($arg_list)\n
$'\n
"; @@ -296,7 +302,7 @@ sub do_env_datadesc{ if (/$datadesc_rx/o) { $data_name = "$2"; $idx = &make_str_index_entry($3, - "$data_name " . &get_indexsubitem); + "$data_name" . &get_indexsubitem); } $* = 0; "
$idx" . @@ -305,6 +311,80 @@ sub do_env_datadesc{ sub do_env_excdesc{ &do_env_datadesc(@_); } +@col_aligns = ("", "", ""); + +sub setup_column_alignments{ + local($_) = @_; + local($j1,$a1,$a2,$a3,$j4) = split(/[|]/,$_); + $col_aligns[0] = (($a1 eq "c") ? "" : ""); + $col_aligns[1] = (($a2 eq "c") ? "" : ""); + $col_aligns[2] = (($a3 eq "c") ? "" : ""); +} + +sub do_env_tableii{ + local($_) = @_; + local($font,$h1,$h2) = ('', '', ''); + local($tableiii_rx) = + "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7"; + $* = 1; + if (/$tableiii_rx/o) { + &setup_column_alignments($2); + $font = $4; + $h1 = $6; + $h2 = $8; + } + $globals{"lineifont"} = $font; + "\n \n $'\n" + . "
$h1$h2
"; +} + +sub do_cmd_lineii{ + local($_) = @_; + s/$next_pair_pr_rx//o; + local($c1) = $2; + s/$next_pair_pr_rx//o; + local($c2) = $2; + local($font) = $globals{"lineifont"}; + local($c1align, $c2align) = @col_aligns[0,1]; + "$c1align<$font>$c1\n" + . " $c2align$c2$'"; +} + +sub do_env_tableiii{ + local($_) = @_; + local($font,$h1,$h2,$h3) = ('', '', '', ''); + local($tableiii_rx) = + "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5$any_next_pair_rx7" + . "$any_next_pair_rx9"; + $* = 1; + if (/$tableiii_rx/o) { + &setup_column_alignments($2); + $font = $4; + $h1 = $6; + $h2 = $8; + $h3 = $10; + } + $globals{"lineifont"} = $font; + "\n \n " + . "\n $'\n" + . "
$h1$h2$h3
"; +} + +sub do_cmd_lineiii{ + local($_) = @_; + s/$next_pair_pr_rx//o; + local($c1) = $2; + s/$next_pair_pr_rx//o; + local($c2) = $2; + s/$next_pair_pr_rx//o; + local($c3) = $2; + local($font) = $globals{"lineifont"}; + local($c1align, $c2align, $c3align) = @col_aligns; + "$c1align<$font>$c1\n" + . " $c2align$c2\n" + . " $c3align$c3$'"; +} + sub do_env_seealso{ local($_) = @_; "

See Also:

\n" . $_;