From 7c4cba8325cefae4043bda69aa3dc83a8c015256 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Wed, 3 Dec 1997 19:45:08 +0000 Subject: Added handler for opcodedesc environment. Fixed weird index behavior. --- Doc/myformat.perl | 108 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 67 insertions(+), 41 deletions(-) diff --git a/Doc/myformat.perl b/Doc/myformat.perl index 07d6428..c6cf327 100644 --- a/Doc/myformat.perl +++ b/Doc/myformat.perl @@ -27,13 +27,13 @@ sub do_cmd_e{ local($_) = @_; '\' . $_; } sub do_cmd_optional{ local($_) = @_; - s/$any_next_pair_pr_rx/<\/VAR>\[<\/BIG>\2<\/VAR>\]<\/BIG>/; + s/$any_next_pair_pr_rx/<\/var>\[<\/big>\2<\/var>\]<\/big>/; $_; } sub do_cmd_varvars{ local($_) = @_; - s/$any_next_pair_pr_rx/\2<\/VAR>/; + s/$any_next_pair_pr_rx/\2<\/var>/; $_; } @@ -41,7 +41,7 @@ sub do_cmd_varvars{ sub do_cmd_code{ local($_) = @_; - s/$any_next_pair_pr_rx/\2<\/CODE>/; + s/$any_next_pair_pr_rx/\2<\/code>/; $_; } @@ -49,52 +49,42 @@ sub do_cmd_sectcode{ &do_cmd_code(@_); } sub do_cmd_kbd{ local($_) = @_; - s/$any_next_pair_pr_rx/\2<\/KBD>/; + s/$any_next_pair_pr_rx/\2<\/kbd>/; $_; } sub do_cmd_key{ local($_) = @_; - s/$any_next_pair_pr_rx/\2<\/TT>/; - $_; -} - -sub do_cmd_samp{ - local($_) = @_; - s/$any_next_pair_pr_rx/`\2<\/SAMP>'/; + s/$any_next_pair_pr_rx/\2<\/tt>/; $_; } sub do_cmd_var{ local($_) = @_; - s/$any_next_pair_pr_rx/\2<\/VAR>/; - $_; -} - -sub do_cmd_file{ - local($_) = @_; - s/$any_next_pair_pr_rx/`\2<\/CODE>'/; + s/$any_next_pair_pr_rx/\2<\/var>/; $_; } sub do_cmd_dfn{ local($_) = @_; - s/$any_next_pair_pr_rx/\2<\/DFN><\/I>/; + s/$any_next_pair_pr_rx/\2<\/dfn><\/i>/; $_; } sub do_cmd_emph{ local($_) = @_; - s/$any_next_pair_pr_rx/\2<\/EM>/; + s/$any_next_pair_pr_rx/\2<\/em>/; $_; } sub do_cmd_strong{ local($_) = @_; - s/$any_next_pair_pr_rx/\2<\/STRONG>/; + s/$any_next_pair_pr_rx/\2<\/strong>/; $_; } +# file and samp are at the end of this file since they screw up fontlock. + # index commands sub do_cmd_indexii{ @@ -182,7 +172,7 @@ sub get_indexsubitem{ sub do_env_cfuncdesc{ local($_) = @_; - local($return_type,$function_name,$arg_list) = ('', '', ''); + local($return_type,$function_name,$arg_list,$idx) = ('', '', '', ''); local($cfuncdesc_rx) = "$next_pair_rx$any_next_pair_rx3$any_next_pair_rx5"; $* = 1; @@ -190,11 +180,12 @@ sub do_env_cfuncdesc{ $return_type = "$2"; $function_name = "$4"; $arg_list = "$6"; - &make_index_entry($3,"$function_name " . &get_indexsubitem); + $idx = &make_str_index_entry($3, + "$function_name " . &get_indexsubitem); } $* = 0; - "
$return_type $function_name" . - "($arg_list)\n
$'\n
" + "
$return_type $idx" . + "($arg_list)\n
$'\n
" } sub do_env_ctypedesc{ @@ -205,68 +196,89 @@ sub do_env_ctypedesc{ $* = 1; if (/$cfuncdesc_rx/o) { $type_name = "$2"; - &make_index_entry($1,"$var_name " . &get_indexsubitem); + $idx = &make_str_index_entry($1, + "$type_name " . &get_indexsubitem); } $* = 0; - "
$type_name\n
$'\n
" + "
$idx\n
$'\n
" } sub do_env_cvardesc{ local($_) = @_; - local($var_type,$var_name) = ('', ''); + local($var_type,$var_name,$idx) = ('', '', ''); local($cfuncdesc_rx) = "$next_pair_rx$any_next_pair_rx3"; $* = 1; if (/$cfuncdesc_rx/o) { $var_type = "$2"; $var_name = "$4"; - &make_index_entry($3,"$var_name " . &get_indexsubitem); + $idx = &make_str_index_entry($3,"$var_name " . &get_indexsubitem); } $* = 0; - "
$var_type $var_name\n" . - "
$'\n
" + "
$var_type $idx\n" . + "
$'\n
"; } sub do_env_funcdesc{ local($_) = @_; - local($function_name,$arg_list) = ('', ''); + local($function_name,$arg_list,$idx) = ('', '', ''); local($funcdesc_rx) = "$next_pair_rx$any_next_pair_rx3"; $* = 1; if (/$funcdesc_rx/o) { $function_name = "$2"; $arg_list = "$4"; - &make_index_entry($1,"$function_name " . &get_indexsubitem); + $idx = &make_str_index_entry($3, + "$function_name " . &get_indexsubitem); + } + $* = 0; + "
$idx ($arg_list)\n
$'\n
"; +} + +sub do_env_opcodedesc{ + local($_) = @_; + local($opcode_name,$arg_list,$stuff,$idx) = ('', '', '', ''); + local($opcodedesc_rx) = "$next_pair_rx$any_next_pair_rx3"; + $* = 1; + if (/$opcodedesc_rx/o) { + $opcode_name = "$2"; + $arg_list = "$4"; + $idx = &make_str_index_entry($3, + "$opcode_name (byte code instruction)"); } $* = 0; - "
$function_name" . - "($arg_list)\n
$'\n
" + $stuff = "
$idx"; + if ($arg_list) { + $stuff = "$stuff    $arg_list"; + } + $stuff . "\n
$'\n
"; } sub do_env_datadesc{ local($_) = @_; - local($data_name) = ('', ''); + local($data_name,$idx) = ('', ''); local($datadesc_rx) = "$next_pair_rx"; $* = 1; if (/$datadesc_rx/o) { $data_name = "$2"; - &make_index_entry($1,"$data_name " . &get_indexsubitem); + $idx = &make_str_index_entry($3, + "$data_name " . &get_indexsubitem); } $* = 0; - "
$data_name" . - "\n
$'\n
" + "
$idx" . + "\n
$'\n
" } sub do_env_excdesc{ &do_env_datadesc(@_); } sub do_env_seealso{ local($_) = @_; - "

See Also:

\n" . $_; + "

See Also:

\n" . $_; } sub do_cmd_seemodule{ local($_) = @_; local($any_next_pair_pr_rx3) = "$OP(\\d+)$CP([\\s\\S]*)$OP\\3$CP"; - s/$next_pair_pr_rx$any_next_pair_pr_rx3/

\2<\/B><\/CODE> (\4)<\/P>/; + s/$next_pair_pr_rx$any_next_pair_pr_rx3/

\2<\/b><\/code> (\4)<\/p>/; $_; } @@ -275,4 +287,18 @@ sub do_cmd_seetext{ "

" . $_; } +# These are located down here since they screw up fontlock. + +sub do_cmd_file{ + local($_) = @_; + s/$any_next_pair_pr_rx/`\2<\/code>'/; + $_; +} + +sub do_cmd_samp{ + local($_) = @_; + s/$any_next_pair_pr_rx/`\2<\/samp>'/; + $_; +} + 1; # This must be the last line -- cgit v0.12