From a37cf289ab455e83661aaa83196cb58cd0082665 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 2 Aug 2023 00:40:04 +0100 Subject: Use modern Perl package separators Bug-Debian: https://bugs.debian.org/1042846 Forwarded: no Last-Update: 2023-08-02 Patch-Name: 008_modern_package_separators.diff --- bin/mif2rtf | 2 +- bin/sdf | 26 +-- bin/sdfget | 2 +- doc/guru/ex_filt.sdf | 8 +- doc/ref/sfindfil.html | 4 +- doc/ref/sfindfil.sdf | 10 +- perllib/sdf/app.pl | 2 +- perllib/sdf/calc.pl | 4 +- perllib/sdf/filters.pl | 182 +++++++++---------- perllib/sdf/home/stdlib/bugtrack.sdm | 2 +- perllib/sdf/home/stdlib/delphi.sdm | 58 +++--- perllib/sdf/home/stdlib/mif.sdn | 4 +- perllib/sdf/home/stdlib/misc.sdm | 6 +- perllib/sdf/home/stdlib/usecases.sdm | 2 +- perllib/sdf/macros.pl | 334 +++++++++++++++++------------------ perllib/sdf/misc.pl | 4 +- perllib/sdf/name.pl | 2 +- perllib/sdf/parse.pl | 194 ++++++++++---------- perllib/sdf/podmacs.pl | 4 +- perllib/sdf/post_mf6.pl | 2 +- perllib/sdf/subs.pl | 142 +++++++-------- perllib/sdf/tohtml.pl | 180 +++++++++---------- perllib/sdf/tolatex.pl | 40 ++--- perllib/sdf/tomif.pl | 160 ++++++++--------- perllib/sdf/topod.pl | 22 +-- perllib/sdf/tosgml.pl | 22 +-- perllib/sdf/totxt.pl | 20 +-- perllib/sdf/values.pl | 18 +- t/macro/inherit.sdf | 2 +- 29 files changed, 729 insertions(+), 729 deletions(-) diff --git a/bin/mif2rtf b/bin/mif2rtf index ba45e9e..895ea7e 100755 --- a/bin/mif2rtf +++ b/bin/mif2rtf @@ -3032,7 +3032,7 @@ sub panic { local($i,$_); local($p,$f,$l,$s,$h,$a,@a,@sub); for ($i = 1; ($p,$f,$l,$s,$h,$w) = caller($i); $i++) { - @a = @DB'args; + @a = @DB::args; for (@a) { if (/^StB\000/ && length($_) == length($_main{'_main'})) { $_ = sprintf("%s",$_); diff --git a/bin/sdf b/bin/sdf index 0504b34..93c833a 100755 --- a/bin/sdf +++ b/bin/sdf @@ -604,17 +604,17 @@ sub argPostProcess { # Ensure the necessary variables are exported to the 'user' package # Note: If post-processing is the only thing requested, the output # extension is taken from the input filename - $SDF_USER'short = (&NameSplit($ARGV))[1]; - $SDF_USER'long = &NameJoin($out_dir, $SDF_USER'short, ''); - $SDF_USER'out_ext = $out_ext eq '' ? (&NameSplit($ARGV))[2] : $out_ext; - $SDF_USER'width = $SDF_USER'var{'OPT_WIDTH'}; - $SDF_USER'title = $SDF_USER'var{'DOC_TITLE'}; - $SDF_USER'title =~ s/['\\]/\\$&/g; - $SDF_USER'project = $SDF_USER'var{'DOC_PROJECT'}; - $SDF_USER'project =~ s/['\\]/\\$&/g; - $SDF_USER'product = $SDF_USER'var{'DOC_PRODUCT'}; - $SDF_USER'product =~ s/['\\]/\\$&/g; - $SDF_USER'section = $SDF_USER'var{'DOC_SECTION'} || 1; + $SDF_USER::short = (&NameSplit($ARGV))[1]; + $SDF_USER::long = &NameJoin($out_dir, $SDF_USER::short, ''); + $SDF_USER::out_ext = $out_ext eq '' ? (&NameSplit($ARGV))[2] : $out_ext; + $SDF_USER::width = $SDF_USER::var{'OPT_WIDTH'}; + $SDF_USER::title = $SDF_USER::var{'DOC_TITLE'}; + $SDF_USER::title =~ s/['\\]/\\$&/g; + $SDF_USER::project = $SDF_USER::var{'DOC_PROJECT'}; + $SDF_USER::project =~ s/['\\]/\\$&/g; + $SDF_USER::product = $SDF_USER::var{'DOC_PRODUCT'}; + $SDF_USER::product =~ s/['\\]/\\$&/g; + $SDF_USER::section = $SDF_USER::var{'DOC_SECTION'} || 1; # Do the post processing for $action (@post_process) { @@ -625,9 +625,9 @@ sub argPostProcess { next if $verbose && $action =~ /clean/; &AppMsg("object", "'$action' post processing...") if $verbose >= 0; package SDF_USER; - eval $'post_processing{$'action}; + eval $::post_processing{$::action}; if ($@) { - &'AppMsg('abort', "error in '$action' post processing: $@"); + &::AppMsg('abort', "error in '$action' post processing: $@"); } } } diff --git a/bin/sdfget b/bin/sdfget index d6737d4..2df457e 100755 --- a/bin/sdfget +++ b/bin/sdfget @@ -267,7 +267,7 @@ sub argProcess { # Get the file extension my $filename = $ARGV eq '-' ? $formatting_filename : $ARGV; - my $ext = (&'NameSplit($filename))[2]; + my $ext = (&::NameSplit($filename))[2]; # Use the current file extension to guess the rule, if necessary my $rule = $get_rule; diff --git a/doc/guru/ex_filt.sdf b/doc/guru/ex_filt.sdf index f2f5c55..fb1d03b 100644 --- a/doc/guru/ex_filt.sdf +++ b/doc/guru/ex_filt.sdf @@ -110,7 +110,7 @@ sub define_Filter { local($family, $export, $name); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_define_FilterModel) if $validate; @@ -118,9 +118,9 @@ sub define_Filter { $family = $param{'family'}; $family .= '_' if $family ne ''; $export = $param{'export'}; - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); $name = $family . $values{'Name'}; push(@text, "!define $name $values{'Value'}"); push(@text, "!export $name") if $export; @@ -141,4 +141,4 @@ it looks for a file called {{filter_name}}.sdp and dynamically loads the filter from that file if it can. This feature is useful for complex filters which are rarely used. -See the {{FILE:stdlib/module.sdp}} file for an example. \ No newline at end of file +See the {{FILE:stdlib/module.sdp}} file for an example. diff --git a/doc/ref/sfindfil.html b/doc/ref/sfindfil.html index 92582df..51511ff 100644 --- a/doc/ref/sfindfil.html +++ b/doc/ref/sfindfil.html @@ -44,12 +44,12 @@ my @dirs = ('.'); my $dir = $var{'DOC_DIR'}; push(@dirs, $dir) if $dir ne cwd(); - push(@dirs, @include_path, "$'sdf_lib/stdlib", $'sdf_lib); + push(@dirs, @include_path, "$::sdf_lib/stdlib", $::sdf_lib); # Do the search if ($image) { my $context = $var{'OPT_TARGET'}; - my @exts = @{$'SDF_IMAGE_EXTS{$context} || $'SDF_IMAGE_EXTS{'ps'}}; + my @exts = @{$::SDF_IMAGE_EXTS{$context} || $::SDF_IMAGE_EXTS{'ps'}}; return &'NameFindOrGenerate($filename, \@dirs, \@exts, $context); } else { diff --git a/doc/ref/sfindfil.sdf b/doc/ref/sfindfil.sdf index 750e1ae..a9f46a3 100644 --- a/doc/ref/sfindfil.sdf +++ b/doc/ref/sfindfil.sdf @@ -44,16 +44,16 @@ sub FindFile { my @dirs = ('.'); my $dir = $var{'DOC_DIR'}; push(@dirs, $dir) if $dir ne cwd(); - push(@dirs, @include_path, "$'sdf_lib/stdlib", $'sdf_lib); + push(@dirs, @include_path, "$::sdf_lib/stdlib", $::sdf_lib); # Do the search if ($image) { my $context = $var{'OPT_TARGET'}; - my @exts = @{$'SDF_IMAGE_EXTS{$context} || $'SDF_IMAGE_EXTS{'ps'}}; - return &'NameFindOrGenerate($filename, \@dirs, \@exts, $context); + my @exts = @{$::SDF_IMAGE_EXTS{$context} || $::SDF_IMAGE_EXTS{'ps'}}; + return &::NameFindOrGenerate($filename, \@dirs, \@exts, $context); } else { - return &'NameFind($filename, @dirs); + return &::NameFind($filename, @dirs); } } !endblock @@ -69,7 +69,7 @@ sub FindFile { local($fullname); # Search using our SCM - $fullname = &'SearchSCM($filename, $image); + $fullname = &::SearchSCM($filename, $image); # Return result return $fullname; diff --git a/perllib/sdf/app.pl b/perllib/sdf/app.pl index 9a6aac9..0bd62fc 100644 --- a/perllib/sdf/app.pl +++ b/perllib/sdf/app.pl @@ -1707,7 +1707,7 @@ sub AppShowCallTree { local($i,$p,$f,$l,$s,$h,$a,@a,@sub); for ($i = 1; ($p,$f,$l,$s,$h,$w) = caller($i); $i++) { - @a = @DB'args; + @a = @DB::args; for (@a) { if (/^StB\000/ && length($_) == length($_main{'_main'})) { $_ = sprintf("%s",$_); diff --git a/perllib/sdf/calc.pl b/perllib/sdf/calc.pl index d9e18a8..581f0bc 100644 --- a/perllib/sdf/calc.pl +++ b/perllib/sdf/calc.pl @@ -426,7 +426,7 @@ sub _calc_expand_range { if ($_calc_ops{"$op"}) { $result .= $_calc_ops{"$op"} } else { - &'AppMsg('error', "unknown operator '$op'"); + &::AppMsg('error', "unknown operator '$op'"); #print STDERR "calc_expand_range:Unknown operator $op\n"; $result .= ","; } @@ -656,7 +656,7 @@ sub _calc_var_name { if ($_calc_cur_recurse > $_calc_max_recurse) { if ("$_calc_last_warning" ne "$_calc_cur_warning") { - &'AppMsg('warning', "CALC recursion limit reached '$_calc_cur_warning'"); + &::AppMsg('warning', "CALC recursion limit reached '$_calc_cur_warning'"); $_calc_last_warning="$_calc_cur_warning"; } $ret="CALCERROR"; diff --git a/perllib/sdf/filters.pl b/perllib/sdf/filters.pl index 3a4366c..00749bf 100755 --- a/perllib/sdf/filters.pl +++ b/perllib/sdf/filters.pl @@ -224,7 +224,7 @@ sub InitFilters { %jump = (); %jump_label = (); - $validate = $'verbose; + $validate = $::verbose; %sdf_attrs = (); @sdf_attr_stk = (); @@ -301,8 +301,8 @@ sub _FilterValidate { # It would be better not to parse this each time, but # as it only happens during validate mode, its not worth # caching the results just yet - @parsed_model = &'TableParse(@model); - &'TableValidate(*data, *parsed_model); + @parsed_model = &::TableParse(@model); + &::TableValidate(*data, *parsed_model); } # @@ -760,35 +760,35 @@ sub table_Filter { $param{'style'} = $style; # Activate event processing - &ReportEvents('table') if @'sdf_report_names; + &ReportEvents('table') if @::sdf_report_names; &ExecEventsStyleMask(*evcode_table, *evmask_table); - &ReportEvents('table', 'Post') if @'sdf_report_names; + &ReportEvents('table', 'Post') if @::sdf_report_names; # Parse the text into a table if (defined $param{'parseline'}) { unshift(@text, $param{'parseline'}); delete $param{'parseline'}; } - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); # Filter and sort the table, if requested if ($param{'where'} ne '') { - @tbl = &'TableFilter(*tbl, $param{'where'}, *var); + @tbl = &::TableFilter(*tbl, $param{'where'}, *var); delete $param{'where'}; } if ($param{'sort'} ne '') { @sort_by = $param{'sort'} == 1 ? () : split(/,/, $param{'sort'}); - @tbl = &'TableSort(*tbl, @sort_by); + @tbl = &::TableSort(*tbl, @sort_by); delete $param{'sort'}; } if ($param{'delete'} ne '') { @delete = split(/,/, $param{'delete'}); - @tbl = &'TableDeleteFields(*tbl, @delete); + @tbl = &::TableDeleteFields(*tbl, @delete); delete $param{'delete'}; } if ($param{'select'} ne '') { @select = split(/,/, $param{'select'}); - @tbl = &'TableSelectFields(*tbl, @select); + @tbl = &::TableSelectFields(*tbl, @select); delete $param{'select'}; } @@ -867,7 +867,7 @@ sub table_Filter { # Check the column count in the format is ok # (Note: TableFieldsCheck checks for duplicate columns) $tbl_header = shift @tbl; - @flds = &'TableFieldsCheck($tbl_header); + @flds = &::TableFieldsCheck($tbl_header); $tbl_cols = scalar(@flds); # Calculate the row number of the first body row @@ -888,7 +888,7 @@ sub table_Filter { $cell =~ s/_(_*)/$& eq '_' ? ' ' : $1/eg if $nice_hdgs; $default_heading{$fld} = $cell; } - unshift(@tbl, &'TableRecJoin(*flds, %default_heading)); + unshift(@tbl, &::TableRecJoin(*flds, %default_heading)); $body_start = 1; } @@ -944,14 +944,14 @@ sub table_Filter { %cover = (); $actual_cols = $tbl_cols; $actual_cols *= $wrap if $wrap; - @sdf = ("!table $actual_cols;" . &'SdfAttrJoin(*param)); + @sdf = ("!table $actual_cols;" . &::SdfAttrJoin(*param)); for $rec (@tbl) { if ($rec =~ /^!/) { push(@sdf, $rec); next; } - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); cell: for ($col = 0; $col <= $#flds; $col++) { $fld = $flds[$col]; @@ -994,7 +994,7 @@ sub table_Filter { # If this cell is covered by the span of another, # check that it is blank if ($hidden && $cell ne '') { - &'AppMsg("warning", "ignoring hidden cell ($row,$col)='$cell'"); + &::AppMsg("warning", "ignoring hidden cell ($row,$col)='$cell'"); } # Get the custom cell attributes, if any. @@ -1002,11 +1002,11 @@ sub table_Filter { # although the top line may contain other cell attributes %cell = (); if (substr($cell, 0, 1) eq "\n") { - ($cell, %cell) = &'SdfParseCell(substr($cell, 1)); + ($cell, %cell) = &::SdfParseCell(substr($cell, 1)); $cell{'sdf'} = 1; } else { - ($cell, %cell) = &'SdfParseCell($cell); + ($cell, %cell) = &::SdfParseCell($cell); } # Enable spreadsheet-like access/calculations @@ -1038,7 +1038,7 @@ sub table_Filter { if ($oncell) { eval $oncell; if ($@) { - &'AppMsg("error", "oncell processing failed: $@"); + &::AppMsg("error", "oncell processing failed: $@"); } } @@ -1070,7 +1070,7 @@ sub table_Filter { # Add the cell delete $cell{'tag'}; - push(@sdf, "!cell " . &'SdfAttrJoin(*cell), split("\n", $cell)); + push(@sdf, "!cell " . &::SdfAttrJoin(*cell), split("\n", $cell)); } # We only increment the row number for non-macro rows @@ -1180,17 +1180,17 @@ sub topics_Filter { local($file); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_topics_FilterModel) if $validate; # Get the list of fields - @flds = &'TableFields(shift @tbl); + @flds = &::TableFields(shift @tbl); # If this is topics data, store it if ($param{'data'}) { for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); $file = $values{'Topic'}; $topic_label{$file} = $values{'Label'}; $topic_level{$file} = $values{'Level'}; @@ -1206,12 +1206,12 @@ sub topics_Filter { if ($var{'HTML_SUBTOPICS_MODE'}) { push(@text, $param{'intro'}) if $param{'intro'} ne ''; for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); $topic = $values{'Topic'}; $file = $topic; # this next line is needed once topics mode supports files # outside the current directory - #$file = &'NameAbsolute(&FindFile("$topic.sdf")); + #$file = &::NameAbsolute(&FindFile("$topic.sdf")); $label = $values{'Label'} ? $values{'Label'} : $topic_label{$file}; $label = $topic if $label eq ''; #push(@text, "L1[jump='$topic.html'] $label"); @@ -1224,7 +1224,7 @@ sub topics_Filter { # Otherwise, include the topics as subsections else { for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); $topic = $values{'Topic'}; push(@text, "!include '$topic.sdf'"); } @@ -1249,16 +1249,16 @@ sub jumps_Filter { local($jump); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_jumps_FilterModel) if $validate; # Get the list of fields - @flds = &'TableFields(shift @tbl); + @flds = &::TableFields(shift @tbl); # Store the data for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); $jump = $values{'Jump'}; $jump{$jump} = $values{'Physical'}; } @@ -1356,7 +1356,7 @@ sub box_Filter { delete $param{'fill'}; } if (%param) { - $params .= '; ' . &'SdfAttrJoin(*param); + $params .= '; ' . &::SdfAttrJoin(*param); } @text = ("!block table; $params", 'Dummy', '<<', @text, '>>', '!endblock'); } @@ -1383,7 +1383,7 @@ sub namevalues_Filter { local($width); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); &_FilterValidate(*tbl, *_namevalues_FilterModel) if $validate; # Decide on the format @@ -1410,9 +1410,9 @@ sub namevalues_Filter { } else { @text = (); - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); push(@text, "NV[label='$values{'Name'}\\t']$values{'Value'}"); } } @@ -1435,7 +1435,7 @@ sub define_Filter { local($family, $export, $name); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_define_FilterModel) if $validate; @@ -1443,9 +1443,9 @@ sub define_Filter { $family = $param{'family'}; $family .= '_' if $family ne ''; $export = $param{'export'}; - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); $name = $family . $values{'Name'}; push(@text, "!define $name $values{'Value'}"); push(@text, "!export $name") if $export; @@ -1469,7 +1469,7 @@ sub default_Filter { local($family, $export, $name); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_default_FilterModel) if $validate; @@ -1477,9 +1477,9 @@ sub default_Filter { $family = $param{'family'}; $family .= '_' if $family ne ''; $export = $param{'export'}; - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); $name = $family . $values{'Name'}; push(@text, "!default $name $values{'Value'}"); push(@text, "!export $name") if $export && !$export{$name}; @@ -1494,7 +1494,7 @@ sub script_Filter { # execute the code eval join("\n", @text); if ($@) { - &'AppMsg("error", "script failed: $@"); + &::AppMsg("error", "script failed: $@"); } @text = (); } @@ -1563,7 +1563,7 @@ sub end_Filter { local(*text, %param) = @_; # We prepend a blank line so that multiple end sections remain separate. - unshift(@'sdf_end, '', @text); + unshift(@::sdf_end, '', @text); @text = (); } @@ -1662,7 +1662,7 @@ sub hlp_header_Filter { local($item, @items,$thetext); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_hlp_header_FilterModel) if $validate; @@ -1670,9 +1670,9 @@ sub hlp_header_Filter { return unless $var{'OPT_TARGET'} eq 'hlp'; # Process the data - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); $thetext=$values{'Text'}; if ($values{'Kind'} eq 'jump') { $item = "{{N[jump='#jump_${topic}_$thetext';size='8 pt'] $thetext}}"; @@ -1731,14 +1731,14 @@ sub docstyles_Filter { local($to); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_docstyles_FilterModel) if $validate; # Process the data - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # Update the declaration, if necessary $name = $values{'Name'}; @@ -1774,16 +1774,16 @@ sub variables_Filter { local($family, @fullname); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_variables_FilterModel) if $validate; # Process the data @family = split(/,/, $param{'family'}); $export = $param{'export'}; - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # Update the declaration $name = $values{'Name'}; @@ -1827,14 +1827,14 @@ sub parastyles_Filter { local($to); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_parastyles_FilterModel) if $validate; # Process the data - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # Update the declaration, if necessary $name = $values{'Name'}; @@ -1874,15 +1874,15 @@ sub paraattrs_Filter { local($to, $map, $attrs); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_paraattrs_FilterModel) if $validate; # Process the data $family = $param{'family'} ne '' ? "$param{'family'}." : ''; - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # Update the declaration, if necessary $name = $family . $values{'Name'}; @@ -1921,14 +1921,14 @@ sub phrasestyles_Filter { local($proxy); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_phrasestyles_FilterModel) if $validate; # Process the data - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # Update the declaration, if necessary $name = $values{'Name'}; @@ -1945,7 +1945,7 @@ sub phrasestyles_Filter { $to = $phrasestyles_to{$proxy}; } else { - &'AppMsg("warning", "unknown phrase style $proxy '$proxy"); + &::AppMsg("warning", "unknown phrase style $proxy '$proxy"); $to = $proxy; } } @@ -1979,16 +1979,16 @@ sub phraseattrs_Filter { local($to, $map, $attrs); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_phraseattrs_FilterModel) if $validate; # Process the data $family = $param{'family'} ne '' ? "$param{'family'}." : ''; $para = $param{'para'}; - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # Update the declaration, if necessary $name = $family . $values{'Name'}; @@ -2032,14 +2032,14 @@ sub tablestyles_Filter { local($to); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_tablestyles_FilterModel) if $validate; # Process the data - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # Update the declaration, if necessary $name = $values{'Name'}; @@ -2077,15 +2077,15 @@ sub tableparams_Filter { local($to, $map, $params); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_tableparams_FilterModel) if $validate; # Process the data $family = $param{'family'} ne '' ? "$param{'family'}." : ''; - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # Update the declaration, if necessary $name = $family . $values{'Name'}; @@ -2130,15 +2130,15 @@ sub rowparams_Filter { local($to, $map, $params); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_rowparams_FilterModel) if $validate; # Process the data $family = $param{'family'} ne '' ? "$param{'family'}." : ''; - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # Update the declaration, if necessary $name = $family . $values{'Name'}; @@ -2183,15 +2183,15 @@ sub cellparams_Filter { local($to, $map, $params); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_cellparams_FilterModel) if $validate; # Process the data $family = $param{'family'} ne '' ? "$param{'family'}." : ''; - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # Update the declaration, if necessary $name = $family . $values{'Name'}; @@ -2231,19 +2231,19 @@ sub targetobjects_Filter { local(%attrs); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_targetobjects_FilterModel) if $validate; # Process the data $type = $param{'type'}; - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); - %attrs = &'SdfAttrSplit($values{'Attributes'}); + %values = &::TableRecSplit(*flds, $rec); + %attrs = &::SdfAttrSplit($values{'Attributes'}); $attrs{'Name'} = $values{'Name'}; $attrs{'Parent'} = $values{'Parent'}; - push(@text, &'SdfJoin("__object", $type, %attrs)); + push(@text, &::SdfJoin("__object", $type, %attrs)); } } @@ -2261,14 +2261,14 @@ sub datestrings_Filter { local($strings); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_datestrings_FilterModel) if $validate; # Process the data - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); $strings = [ split(/\s+/, eval $values{'Values'}) ]; $main::misc_date_strings{$values{'Symbol'}} = $strings; } @@ -2287,15 +2287,15 @@ sub meta_Filter { local(@tbl, @flds, $rec, %values); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_meta_FilterModel) if $validate; # Process the data - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); - push(@text, &'SdfJoin("__object", "meta", %values)); + %values = &::TableRecSplit(*flds, $rec); + push(@text, &::SdfJoin("__object", "meta", %values)); } } @@ -2313,17 +2313,17 @@ sub links_Filter { local(@tbl, @flds, $rec, %values); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); &_FilterValidate(*tbl, *_links_FilterModel) if $validate; # Process the data - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); $values{'Type'} = 'text/css' if $values{'Type'} eq ''; $values{'Relationship'} = 'stylesheet' if $values{'Relationship'} eq ''; - push(@text, &'SdfJoin("__object", "link", %values)); + push(@text, &::SdfJoin("__object", "link", %values)); } } @@ -2336,7 +2336,7 @@ sub stylesheet_Filter { local(*text, %param) = @_; # Process the data - @text = (&'SdfJoin("__stylesheet", join("\n", @text), %param)); + @text = (&::SdfJoin("__stylesheet", join("\n", @text), %param)); } # package return value diff --git a/perllib/sdf/home/stdlib/bugtrack.sdm b/perllib/sdf/home/stdlib/bugtrack.sdm index 17c3885..ffeed25 100644 --- a/perllib/sdf/home/stdlib/bugtrack.sdm +++ b/perllib/sdf/home/stdlib/bugtrack.sdm @@ -56,7 +56,7 @@ sub bug_title_Macro { $title = $db_title; } elsif ($title ne $db_title) { - &'AppMsg("warning", "bug title does not match database value"); + &::AppMsg("warning", "bug title does not match database value"); } # Build result diff --git a/perllib/sdf/home/stdlib/delphi.sdm b/perllib/sdf/home/stdlib/delphi.sdm index 0d07c5d..73d3898 100644 --- a/perllib/sdf/home/stdlib/delphi.sdm +++ b/perllib/sdf/home/stdlib/delphi.sdm @@ -193,7 +193,7 @@ sub _DelphiGenerateHyperText { if ($text =~ /\./) { ($group, $text) = split(/\./, $text, 2); unless (defined($_delphi_groups{$group})) { - &'AppMsg("warning", "unknown delphi group '$group'"); + &::AppMsg("warning", "unknown delphi group '$group'"); } $prefix = $_delphi_groups{$group}; } @@ -222,7 +222,7 @@ sub _DelphiGenerateHyperText { # delphi_groups - table of logical group names and matching jump prefixes @_delphi_groups_FilterParams = (); -@_delphi_groups_FilterModel = &'TableParse( +@_delphi_groups_FilterModel = &::TableParse( 'Field Category Rule', 'Name key', 'Prefix optional', @@ -232,21 +232,21 @@ sub delphi_groups_Filter { local(@tbl, @flds, $rec, %values); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); - &'TableValidate(*tbl, *_delphi_groups_FilterModel); + &::TableValidate(*tbl, *_delphi_groups_FilterModel); # Process the data - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); $_delphi_groups{$values{'Name'}} = $values{'Prefix'}; } } # delphi_properties - table of properties for a Delphi class @_delphi_properties_FilterParams = (); -@_delphi_properties_FilterModel = &'TableParse( +@_delphi_properties_FilterModel = &::TableParse( 'Field Category Rule', 'Name key', 'Key optional ', @@ -259,15 +259,15 @@ sub delphi_properties_Filter { local($row,$line,$pos); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); - &'TableValidate(*tbl, *_delphi_properties_FilterModel); + &::TableValidate(*tbl, *_delphi_properties_FilterModel); # Sort the data - @tbl = &'TableSort(*tbl, 'Name'); + @tbl = &::TableSort(*tbl, 'Name'); # Get the line and row counts - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); $line_count=scalar(@tbl); $row_count=int(($line_count+2)/3); #print STDERR "LINE_COUNT $line_count ROW_COUNT $row_count\n"; @@ -310,7 +310,7 @@ sub delphi_properties_Filter { $rec=$tbl[$pos]; #print STDERR "TBL[$line,$row,$pos]=$rec\n"; } - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # divide into a three column table ... if ($values{'RO'}) { @@ -366,7 +366,7 @@ sub delphi_events_Filter { } # generic processing for methods & events -@_delphi_keytable_FilterModel = &'TableParse( +@_delphi_keytable_FilterModel = &::TableParse( 'Field Category Rule', 'Name key', 'Key optional ' @@ -393,15 +393,15 @@ sub _delphi_keytable { } # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); - &'TableValidate(*tbl, *_delphi_keytable_FilterModel); + &::TableValidate(*tbl, *_delphi_keytable_FilterModel); # Sort the data - @tbl = &'TableSort(*tbl, 'Name'); + @tbl = &::TableSort(*tbl, 'Name'); # Get the line and row counts - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); $line_count=scalar(@tbl); $row_count=int(($line_count+2)/3); #print STDERR "LINE_COUNT $line_count ROW_COUNT $row_count\n"; @@ -444,7 +444,7 @@ sub _delphi_keytable { $rec=$tbl[$pos]; #print STDERR "TBL[$line,$row,$pos]=$rec\n"; } - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # method/event doesn't have the RO field but does still # use the same table formatting ... cute huh! @@ -484,7 +484,7 @@ sub _delphi_keytable { # delphi_see_also - a table of related entities @_delphi_see_also_FilterParams = (); -@_delphi_see_also_FilterModel = &'TableParse( +@_delphi_see_also_FilterModel = &::TableParse( 'Field Category Rule', 'Name key', 'Category optional ' @@ -496,14 +496,14 @@ sub delphi_see_also_Filter { local($item, @items, $style); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); - &'TableValidate(*tbl, *_delphi_see_also_FilterModel); + &::TableValidate(*tbl, *_delphi_see_also_FilterModel); # Process the data - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); if ($values{'Category'}) { $style = $delphi_l2s{$values{'Category'}}; $style =~ tr/a-z/A-Z/; @@ -581,7 +581,7 @@ sub delphi_variables_Filter { } # generic processing for components, objects, types and routines -@_delphi_list_FilterModel = &'TableParse( +@_delphi_list_FilterModel = &::TableParse( 'Field Category Rule', 'Name key', 'Style optional', @@ -593,17 +593,17 @@ sub _delphi_list { local($item_style, $item, @items); # Parse and validate the data - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); - &'TableValidate(*tbl, *_delphi_list_FilterModel); + &::TableValidate(*tbl, *_delphi_list_FilterModel); # Sort the data - @tbl = &'TableSort(*tbl, 'Name'); + @tbl = &::TableSort(*tbl, 'Name'); # Process the data - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); for $rec (@tbl) { - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); $item_style = $values{'Style'} ne '' ? $values{'Style'} : $style; $item = "{{$item_style: $values{'Name'}}}"; push(@items, $item); diff --git a/perllib/sdf/home/stdlib/mif.sdn b/perllib/sdf/home/stdlib/mif.sdn index 0bbbbc6..76f6b8b 100644 --- a/perllib/sdf/home/stdlib/mif.sdn +++ b/perllib/sdf/home/stdlib/mif.sdn @@ -303,7 +303,7 @@ section value='section\x11 <$paranumonly\>, \xd2 <$paratext\>\xd3 , on p # Handle book mode !if MIF_BOOK_MODE # Start the front part - !output &'MifNewComponent('front') + !output &::MifNewComponent('front') # End the last component !block end @@ -313,7 +313,7 @@ section value='section\x11 <$paranumonly\>, \xd2 <$paratext\>\xd3 , on p # Start a new component, when requested !on paragraph '';; \ - &'MifNewComponent($attr{'component'}) if $attr{'component'} + &::MifNewComponent($attr{'component'}) if $attr{'component'} # Make each level 1 heading a component, unless it is already one !on paragraph '[HAP]1';; \ diff --git a/perllib/sdf/home/stdlib/misc.sdm b/perllib/sdf/home/stdlib/misc.sdm index c42c25e..2de4af8 100644 --- a/perllib/sdf/home/stdlib/misc.sdm +++ b/perllib/sdf/home/stdlib/misc.sdm @@ -69,7 +69,7 @@ sub squish_Macro { } elsif ($state eq 'off') { push(@text,'!off paragraph __squish_filter'); } else { - &'AppMsg("error", "squish \"$state\" not yet implemented"); + &::AppMsg("error", "squish \"$state\" not yet implemented"); return (); } @@ -95,7 +95,7 @@ sub keep_Macro { } elsif ($state eq 'off') { push(@text,'!off paragraph __keep_filter'); } else { - &'AppMsg("error", "keep \"$state\" not yet implemented"); + &::AppMsg("error", "keep \"$state\" not yet implemented"); return (); } return (@text); @@ -118,7 +118,7 @@ sub hyphen_Macro { } elsif ($state eq 'on') { push(@text,'!off paragraph __hyphen_filter'); } else { - &'AppMsg("error", "hyphen \"$state\" not yet implemented"); + &::AppMsg("error", "hyphen \"$state\" not yet implemented"); return (); } return (@text); diff --git a/perllib/sdf/home/stdlib/usecases.sdm b/perllib/sdf/home/stdlib/usecases.sdm index dd4e7fe..955dbbe 100644 --- a/perllib/sdf/home/stdlib/usecases.sdm +++ b/perllib/sdf/home/stdlib/usecases.sdm @@ -76,7 +76,7 @@ sub uc_title_Macro { $title = $db_title; } elsif ($title ne $db_title) { - &'AppMsg("warning", "usecase title does not match database value"); + &::AppMsg("warning", "usecase title does not match database value"); } # Build result diff --git a/perllib/sdf/macros.pl b/perllib/sdf/macros.pl index 644f441..e2fedf0 100644 --- a/perllib/sdf/macros.pl +++ b/perllib/sdf/macros.pl @@ -181,7 +181,7 @@ sub InitMacros { %readonly = (); %restricted = (); - for $name (keys %'sdf_target) { + for $name (keys %::sdf_target) { $name =~ tr/a-z/A-Z/; $restricted{$name} = 1; } @@ -217,10 +217,10 @@ sub _PageHF { %mac_parts = %parts; } else { - %mac_parts = &'SdfAttrSplit($page_hf{$comp_page}); + %mac_parts = &::SdfAttrSplit($page_hf{$comp_page}); @mac_parts{keys %parts} = values %parts; } - $page_hf{$comp_page} = &'SdfAttrJoin(*mac_parts); + $page_hf{$comp_page} = &::SdfAttrJoin(*mac_parts); # Get the part ordering information $first = 1; @@ -297,9 +297,9 @@ sub _ClassHandler { local($view); local($make_vars, $var_name); - @tbl = &'TableParse(@text); + @tbl = &::TableParse(@text); @text = (); - &'TableValidate(*tbl, *rules); + &::TableValidate(*tbl, *rules); # Get the class details $name_style = $_class{$class,'name_style'}; @@ -344,14 +344,14 @@ sub _ClassHandler { } # Process the data - (@flds) = &'TableFields(shift @tbl); + (@flds) = &::TableFields(shift @tbl); $root = $param{'root'}; for $rec (@tbl) { if ($rec =~ /^!/) { push(@text, $rec); next; } - %values = &'TableRecSplit(*flds, $rec); + %values = &::TableRecSplit(*flds, $rec); # Get the fields of interest $name = $values{$name_fld}; @@ -379,7 +379,7 @@ sub _ClassHandler { # For display tables, build the output if ($process eq 'display') { if ($long_fld && $long eq '' && $jump eq '') { - &'AppMsg("warning", "unknown object '$name' in class '$class'"); + &::AppMsg("warning", "unknown object '$name' in class '$class'"); } @out_values = (); for ($i = 0; $i <= $#out_fields; $i++) { @@ -477,7 +477,7 @@ sub _ObjectNameEP { # Validate the object if (! $obj_name{$class,$text}) { - &'AppMsg("warning", "unknown object '$text' in class '$class' (name EP)"); + &::AppMsg("warning", "unknown object '$text' in class '$class' (name EP)"); } # Generate the hypertext, if any @@ -493,7 +493,7 @@ sub _ObjectNameEP { $text = $obj_name{$class,$text,$long_fld}; } else { - &'AppMsg("warning", "unable to expand object '$text' in class '$class'"); + &::AppMsg("warning", "unable to expand object '$text' in class '$class'"); } } @@ -514,7 +514,7 @@ sub _ObjectLongEP { # Validate the object if (! $obj_long{$class,$text}) { - &'AppMsg("warning", "unknown object '$text' in class '$class' (long EP)"); + &::AppMsg("warning", "unknown object '$text' in class '$class' (long EP)"); } # Generate the hypertext, if any @@ -530,7 +530,7 @@ sub _ObjectLongEP { $text = $obj_long{$class,$text,$name_fld}; } else { - &'AppMsg("warning", "unable to shrink object '$text' in class '$class'"); + &::AppMsg("warning", "unable to shrink object '$text' in class '$class'"); } } @@ -553,13 +553,13 @@ sub _ObjectLongEP { sub block_Macro { local(%arg) = @_; local(@text); -#print STDERR "sb1 file: $'ARGV, lineno: $'app_lineno<\n"; +#print STDERR "sb1 file: $::ARGV, lineno: $::app_lineno<\n"; # Update the parser state - $'sdf_block_start = $'app_lineno; - $'sdf_block_type = 'block'; - @'sdf_block_text = (); - %'sdf_block_arg = %arg; + $::sdf_block_start = $::app_lineno; + $::sdf_block_type = 'block'; + @::sdf_block_text = (); + %::sdf_block_arg = %arg; # Return result return (); @@ -572,27 +572,27 @@ sub endblock_Macro { local(@text); # Check the state - if ($'sdf_block_type ne 'block') { - &'AppMsg("error", "endblock macro not expected"); + if ($::sdf_block_type ne 'block') { + &::AppMsg("error", "endblock macro not expected"); return (); } # Update the parser state - $'sdf_block_type = ''; + $::sdf_block_type = ''; # Filter the text - &ExecFilter($'sdf_block_arg{'filter'}, *'sdf_block_text, - $'sdf_block_arg{'params'}, $'sdf_block_start, $'ARGV, 'filter on '); + &ExecFilter($::sdf_block_arg{'filter'}, *::sdf_block_text, + $::sdf_block_arg{'params'}, $::sdf_block_start, $::ARGV, 'filter on '); # Mark the text as a section, if necessary - if (@'sdf_block_text) { - unshift(@'sdf_block_text, - "!_bos_ $'sdf_block_start;block on "); - push(@'sdf_block_text, "!_eos_ $'app_lineno;$'app_context"); + if (@::sdf_block_text) { + unshift(@::sdf_block_text, + "!_bos_ $::sdf_block_start;block on "); + push(@::sdf_block_text, "!_eos_ $::app_lineno;$::app_context"); } # Return result - return @'sdf_block_text; + return @::sdf_block_text; } # include - include another file @@ -612,13 +612,13 @@ sub include_Macro { $filename = $arg{'filename'}; $fullname = &FindFile($filename); if ($fullname eq '') { - &'AppMsg("warning", "unable to find '$filename'"); + &::AppMsg("warning", "unable to find '$filename'"); return (); } # Get the text unless (&FileFetch(*text, $fullname)) { - &'AppMsg("warning", "unable to read '$fullname'"); + &::AppMsg("warning", "unable to read '$fullname'"); return (); } @@ -648,7 +648,7 @@ sub use_Macro { # Get the file location $fullname = &FindModule($filename); if ($fullname eq '') { - &'AppMsg("warning", "unable to find '$filename'"); + &::AppMsg("warning", "unable to find '$filename'"); return (); } @@ -657,7 +657,7 @@ sub use_Macro { # Get the text unless (&FileFetch(*text, $fullname)) { - &'AppMsg("warning", "unable to read '$fullname'"); + &::AppMsg("warning", "unable to read '$fullname'"); return (); } @@ -686,12 +686,12 @@ sub inherit_Macro { $library = $arg{'library'}; $dos_library = $library; $dos_library =~ s#/#\\#g; - $module = (&'NameSplit($library))[1]; + $module = (&::NameSplit($library))[1]; if (-f "$module.sdm") { # Module is in the current directory $library = '.'; } - elsif (&'NameIsAbsolute($library)) { + elsif (&::NameIsAbsolute($library)) { push(@include_path, $library); push(@module_path, $library); $var{'HLP_OPTIONS_ROOT'} .= ", $dos_library"; @@ -704,7 +704,7 @@ sub inherit_Macro { $var{'HLP_OPTIONS_ROOT'} .= ", $var{'SDF_DOSHOME'}\\$dos_library"; } else { - &'AppMsg("warning", "unable to find library '$library'"); + &::AppMsg("warning", "unable to find library '$library'"); return (); } } @@ -731,7 +731,7 @@ sub execute_Macro { # Get the text $cmd = $arg{'cmd'}; unless (&FileFetch(*text, "$cmd|")) { - &'AppMsg("error", "failed to execute '$cmd'"); + &::AppMsg("error", "failed to execute '$cmd'"); return (); } @@ -757,11 +757,11 @@ sub import_Macro { # Process the filename and attributes $filename = $arg{'filename'}; - %params = &'SdfAttrSplit($arg{'params'}); + %params = &::SdfAttrSplit($arg{'params'}); &ProcessImageAttrs(*filename, *params); # Return result - return (&'SdfJoin('__import', $filename, %params)); + return (&::SdfJoin('__import', $filename, %params)); } # jumps - create jump lines @@ -1004,7 +1004,7 @@ sub define_Macro { ## If the variable looks like an enum, output an error #if ($name =~ /^[A-Z][a-z]+$/) { - # &'AppMsg("error", "'variable '$name' looks like an enumerated value"); + # &::AppMsg("error", "'variable '$name' looks like an enumerated value"); # return (); #} @@ -1012,7 +1012,7 @@ sub define_Macro { if ($name =~ /^([A-Z]+)_/ && $restricted{$1} && !$variables_name{$name}) { $status = (defined($var{$name}) || $readonly{$1}) ? 'read-only' : 'unknown'; - &'AppMsg("warning", "'$1' variable '$name' is $status - ignoring definition"); + &::AppMsg("warning", "'$1' variable '$name' is $status - ignoring definition"); return (); } @@ -1020,8 +1020,8 @@ sub define_Macro { if ($variables_name{$name}) { $type = $variables_type{$name}; $rule = $variables_rule{$name}; - unless (&'MiscCheckRule($value, $rule, $type)) { - &'AppMsg("warning", "bad value '$value' for variable '$name'"); + unless (&::MiscCheckRule($value, $rule, $type)) { + &::AppMsg("warning", "bad value '$value' for variable '$name'"); } } @@ -1030,7 +1030,7 @@ sub define_Macro { # Export the variable, if necessary if ($export{$name}) { - @text = (&'SdfJoin('__object', 'Variable', + @text = (&::SdfJoin('__object', 'Variable', 'Name', $name, 'value', $value)); } @@ -1086,7 +1086,7 @@ sub init_Macro { local(%vars, $name, $value); # Convert the name-value pairs to define macros - %vars = &'SdfAttrSplit($arg{'vars'}); + %vars = &::SdfAttrSplit($arg{'vars'}); for $name (sort keys %vars) { $value = $vars{$name}; $value =~ s/'/\\'/g; @@ -1113,7 +1113,7 @@ sub export_Macro { # If already defined, export it immediately if (defined $var{$name}) { - @text = (&'SdfJoin('__object', 'Variable', + @text = (&::SdfJoin('__object', 'Variable', 'Name', $name, 'value', $var{$name})); } @@ -1134,10 +1134,10 @@ sub macro_Macro { local(@text); # Update the parser state - $'sdf_block_start = $'app_lineno; - $'sdf_block_type = 'macro'; - @'sdf_block_text = (); - %'sdf_block_arg = %arg; + $::sdf_block_start = $::app_lineno; + $::sdf_block_type = 'macro'; + @::sdf_block_text = (); + %::sdf_block_arg = %arg; # Return result return (); @@ -1150,16 +1150,16 @@ sub endmacro_Macro { local(@text); # Check the state - if ($'sdf_block_type ne 'macro') { - &'AppMsg("error", "endmacro macro not expected"); + if ($::sdf_block_type ne 'macro') { + &::AppMsg("error", "endmacro macro not expected"); return (); } # Update the parser state - $'sdf_block_type = ''; + $::sdf_block_type = ''; # Save the definition - $macro{$'sdf_block_arg{'name'}} = join("\n", @'sdf_block_text); + $macro{$::sdf_block_arg{'name'}} = join("\n", @::sdf_block_text); # Return result return (); @@ -1202,7 +1202,7 @@ sub class_Macro { # Build the filter $code = < $newpage ($attr)\n"; - $info = $SDF_USER'macro{"PAGE_${newpage}_$attr"}; + $info = $SDF_USER::macro{"PAGE_${newpage}_$attr"}; } } else { - if (defined $SDF_USER'var{"PAGE_${page}_$attr"}) { - $info = $SDF_USER'var{"PAGE_${page}_$attr"}; + if (defined $SDF_USER::var{"PAGE_${page}_$attr"}) { + $info = $SDF_USER::var{"PAGE_${page}_$attr"}; } elsif ($page =~ /_/) { ($part, $newpage) = ($`, $'); $newpage = 'RIGHT' if $newpage eq 'FIRST' && $part ne 'FRONT'; #printf STDERR "$page -> $newpage ($attr)\n"; - $info = $SDF_USER'var{"PAGE_${newpage}_$attr"}; + $info = $SDF_USER::var{"PAGE_${newpage}_$attr"}; } if ($category eq 'pt') { $info = &SdfPoints($info); @@ -1484,7 +1484,7 @@ sub _SdfEvaluate { local($expr, $msg_type, $enum) = @_; local($result); local($format); - local($action, $SDF_USER'_); + local($action, $SDF_USER::_); # Get the format, if any $format = $1 if $expr =~ s/^(\w+)://; @@ -1504,18 +1504,18 @@ sub _SdfEvaluate { # Variables elsif ($expr =~ /^\w+$/) { - if (!defined($SDF_USER'var{$expr})) { + if (!defined($SDF_USER::var{$expr})) { if ($msg_type) { &AppMsg($msg_type, "variable '$expr' not defined"); } $result = ''; } else { - $result = $SDF_USER'var{$expr}; + $result = $SDF_USER::var{$expr}; } } elsif ($expr =~ /^\!\s*(\w+)$/) { - $result = $SDF_USER'var{$1} ? 0 : 1; + $result = $SDF_USER::var{$1} ? 0 : 1; } elsif ($expr =~ /^$/) { $result = ''; @@ -1523,13 +1523,13 @@ sub _SdfEvaluate { # Handle implicit calls to Calc elsif ($expr =~ /^[=+]\s*(.+)$/) { - $result = &SDF_USER'Calc($1); + $result = &SDF_USER::Calc($1); } else { # evaluate the expression in "user-land" package SDF_USER; - $main'result = eval $main'expr; + $main::result = eval $main::expr; package main; if ($@) { &AppMsg("warning", "evaluation of '$expr' failed: $@"); @@ -1539,14 +1539,14 @@ sub _SdfEvaluate { # Apply the format, if any if ($format ne '') { - $action = $SDF_USER'var{"FORMAT_$format"}; + $action = $SDF_USER::var{"FORMAT_$format"}; if ($action eq '') { &AppMsg("warning", "unknown format '$format'"); } else { package SDF_USER; - $_ = $main'result; - $main'result = eval $main'action; + $_ = $main::result; + $main::result = eval $main::action; package main; if ($@) { &AppMsg("warning", "format '$format' failed: $@"); @@ -1706,11 +1706,11 @@ sub SdfAttrClean { local($name); # Keep all attributes for raw format - $driver = $SDF_USER'var{'OPT_DRIVER'}; + $driver = $SDF_USER::var{'OPT_DRIVER'}; return if $driver eq 'raw'; # Delete attributes in 'families' other than the current driver or target - $target = $SDF_USER'var{'OPT_TARGET'}; + $target = $SDF_USER::var{'OPT_TARGET'}; for $name (keys %attr) { delete $attr{$name} if $name =~ /^(\w+)\./ && $1 ne $driver && $1 ne $target; @@ -1782,11 +1782,11 @@ sub _SdfAttrValueMap { # Build the action $name = substr($map, 1); - $action = ($map =~ /^\%/) ? "\$$name\{\$'value\}" : "&$name(\$'value)"; + $action = ($map =~ /^\%/) ? "\$$name\{\$::value\}" : "&$name(\$::value)"; # Get the new value package SDF_USER; - $'newvalue = eval $'action; + $::newvalue = eval $::action; package main; &AppMsg("warning", "attribute mapping via '$map' failed: $@ (action: $action)") if $@; $value = $newvalue if defined $newvalue; @@ -1804,18 +1804,18 @@ sub _SdfAttrCheck { # check the attribute is known & get the type and rule, if any if ($kind eq 'paragraph') { - unless ($SDF_USER'paraattrs_name{$name}) { + unless ($SDF_USER::paraattrs_name{$name}) { &AppMsg("warning", "unknown paragraph attribute '$name'"); } - $type = $SDF_USER'paraattrs_type{$name}; - $rule = $SDF_USER'paraattrs_rule{$name}; + $type = $SDF_USER::paraattrs_type{$name}; + $rule = $SDF_USER::paraattrs_rule{$name}; } else { - unless ($SDF_USER'phraseattrs_name{$name}) { + unless ($SDF_USER::phraseattrs_name{$name}) { &AppMsg("warning", "unknown phrase attribute '$name'"); } - $type = $SDF_USER'phraseattrs_type{$name}; - $rule = $SDF_USER'phraseattrs_rule{$name}; + $type = $SDF_USER::phraseattrs_type{$name}; + $rule = $SDF_USER::phraseattrs_rule{$name}; } @@ -1842,7 +1842,7 @@ sub SdfSizeGraphic { local($upi1, $upi2, $scale); # Get the file extension - $ext = (&'NameSplit($file))[2]; + $ext = (&::NameSplit($file))[2]; # Open the file open(SDF_GRAPHIC, $file) || return (0,0); @@ -2036,11 +2036,11 @@ sub SdfSystem { local($cmd) = @_; local($exit_code); - &'AppMsg("object", "executing '$cmd'\n") if $'verbose >= 1; + &::AppMsg("object", "executing '$cmd'\n") if $::verbose >= 1; $exit_code = system($cmd); if ($exit_code) { $exit_code = $exit_code / 256; - &'AppMsg("warning", "'$action' exit code was $exit_code from '$cmd'"); + &::AppMsg("warning", "'$action' exit code was $exit_code from '$cmd'"); } return $exit_code; } @@ -2054,7 +2054,7 @@ sub SdfQuietSystem { # Save the output in a temporary file my $tmp_file = "/tmp/sdf$$"; $cmd .= " > $tmp_file"; - $cmd .= " 2>&1" if $'NAME_OS eq 'unix'; + $cmd .= " 2>&1" if $::NAME_OS eq 'unix'; # Execute the command $exit_code = &SdfSystem($cmd); @@ -2062,7 +2062,7 @@ sub SdfQuietSystem { # If verbose mode is on, or something went wrong, show the output if ($verbose || $exit_code) { unless (open(TMPFILE, $tmp_file)) { - &'AppMsg("app_warning", "unable to open tmp file '$tmp_file'"); + &::AppMsg("app_warning", "unable to open tmp file '$tmp_file'"); } else { print ; @@ -2083,7 +2083,7 @@ sub SdfBatch { # Check the file exists $file = "$long.$out_ext"; unless (-f $file) { - &'AppMsg("error", "cannot execute sdfbatch on nonexistent file '$file'"); + &::AppMsg("error", "cannot execute sdfbatch on nonexistent file '$file'"); return; } @@ -2102,7 +2102,7 @@ sub SdfHtmldoc { # Check the input file exists unless (-f $infile) { - &'AppMsg("error", "cannot execute htmldoc on nonexistent file '$infile'"); + &::AppMsg("error", "cannot execute htmldoc on nonexistent file '$infile'"); return; } @@ -2140,9 +2140,9 @@ sub SdfDelete { # local(); if (-f $file) { - &'AppMsg("object", "deleting '$file'") if $'verbose >= 1; + &::AppMsg("object", "deleting '$file'") if $::verbose >= 1; unless (unlink($file)) { - &'AppMsg("object", "delete of '$file' failed: $!"); + &::AppMsg("object", "delete of '$file' failed: $!"); } } } @@ -2156,22 +2156,22 @@ sub SdfBookClean { local(@cannot); # Leave things alone if verbose mode is on or there is nothing to do - return if $'verbose; - return unless @'sdf_book_files; + return if $::verbose; + return unless @::sdf_book_files; # If an extension is given, use that set of # files, rather than the known ones. - @files = @'sdf_book_files; + @files = @::sdf_book_files; if ($ext ne '') { for $_ (@files) { - $_ = &'NameSubExt($_, $ext); + $_ = &::NameSubExt($_, $ext); } } # Delete the files @cannot = grep(!unlink($_), @files); #if (@cannot) { - # &'AppMsg("object", "unable to delete '@cannot'"); + # &::AppMsg("object", "unable to delete '@cannot'"); #} } @@ -2184,10 +2184,10 @@ sub SdfRenamePS { local($cmd); # Do nothing unless FrameMaker 5 is being used - return unless $'sdf_fmext eq 'fm5'; + return unless $::sdf_fmext eq 'fm5'; # Wait until the print driver has finished - &'AppMsg("object", "waiting for the print driver\n"); + &::AppMsg("object", "waiting for the print driver\n"); until (-f "$xx.$out_ext.ps") { sleep(1); print STDERR "."; diff --git a/perllib/sdf/podmacs.pl b/perllib/sdf/podmacs.pl index 71c75f4..86de163 100644 --- a/perllib/sdf/podmacs.pl +++ b/perllib/sdf/podmacs.pl @@ -238,7 +238,7 @@ sub cut_Macro { local(@text); # Update the parser state - $'sdf_cutting = 1; + $::sdf_cutting = 1; # Return result return (); @@ -298,4 +298,4 @@ sub end_Macro { } # package return value -1; \ No newline at end of file +1; diff --git a/perllib/sdf/post_mf6.pl b/perllib/sdf/post_mf6.pl index c3a3342..e287e9a 100644 --- a/perllib/sdf/post_mf6.pl +++ b/perllib/sdf/post_mf6.pl @@ -165,7 +165,7 @@ sub Get_Client_Dets { local( @client_array, $client_dir, $client_list, $found_sw); # Get the client code - $CLIENT = $SDF_USER'var{'MIMS_CLIENT_CODE'}; + $CLIENT = $SDF_USER::var{'MIMS_CLIENT_CODE'}; if ( $CLIENT eq '') { &AppExit('fatal', "MIMS_CLIENT_CODE variable must be specified"); } diff --git a/perllib/sdf/subs.pl b/perllib/sdf/subs.pl index 2d155e6..2b26ece 100644 --- a/perllib/sdf/subs.pl +++ b/perllib/sdf/subs.pl @@ -28,7 +28,7 @@ $VERSION{''.__FILE__} = '$Revision$'; # Make sure we can call the Value function from the main package -sub Value {&SDF_USER'Value;} +sub Value {&SDF_USER::Value;} # Switch to the user package package SDF_USER; @@ -119,7 +119,7 @@ sub FormatTime { $fmt = $var{$fmt} if $var{$fmt} ne ''; $time = $var{$time} if $var{$time} ne ''; - return $time ? &'MiscDateFormat($fmt, $time) : ''; + return $time ? &::MiscDateFormat($fmt, $time) : ''; } # @@ -193,25 +193,25 @@ sub FindFile { my @dirs = ('.'); my $dir = $var{'DOC_DIR'}; push(@dirs, $dir) if $dir ne cwd(); - push(@dirs, @include_path, $'sdf_lib); + push(@dirs, @include_path, $::sdf_lib); # Do the search if ($image) { my $context = $var{'OPT_TARGET'}; - my @exts = @{$'SDF_IMAGE_EXTS{$context} || $'SDF_IMAGE_EXTS{'ps'}}; - &'AppTrace("user", 5, "searching for image '$filename' in directories (" . + my @exts = @{$::SDF_IMAGE_EXTS{$context} || $::SDF_IMAGE_EXTS{'ps'}}; + &::AppTrace("user", 5, "searching for image '$filename' in directories (" . join(",", @dirs) . ") with $context extensions (" . join(",", @exts) . ")"); - $fullname = &'NameFindOrGenerate($filename, \@dirs, \@exts, $context); + $fullname = &::NameFindOrGenerate($filename, \@dirs, \@exts, $context); } else { - &'AppTrace("user", 5, "searching for file '$filename' in directories (" . + &::AppTrace("user", 5, "searching for file '$filename' in directories (" . join(",", @dirs) . ")"); - $fullname = &'NameFind($filename, @dirs); + $fullname = &::NameFind($filename, @dirs); } # Return results - &'AppTrace("user", 2, "file '$filename' -> '$fullname'") if + &::AppTrace("user", 2, "file '$filename' -> '$fullname'") if $fullname ne ''; return $fullname; } @@ -231,15 +231,15 @@ sub FindModule { my @dirs = ('.'); my $dir = $var{'DOC_DIR'}; push(@dirs, $dir) if $dir ne cwd(); - push(@dirs, @module_path, $'sdf_lib, "$'sdf_lib/stdlib"); + push(@dirs, @module_path, $::sdf_lib, "$::sdf_lib/stdlib"); # Do the search - &'AppTrace("user", 4, "searching for module '$filename' in directories (" . + &::AppTrace("user", 4, "searching for module '$filename' in directories (" . join(",", @dirs) . ")"); - $fullname = &'NameFind($filename, @dirs); + $fullname = &::NameFind($filename, @dirs); # Return results - &'AppTrace("user", 2, "module '$filename' -> '$fullname'") if + &::AppTrace("user", 2, "module '$filename' -> '$fullname'") if $fullname ne ''; return $fullname; } @@ -260,14 +260,14 @@ sub FindLibrary { my @dirs = ('.'); my $dir = $var{'DOC_DIR'}; push(@dirs, $dir) if $dir ne cwd(); - push(@dirs, @library_path, $'sdf_lib); + push(@dirs, @library_path, $::sdf_lib); # Do the search - &'AppTrace("user", 3, "searching for library '$lib' in directories (" . + &::AppTrace("user", 3, "searching for library '$lib' in directories (" . join(",", @dirs) . ")"); $fullname = ''; for $dir (@dirs) { - $lib_path = $dir eq $'NAME_DIR_SEP ? "$dir$lib" : "$dir$'NAME_DIR_SEP$lib"; + $lib_path = $dir eq $::NAME_DIR_SEP ? "$dir$lib" : "$dir$::NAME_DIR_SEP$lib"; if (-d $lib_path) { $fullname = $lib_path; last; @@ -275,7 +275,7 @@ sub FindLibrary { } # Return results - &'AppTrace("user", 2, "library '$lib' -> '$fullname'") if + &::AppTrace("user", 2, "library '$lib' -> '$fullname'") if $fullname ne ''; return $fullname; } @@ -300,12 +300,12 @@ sub ExecMacro { local($macro_fn); # Set the context for messages - $'app_context = 'macro on ' unless $'sdf_sections; + $::app_context = 'macro on ' unless $::sdf_sections; # Activate event processing - &ReportEvents('macro') if @'sdf_report_names; + &ReportEvents('macro') if @::sdf_report_names; &ExecEventsNameMask(*evcode_macro, *evmask_macro) if @evcode_macro; - &ReportEvents('macro', 'Post') if @'sdf_report_names; + &ReportEvents('macro', 'Post') if @::sdf_report_names; # Macros implemented in Perl have a subroutine which can be called $macro_fn = $name . "_Macro"; @@ -319,27 +319,27 @@ sub ExecMacro { # increment within the generated output. return () unless @text; return @text if $name =~ /^_/ || $text[0] =~ /^\!_bof/; - return ("!_bos_ $'app_lineno;macro on ", @text, - "!_eos_ $'app_lineno;$'app_context"); + return ("!_bos_ $::app_lineno;macro on ", @text, + "!_eos_ $::app_lineno;$::app_context"); } # For macros implemented in SDF, the macro is stored in %macro elsif (defined($macro{$name})) { # Validate the arguments - &'AppMsg("warning", "ignoring arguments for macro '$name'") if $args ne ''; + &::AppMsg("warning", "ignoring arguments for macro '$name'") if $args ne ''; # Return the data - return ("!_bos_ $'app_lineno;macro on ", split("\n", $macro{$name}), - "!_eos_ $'app_lineno;$'app_context"); + return ("!_bos_ $::app_lineno;macro on ", split("\n", $macro{$name}), + "!_eos_ $::app_lineno;$::app_context"); } # If we reach here, macro is unknown if ($missing eq 'error') { - &'AppMsg("error", "unknown macro '$name'"); + &::AppMsg("error", "unknown macro '$name'"); } elsif ($missing eq 'warning') { - &'AppMsg("warning", "unknown macro '$name'"); + &::AppMsg("warning", "unknown macro '$name'"); } return (); } @@ -361,17 +361,17 @@ sub ExecFilter { return if $name eq ''; # Setup the message parameters, if necessary - $orig_lineno = $'app_lineno; - $orig_filename = $'ARGV; - $orig_context = $'app_context; - $'app_lineno = $lineno if defined $lineno; - $'ARGV = $filename if defined $filename; - $'app_context = $context if defined $context; + $orig_lineno = $::app_lineno; + $orig_filename = $::ARGV; + $orig_context = $::app_context; + $::app_lineno = $lineno if defined $lineno; + $::ARGV = $filename if defined $filename; + $::app_context = $context if defined $context; # Activate event processing - &ReportEvents('filter') if @'sdf_report_names; + &ReportEvents('filter') if @::sdf_report_names; &ExecEventsNameMask(*evcode_filter, *evmask_filter) if @evcode_filter; - &ReportEvents('filter', 'Post') if @'sdf_report_names; + &ReportEvents('filter', 'Post') if @::sdf_report_names; # If necessary, load the plug-in, if any $filter_fn = $name . "_Filter"; @@ -380,10 +380,10 @@ sub ExecFilter { # do nothing } else { - $plug_in = &FindModule(&'NameJoin('', $name, 'sdp')); + $plug_in = &FindModule(&::NameJoin('', $name, 'sdp')); if ($plug_in) { unless (require $plug_in) { - &'AppMsg("warning", "unable to load plug-in '$plug_in'"); + &::AppMsg("warning", "unable to load plug-in '$plug_in'"); } } } @@ -398,13 +398,13 @@ sub ExecFilter { &example_Filter(*text, &SdfFilterParams('example', $params)); } else { - &'AppMsg("error", "unknown filter '$name'"); + &::AppMsg("error", "unknown filter '$name'"); } # Restore the message parameters - $'app_lineno = $orig_lineno; - $'ARGV = $orig_filename; - $'app_context = $orig_context; + $::app_lineno = $orig_lineno; + $::ARGV = $orig_filename; + $::app_context = $orig_context; } # @@ -427,7 +427,7 @@ sub SdfMacroArgs { else { # Compile the arguments $index = $#_sdf_macro_args_data + 1; - ($format, @rules) = &'TableParse(eval "\@_${macro}_MacroArgs"); + ($format, @rules) = &::TableParse(eval "\@_${macro}_MacroArgs"); push(@_sdf_macro_args_data, @rules); $last = $#_sdf_macro_args_data; $_sdf_macro_args_info{$macro} = join(':', $index, $last); @@ -440,7 +440,7 @@ sub SdfMacroArgs { # If there is nothing left, use the default, if any if ($args eq '') { - &'AppMsg("error", "argument '$name' missing for macro '$macro'") + &::AppMsg("error", "argument '$name' missing for macro '$macro'") if $default eq ''; $value = $default eq '_NULL_' ? '' : $default; } @@ -450,8 +450,8 @@ sub SdfMacroArgs { ($value, $args) = &_SdfMacroNextArg($args, $type); # Validate the rule, if any - &'AppMsg("warning", "bad value '$value' for argument '$name' for macro '$macro'") - if ($value ne '' && !&'MiscCheckRule($value, $rule, $type)); + &::AppMsg("warning", "bad value '$value' for argument '$name' for macro '$macro'") + if ($value ne '' && !&::MiscCheckRule($value, $rule, $type)); } # Save the value @@ -484,7 +484,7 @@ sub _SdfMacroNextArg { # If we reach here, we need to evaluate the argument ($arg, $rest) = split(/\s*\;/, $args, 2); - $arg = &'_SdfEvaluate($arg, $type eq 'condition' ? '' : 'warning'); + $arg = &::_SdfEvaluate($arg, $type eq 'condition' ? '' : 'warning'); return ($arg, $rest); } @@ -504,7 +504,7 @@ sub SdfFilterParams { local($unknown, %unknown); # Get the parameters - %param = &'SdfAttrSplit($params); + %param = &::SdfAttrSplit($params); # Get the parameter table @param_table = eval "\@_${filter}_FilterParams"; @@ -520,7 +520,7 @@ sub SdfFilterParams { else { # Compile the parameters $index = $#_sdf_filter_params_data + 1; - ($format, @rules) = &'TableParse(@param_table); + ($format, @rules) = &::TableParse(@param_table); push(@_sdf_filter_params_data, @rules); $last = $#_sdf_filter_params_data; $_sdf_filter_params_info{$filter} = join(':', $index, $last); @@ -536,15 +536,15 @@ sub SdfFilterParams { delete $unknown{$name}; # Validate the rule, if any - if ($value ne '' && !&'MiscCheckRule($value, $rule, $type)) { - &'AppMsg("warning", "bad value '$value' for '$name' for filter '$filter'"); + if ($value ne '' && !&::MiscCheckRule($value, $rule, $type)) { + &::AppMsg("warning", "bad value '$value' for '$name' for filter '$filter'"); } } # Check for unknown parameters $unknown = join(',', sort keys %unknown); if ($unknown ne '') { - &'AppMsg("warning", "unknown parameter(s) '$unknown' for filter '$filter'"); + &::AppMsg("warning", "unknown parameter(s) '$unknown' for filter '$filter'"); } # Return result @@ -563,10 +563,10 @@ sub SdfTableParams { local($name, $value, $type, $rule); # Get the parameters - %param = &'SdfAttrSplit($params); + %param = &::SdfAttrSplit($params); # Remove parameters which only apply to other targets - &'SdfAttrClean(*param); + &::SdfAttrClean(*param); # Check the parameters are legal for $name (sort keys %param) { @@ -577,14 +577,14 @@ sub SdfTableParams { # Check the parameter is known unless ($names{$name}) { - &'AppMsg("warning", "unknown $macro parameter '$name'"); + &::AppMsg("warning", "unknown $macro parameter '$name'"); delete $param{$name}; next; } # Validate the rule, if any - if ($value ne '' && !&'MiscCheckRule($value, $rule, $type)) { - &'AppMsg("warning", "bad value '$value' for $macro parameter '$name'"); + if ($value ne '' && !&::MiscCheckRule($value, $rule, $type)) { + &::AppMsg("warning", "bad value '$value' for $macro parameter '$name'"); } } @@ -602,7 +602,7 @@ sub ReportEvents { local($rpt); local($fn); - for $rpt (@'sdf_report_names) { + for $rpt (@::sdf_report_names) { $fn = "${rpt}_ReportEvent${post}"; &$fn($tag) if defined &$fn; } @@ -633,7 +633,7 @@ sub ExecEventsStyleMask { # execute the action eval $action; - &'AppMsg("warning", "execution of '$action' failed: $@") if $@; + &::AppMsg("warning", "execution of '$action' failed: $@") if $@; } } @@ -661,7 +661,7 @@ sub ExecEventsNameMask { # execute the action eval $action; - &'AppMsg("warning", "execution of '$action' failed: $@") if $@; + &::AppMsg("warning", "execution of '$action' failed: $@") if $@; } } # @@ -703,13 +703,13 @@ sub CommandMacro { $filename = $arg{'filename'}; $fullname = &FindFile($filename); if ($fullname eq '') { - &'AppMsg("warning", "unable to find '$filename'"); + &::AppMsg("warning", "unable to find '$filename'"); return (); } # Execute the command unless (&FileFetch(*text, "$cmd $fullname|")) { - &'AppMsg("warning", "unable to execute command '$cmd' on '$fullname'"); + &::AppMsg("warning", "unable to execute command '$cmd' on '$fullname'"); return (); } @@ -734,7 +734,7 @@ sub CommandFilter { # When the above assumption is no good, we need to do something like .. #unless (open(TMPFILE, ">$tmp_file")) { - # &'AppMsg("warning", "unable to open tmp file '$tmp_file' in filter '$filter'"); + # &::AppMsg("warning", "unable to open tmp file '$tmp_file' in filter '$filter'"); #} #for my $line (@text) { # print TMPFILE "$line\n"; @@ -743,7 +743,7 @@ sub CommandFilter { # Execute the command @text = (); unless (&FileFetch(*text, "$cmd < $tmp_file |")) { - &'AppMsg("warning", "unable to execute command '$cmd' in filter '$filter'"); + &::AppMsg("warning", "unable to execute command '$cmd' in filter '$filter'"); } } @@ -800,7 +800,7 @@ sub CheckParaObject { # Convert the paragraph to an object $obj = $attr{'obj'}; delete $attr{'obj'}; - $text = '{{' . &'SdfJoin($obj, $text) . '}}'; + $text = '{{' . &::SdfJoin($obj, $text) . '}}'; } # @@ -833,11 +833,11 @@ sub BuildSectJump { if ($doc ne '') { delete $attr{'doc'}; unless ($obj_long{'references',$doc}) { - &'AppMsg('warning', "unknown document '$doc'"); + &::AppMsg('warning', "unknown document '$doc'"); } else { #if ($var{'HTML_TOPICS_MODE'} || $var{'HTML_SUBTOPICS_MODE'}) { - # &'AppMsg('warning', "cross-document section jumps not yet supported in topics mode"); + # &::AppMsg('warning', "cross-document section jumps not yet supported in topics mode"); #} $attr{'jump'} = $obj_long{'references',$doc,'Jump'} . "#$id"; } @@ -921,13 +921,13 @@ sub Value { $result .= $param{"suffix_$attr"}; } else { - &'AppMsg("warning", "load of view '$view' failed: $@"); + &::AppMsg("warning", "load of view '$view' failed: $@"); } } # Check the attribute is known and return unless ($known) { - &'AppMsg("warning", "undefined attribute '$attr' for object '$name' in class '$class'"); + &::AppMsg("warning", "undefined attribute '$attr' for object '$name' in class '$class'"); return ''; } #print STDERR "attr: $attr, view: $view, result: $result.\n" if $view; @@ -961,7 +961,7 @@ sub LoadView { if (open(CONV_SET, $name)) { my $nv_text = join("\n", ); close(CONV_SET); - %params = &main'AppSectionValues($nv_text); + %params = &main::AppSectionValues($nv_text); #print STDERR "nv_text: $nv_text<\n"; #for $igc (sort keys %params) { #print STDERR "$igc: $params{$igc}.\n"; @@ -1121,13 +1121,13 @@ sub ProcessImageAttrs { # Check the figure exists if ($fullname eq '') { - &'AppMsg("warning", "unable to find image '$filename'"); + &::AppMsg("warning", "unable to find image '$filename'"); $fullname = $filename; } $attr{'fullname'} = $fullname; # Update the filename - $filename = (&'NameSplit($fullname))[3]; + $filename = (&::NameSplit($fullname))[3]; # Prepend the base location, if necessary $base = $attr{'base'}; diff --git a/perllib/sdf/tohtml.pl b/perllib/sdf/tohtml.pl index 42e1c83..0da2a07 100644 --- a/perllib/sdf/tohtml.pl +++ b/perllib/sdf/tohtml.pl @@ -191,7 +191,7 @@ sub HtmlFormat { @_html_title_div = (); # If we're building topics, save the data for a second pass later - if ($SDF_USER'var{'HTML_TOPICS_MODE'}) { + if ($SDF_USER::var{'HTML_TOPICS_MODE'}) { @data2 = @data; # Get the current message cursor - we skip the second pass @@ -221,28 +221,28 @@ sub HtmlFormat { if ($msg_counts{'error'} || $msg_counts{'abort'} || $msg_counts{'fatal'} ) { # do nothing } - elsif ($SDF_USER'var{'HTML_TOPICS_MODE'}) { + elsif ($SDF_USER::var{'HTML_TOPICS_MODE'}) { - $main = $SDF_USER'var{'DOC_BASE'}; + $main = $SDF_USER::var{'DOC_BASE'}; @topics_table = (); @jumps_table = (); &_HtmlBuildTopicsData($main, *topics_table, *jumps_table); # Save the topics and jump data, so users can (eventually) rebuild # just a single topic. - if ($SDF_USER'var{'HTML_SDJ'}) { + if ($SDF_USER::var{'HTML_SDJ'}) { &_HtmlSaveTopicsData($main, *topics_table, *jumps_table); } # Initialise things ready for the next pass %var2 = %convert_var; # get the original set of variables - $var2{'HTML_MAIN_TITLE'} = $SDF_USER'var{'DOC_TITLE'}; - $var2{'HTML_URL_CONTENTS'} = $SDF_USER'var{'DOC_BASE'} . ".html"; + $var2{'HTML_MAIN_TITLE'} = $SDF_USER::var{'DOC_TITLE'}; + $var2{'HTML_URL_CONTENTS'} = $SDF_USER::var{'DOC_BASE'} . ".html"; $var2{'HTML_TOPICS_MODE'} = 0; $var2{'HTML_SUBTOPICS_MODE'} = 1; &SdfInit(*var2); - &SDF_USER'topics_Filter(*topics_table, 'data', 1); - &SDF_USER'jumps_Filter(*jumps_table, 'data', 1); + &SDF_USER::topics_Filter(*topics_table, 'data', 1); + &SDF_USER::jumps_Filter(*jumps_table, 'data', 1); # Build the sub-topics @contents2 = (); @@ -271,26 +271,26 @@ sub _HtmlBuildTopicsData { local($jump, $physical); # Ensure that the main topic is first and that it has the highest level - #if ($SDF_USER'topics[0] eq $main) { - # $SDF_USER'levels[0] = 0; + #if ($SDF_USER::topics[0] eq $main) { + # $SDF_USER::levels[0] = 0; #} #else { - # unshift(@SDF_USER'topics, pop(@SDF_USER'topics)); - # pop(@SDF_USER'levels); - # unshift(@SDF_USER'levels, 0); + # unshift(@SDF_USER::topics, pop(@SDF_USER::topics)); + # pop(@SDF_USER::levels); + # unshift(@SDF_USER::levels, 0); #} - unshift(@SDF_USER'topics, $main); - unshift(@SDF_USER'levels, 0); + unshift(@SDF_USER::topics, $main); + unshift(@SDF_USER::levels, 0); # Build the topics table @topics_table = ("Topic|Label|Level|Next|Prev|Up"); - $prev = $SDF_USER'topics[$#SDF_USER'topics]; + $prev = $SDF_USER::topics[$#SDF_USER::topics]; %last_at = (); - for ($i = 0; $i <= $#SDF_USER'topics; $i++) { - $topic = $SDF_USER'topics[$i]; - $level = $SDF_USER'levels[$i]; - $label = $SDF_USER'topic_label{$topic}; - $next = $i < $#SDF_USER'topics ? $SDF_USER'topics[$i + 1] : $SDF_USER'topics[0]; + for ($i = 0; $i <= $#SDF_USER::topics; $i++) { + $topic = $SDF_USER::topics[$i]; + $level = $SDF_USER::levels[$i]; + $label = $SDF_USER::topic_label{$topic}; + $next = $i < $#SDF_USER::topics ? $SDF_USER::topics[$i + 1] : $SDF_USER::topics[0]; $up = $last_at{$level - 1}; push(@topics_table, "$topic|$label|$level|$next|$prev|$up"); @@ -301,8 +301,8 @@ sub _HtmlBuildTopicsData { # Build the jumps table @jumps_table = ("Jump|Physical"); - for $jump (sort keys %SDF_USER'jump) { - $physical = $SDF_USER'jump{$jump}; + for $jump (sort keys %SDF_USER::jump) { + $physical = $SDF_USER::jump{$jump}; push(@jumps_table, "$jump|$physical"); } } @@ -423,7 +423,7 @@ sub _HtmlParaAdd { local($note_attrs); # Get the example flag - $is_example = $SDF_USER'parastyles_category{$para_tag} eq 'example'; + $is_example = $SDF_USER::parastyles_category{$para_tag} eq 'example'; # Enumerated lists are the same as list paragraphs at the previous level, # except that we bold the text @@ -433,13 +433,13 @@ sub _HtmlParaAdd { } # Get the target format name - $para_fmt = $SDF_USER'parastyles_to{$para_tag}; + $para_fmt = $SDF_USER::parastyles_to{$para_tag}; $para_fmt = $is_example ? 'PRE' : 'P' if $para_fmt eq ''; # Map the attributes - &SdfAttrMap(*para_attrs, 'html', *SDF_USER'paraattrs_to, - *SDF_USER'paraattrs_map, *SDF_USER'paraattrs_attrs, - $SDF_USER'parastyles_attrs{$para_tag}); + &SdfAttrMap(*para_attrs, 'html', *SDF_USER::paraattrs_to, + *SDF_USER::paraattrs_map, *SDF_USER::paraattrs_attrs, + $SDF_USER::parastyles_attrs{$para_tag}); # Build the Table of Contents as we go $toc_jump = ''; @@ -447,22 +447,22 @@ sub _HtmlParaAdd { $hdg_level = $2; my $orig_para_text = $para_text; $para_text = &SdfHeadingPrefix($1, $2) . $para_text; - if ($SDF_USER'var{'HTML_SUBTOPICS_MODE'}) { + if ($SDF_USER::var{'HTML_SUBTOPICS_MODE'}) { $para_fmt = "H" . substr($para_attrs{'orig_style'}, 1); } else { $para_fmt = "H" . $hdg_level; } - if ($hdg_level <= $SDF_USER'var{'DOC_TOC'} && !$para_attrs{'notoc'}) { + if ($hdg_level <= $SDF_USER::var{'DOC_TOC'} && !$para_attrs{'notoc'}) { # Build a plain list in SDF. If we're building topics and we're # building the contents, make sure the jumps go to the right spot. - if ($SDF_USER'var{'HTML_TOPICS_MODE'}) { - #$toc_jump = &NameJoin('', $SDF_USER'var{'FILE_BASE'}, "html"); - #if ($SDF_USER'topic_label{$SDF_USER'var{'FILE_BASE'}} ne $para_text) { + if ($SDF_USER::var{'HTML_TOPICS_MODE'}) { + #$toc_jump = &NameJoin('', $SDF_USER::var{'FILE_BASE'}, "html"); + #if ($SDF_USER::topic_label{$SDF_USER::var{'FILE_BASE'}} ne $para_text) { # $toc_jump .= "#" . $para_attrs{'id'}; #} - $toc_jump = $_html_jump_id{$SDF_USER'var{'FILE_BASE'},$orig_para_text}; + $toc_jump = $_html_jump_id{$SDF_USER::var{'FILE_BASE'},$orig_para_text}; } else { $toc_jump = "#" . $para_attrs{'id'}; @@ -606,7 +606,7 @@ sub _HtmlParaText { # Expand out link phrases if ($char_tag eq 'L') { - ($text, $url) = &SDF_USER'ExpandLink($text); + ($text, $url) = &SDF_USER::ExpandLink($text); $sect_attrs{'jump'} = $url; } @@ -631,14 +631,14 @@ sub _HtmlParaText { $added_anchors = &_HtmlAddAnchors(*text, *sect_attrs); # Process formatting attributes - &SdfAttrMap(*sect_attrs, 'html', *SDF_USER'phraseattrs_to, - *SDF_USER'phraseattrs_map, *SDF_USER'phraseattrs_attrs, - $SDF_USER'phrasestyles_attrs{$char_tag}); + &SdfAttrMap(*sect_attrs, 'html', *SDF_USER::phraseattrs_to, + *SDF_USER::phraseattrs_map, *SDF_USER::phraseattrs_attrs, + $SDF_USER::phrasestyles_attrs{$char_tag}); $char_attrs = &_HtmlAttr(*sect_attrs); #print STDERR "char_attrs is $char_attrs<\n"; # Map the font - $char_font = $SDF_USER'phrasestyles_to{$char_tag}; + $char_font = $SDF_USER::phrasestyles_to{$char_tag}; $char_font = $char_tag if $char_font eq '' && !$added_anchors; # If attributes are specified for an SDF font, use a SPAN @@ -693,21 +693,21 @@ sub _HtmlFinalise { # Build the BODY opening stuff $body = "BODY"; - $body .= sprintf(' BACKGROUND="%s"', $SDF_USER'var{"HTML_BG_IMAGE"}) if - defined($SDF_USER'var{"HTML_BG_IMAGE"}); - $body .= sprintf(' BGPROPERTIES="FIXED"') if $SDF_USER'var{"HTML_BG_FIXED"}; - $body .= sprintf(' BGCOLOR="%s"', $SDF_USER'var{"HTML_BG_COLOR"}) if - defined($SDF_USER'var{"HTML_BG_COLOR"}); - $body .= sprintf(' TEXT="%s"', $SDF_USER'var{"HTML_TEXT_COLOR"}) if - defined($SDF_USER'var{"HTML_TEXT_COLOR"}); - $body .= sprintf(' LINK="%s"', $SDF_USER'var{"HTML_LINK_COLOR"}) if - defined($SDF_USER'var{"HTML_LINK_COLOR"}); - $body .= sprintf(' VLINK="%s"', $SDF_USER'var{"HTML_VLINK_COLOR"}) if - defined($SDF_USER'var{"HTML_VLINK_COLOR"}); + $body .= sprintf(' BACKGROUND="%s"', $SDF_USER::var{"HTML_BG_IMAGE"}) if + defined($SDF_USER::var{"HTML_BG_IMAGE"}); + $body .= sprintf(' BGPROPERTIES="FIXED"') if $SDF_USER::var{"HTML_BG_FIXED"}; + $body .= sprintf(' BGCOLOR="%s"', $SDF_USER::var{"HTML_BG_COLOR"}) if + defined($SDF_USER::var{"HTML_BG_COLOR"}); + $body .= sprintf(' TEXT="%s"', $SDF_USER::var{"HTML_TEXT_COLOR"}) if + defined($SDF_USER::var{"HTML_TEXT_COLOR"}); + $body .= sprintf(' LINK="%s"', $SDF_USER::var{"HTML_LINK_COLOR"}) if + defined($SDF_USER::var{"HTML_LINK_COLOR"}); + $body .= sprintf(' VLINK="%s"', $SDF_USER::var{"HTML_VLINK_COLOR"}) if + defined($SDF_USER::var{"HTML_VLINK_COLOR"}); # Convert the title, if any, to HTML - $title = $SDF_USER'var{'HTML_TITLE'}; - $title = $SDF_USER'var{'DOC_TITLE'} if !defined($title); + $title = $SDF_USER::var{'HTML_TITLE'}; + $title = $SDF_USER::var{'DOC_TITLE'} if !defined($title); if ($title) { @sdf_title = ("TITLE:$title"); @title = &_HtmlFormatSection(*sdf_title, *dummy); @@ -718,13 +718,13 @@ sub _HtmlFinalise { # Prepend some useful things to the stylesheet, if applicable if ($_html_class_count{'changed'}) { - my $changed_color = $SDF_USER'var{'HTML_CHANGED_COLOR'}; + my $changed_color = $SDF_USER::var{'HTML_CHANGED_COLOR'}; unshift(@_html_stylesheet, ".changed {background-color: $changed_color}"); } # Build the HEAD element (and append BODY opening) - $version = $SDF_USER'var{'SDF_VERSION'}; + $version = $SDF_USER::var{'SDF_VERSION'}; @head = ( '', '', @@ -752,7 +752,7 @@ sub _HtmlFinalise { # Build the body contents, unless we're generating an input file for # the HTMLDOC package - unless ($SDF_USER'var{'HTMLDOC'}) { + unless ($SDF_USER::var{'HTMLDOC'}) { &_HtmlFinaliseBodyContents(*body, *contents); } @@ -782,14 +782,14 @@ sub _HtmlFinaliseBodyContents { # Finish formatting the table of contents # Note: we use a filter so that experts can override things! - &SDF_USER'toc_html_Filter(*contents); + &SDF_USER::toc_html_Filter(*contents); # Now convert it to HTML @html_contents = &_HtmlFormatSection(*contents, *dummy, 'contents'); # If this is a MAIN document, make the body the contents # (i.e. ditch the contents). Otherwise, prepend it. - if ($SDF_USER'var{'HTML_TOPICS_MODE'}) { + if ($SDF_USER::var{'HTML_TOPICS_MODE'}) { @body = @html_contents; } else { @@ -798,36 +798,36 @@ sub _HtmlFinaliseBodyContents { } # If this is not a topic, prepend the title division, if any - unless ($SDF_USER'var{'HTML_SUBTOPICS_MODE'}) { + unless ($SDF_USER::var{'HTML_SUBTOPICS_MODE'}) { unshift(@body, @_html_title_div); } # Convert the header, if any, to HTML $macro = 'HTML_HEADER'; - if ($SDF_USER'var{'HTML_SUBTOPICS_MODE'} && - $SDF_USER'macro{'HTML_TOPIC_HEADER'}) { + if ($SDF_USER::var{'HTML_SUBTOPICS_MODE'} && + $SDF_USER::macro{'HTML_TOPIC_HEADER'}) { $macro = 'HTML_TOPIC_HEADER'; } - if ($SDF_USER'macro{$macro} ne '') { + if ($SDF_USER::macro{$macro} ne '') { @header = ("!$macro"); unshift(@body, &_HtmlFormatSection(*header, *dummy, 'header')); } # Convert the footer, if any, to HTML $macro = 'HTML_FOOTER'; - if ($SDF_USER'var{'HTML_SUBTOPICS_MODE'} && - $SDF_USER'macro{'HTML_TOPIC_FOOTER'}) { + if ($SDF_USER::var{'HTML_SUBTOPICS_MODE'} && + $SDF_USER::macro{'HTML_TOPIC_FOOTER'}) { $macro = 'HTML_TOPIC_FOOTER'; } - if ($SDF_USER'macro{$macro} ne '') { + if ($SDF_USER::macro{$macro} ne '') { @footer = ("!$macro"); push(@body, &_HtmlFormatSection(*footer, *dummy, 'footer')); } # Add the pre-header and post-footer, if any - my $pre_header = $SDF_USER'var{'HTML_PRE_HEADER'}; + my $pre_header = $SDF_USER::var{'HTML_PRE_HEADER'}; unshift(@body, $pre_header) if $pre_header ne ''; - my $post_footer = $SDF_USER'var{'HTML_POST_FOOTER'}; + my $post_footer = $SDF_USER::var{'HTML_POST_FOOTER'}; push(@body, $post_footer) if $post_footer ne ''; } @@ -981,7 +981,7 @@ sub _HtmlAddAnchors { # requested, change the jump value accordingly. Also, # we make sure than any special characters are escaped. $value = $attr{'jump'}; - $user_ext = $SDF_USER'var{'HTML_EXT'}; + $user_ext = $SDF_USER::var{'HTML_EXT'}; if ($user_ext) { $value =~ s/\.html/.$user_ext/; } @@ -1358,7 +1358,7 @@ sub _HtmlHandlerOutput { # Update the current topic name (without the extension) $this_topic = $_html_topic_file[$#_html_topic_file]; $this_topic =~ s/\.html$//; - $SDF_USER'var{'HTML_TOPIC'} = $this_topic; + $SDF_USER::var{'HTML_TOPIC'} = $this_topic; #print STDERR "HTML_TOPIC: $this_topic.\n"; } @@ -1545,39 +1545,39 @@ sub HtmlTopicsModeHeading { # section jumps work as expected if ($var{'HTML_TOPICS_MODE'}) { if (! $topic_label{$file_base} && $file_base ne $var{'DOC_BASE'}) { - $'_html_topic = $file_base; + $::_html_topic = $file_base; push(@levels, $level); - push(@topics, $'_html_topic); - $topic_label{$'_html_topic} = $text; - $topic_level{$'_html_topic} = $level; - $jump = $'_html_topic . ".html"; - $'_html_topic_start{$file_base,$text} = $'_html_topic; + push(@topics, $::_html_topic); + $topic_label{$::_html_topic} = $text; + $topic_level{$::_html_topic} = $level; + $jump = $::_html_topic . ".html"; + $::_html_topic_start{$file_base,$text} = $::_html_topic; } elsif ($level <= $var{'OPT_SPLIT_LEVEL'}) { - if ($'_html_topic_start{$file_base,$text}) { - &'AppMsg("warning", "file base '$file_base' & topic heading '$text' combination is not unique'"); + if ($::_html_topic_start{$file_base,$text}) { + &::AppMsg("warning", "file base '$file_base' & topic heading '$text' combination is not unique'"); return; } - $'_html_topic = &HtmlTopicName($var{'DOC_BASE'}); + $::_html_topic = &HtmlTopicName($var{'DOC_BASE'}); push(@levels, $level); - push(@topics, $'_html_topic); - $topic_label{$'_html_topic} = $text; - $topic_level{$'_html_topic} = $level; - $jump = $'_html_topic . ".html"; - $'_html_topic_start{$file_base,$text} = $'_html_topic; + push(@topics, $::_html_topic); + $topic_label{$::_html_topic} = $text; + $topic_level{$::_html_topic} = $level; + $jump = $::_html_topic . ".html"; + $::_html_topic_start{$file_base,$text} = $::_html_topic; } else { if ($attr{'id'} ne '') { - $jump = $'_html_topic . ".html#" . $attr{"id"}; + $jump = $::_html_topic . ".html#" . $attr{"id"}; } else { - $jump = $'_html_topic . ".html#" . &TextToId($text); + $jump = $::_html_topic . ".html#" . &TextToId($text); } } # Save the jump for this file/text combination. # This is used for TOC generation. - $'_html_jump_id{$file_base,$text} = $jump; + $::_html_jump_id{$file_base,$text} = $jump; # Save the place to jump to for this text. # The jump table is used to resolve SECT jumps (in topics mode). @@ -1600,13 +1600,13 @@ sub HtmlTopicsModeHeading { # * prepend the necessary output directives # * make it the title # * prevent a line above it by setting the notoc attribute. - $topic_base = $'_html_topic_start{$file_base,$text}; + $topic_base = $::_html_topic_start{$file_base,$text}; if ($topic_base) { $topic_file = "$topic_base.html"; @prepend = (); $new_level = $topic_level{$topic_base}; - $close_count = $'_html_topic_level - $new_level + 1; - $'_html_topic_level = $new_level; + $close_count = $::_html_topic_level - $new_level + 1; + $::_html_topic_level = $new_level; for ($i = 0; $i < $close_count; $i++) { push(@prepend, "!output '-'"); } @@ -1629,11 +1629,11 @@ sub HtmlTopicName { local($base) = @_; local($tname); - $'_html_topic_cntr++; + $::_html_topic_cntr++; $tname = $var{'HTML_TOPIC_PATTERN'}; $tname = '$b_$n' if $tname eq ''; $tname =~ s/\$b/$base/g; - $tname =~ s/\$n/$'_html_topic_cntr/; + $tname =~ s/\$n/$::_html_topic_cntr/; return $tname; } diff --git a/perllib/sdf/tolatex.pl b/perllib/sdf/tolatex.pl index 49d190d..7fbcfa1 100755 --- a/perllib/sdf/tolatex.pl +++ b/perllib/sdf/tolatex.pl @@ -169,7 +169,7 @@ $_LATEX_INCELL = 3; ##### Variables ##### # Right margin position -$_latex_margin = $SDF_USER'var{'LATEX_MARGIN'} || $_LATEX_DEFAULT_MARGIN; +$_latex_margin = $SDF_USER::var{'LATEX_MARGIN'} || $_LATEX_DEFAULT_MARGIN; # Counters for ordered lists - index is the level @_latex_list_num = 0; @@ -216,7 +216,7 @@ sub LatexFormat { local(@contents); # Initialise defaults - $_latex_margin = $SDF_USER'var{'LATEX_MARGIN'} || $_LATEX_DEFAULT_MARGIN; + $_latex_margin = $SDF_USER::var{'LATEX_MARGIN'} || $_LATEX_DEFAULT_MARGIN; # Format the paragraphs @contents = (); @@ -291,7 +291,7 @@ sub _LatexParaAdd { local($label); # Set the example flag - $in_example = $SDF_USER'parastyles_category{$para_tag} eq 'example'; + $in_example = $SDF_USER::parastyles_category{$para_tag} eq 'example'; if ($in_example) { if ($_latex_in_example eq 0) { @@ -312,13 +312,13 @@ sub _LatexParaAdd { } # Get the target format name - $para_fmt = $SDF_USER'parastyles_to{$para_tag}; + $para_fmt = $SDF_USER::parastyles_to{$para_tag}; $para_fmt = $para_tag if $para_fmt eq ''; # Map the attributes - &SdfAttrMap(*para_attrs, 'latex', *SDF_USER'paraattrs_to, - *SDF_USER'paraattrs_map, *SDF_USER'paraattrs_attrs, - $SDF_USER'parastyles_attrs{$para_tag}); + &SdfAttrMap(*para_attrs, 'latex', *SDF_USER::paraattrs_to, + *SDF_USER::paraattrs_map, *SDF_USER::paraattrs_attrs, + $SDF_USER::parastyles_attrs{$para_tag}); # Build the Table of Contents as we go @@ -410,17 +410,17 @@ sub _LatexParaText { if ($char_tag eq 'L') { - ($text, $url) = &SDF_USER'ExpandLink($text); + ($text, $url) = &SDF_USER::ExpandLink($text); $sect_attrs{'jump'} = $url; } if ($char_tag ne 'E' - && $SDF_USER'phrasestyles_to{$char_tag} ne 'SDF_VERBATIM') { + && $SDF_USER::phrasestyles_to{$char_tag} ne 'SDF_VERBATIM') { # Escape any special characters $text = &_LatexEscape($text); } - if ( $SDF_USER'phrasestyles_to{$char_tag} eq 'SDF_VERBATIM') { + if ( $SDF_USER::phrasestyles_to{$char_tag} eq 'SDF_VERBATIM') { _LatexCheckVerbatim($text); $text = $_latex_verbatim_open . $text; } @@ -432,13 +432,13 @@ sub _LatexParaText { # Process formatting attributes - &SdfAttrMap(*sect_attrs, 'latex', *SDF_USER'phraseattrs_to, - *SDF_USER'phraseattrs_map, *SDF_USER'phraseattrs_attrs, - $SDF_USER'phrasestyles_attrs{$char_tag}); + &SdfAttrMap(*sect_attrs, 'latex', *SDF_USER::phraseattrs_to, + *SDF_USER::phraseattrs_map, *SDF_USER::phraseattrs_attrs, + $SDF_USER::phrasestyles_attrs{$char_tag}); # Map the font - $char_font = $SDF_USER'phrasestyles_to{$char_tag}; + $char_font = $SDF_USER::phrasestyles_to{$char_tag}; # Add the text for this phrase @@ -513,8 +513,8 @@ sub _LatexElement { $close_list .= "\\end\{$_LATEX_LISTTYPES[$_LATEX_LISTLEVEL]\}\n"; $_LATEX_LISTLEVEL--; } - $latex = $close_list . "\n" . "$SDF_USER'parastyles_to{$tag}\{$text\}\n"; -# . ($char x length("$SDF_USER'parastyles_to{$tag}\{$text\}\n")) . "\n"; + $latex = $close_list . "\n" . "$SDF_USER::parastyles_to{$tag}\{$text\}\n"; +# . ($char x length("$SDF_USER::parastyles_to{$tag}\{$text\}\n")) . "\n"; } @@ -994,12 +994,12 @@ sub _LatexFinalise { local($rec, @html_contents, $toc_posn); # Convert the title - $title = $SDF_USER'var{'DOC_NAME'}; - $author = $SDF_USER'var{'DOC_AUTHOR'}; - $date = $SDF_USER'var{'DOC_DATE'}; + $title = $SDF_USER::var{'DOC_NAME'}; + $author = $SDF_USER::var{'DOC_AUTHOR'}; + $date = $SDF_USER::var{'DOC_DATE'}; # Build the HEAD element (and append BODY opening) - $version = $SDF_USER'var{'SDF_VERSION'}; + $version = $SDF_USER::var{'SDF_VERSION'}; @head = ( '%%% This file was generated using SDF $version by', '%%% Ian Clatworthy (ianc@mincom.com) and the 2latex_ driver', diff --git a/perllib/sdf/tomif.pl b/perllib/sdf/tomif.pl index 7f4495d..0dba010 100755 --- a/perllib/sdf/tomif.pl +++ b/perllib/sdf/tomif.pl @@ -584,7 +584,7 @@ sub MifFormat { $_mif_component_cursor = 0; # Initialise things for building a book, if necessary - if ($SDF_USER'var{'MIF_BOOK_MODE'}) { + if ($SDF_USER::var{'MIF_BOOK_MODE'}) { @_mif_component_tbl = ('Part|Type'); } @@ -606,9 +606,9 @@ sub MifFormat { if ($msg_counts{'error'} || $msg_counts{'abort'} || $msg_counts{'fatal'} ) { # do nothing } - elsif ($SDF_USER'var{'MIF_BOOK_MODE'}) { + elsif ($SDF_USER::var{'MIF_BOOK_MODE'}) { @_mif_component_tbl = &TableParse(@_mif_component_tbl); - @result = &_MifBookBuild(*_mif_component_tbl, $SDF_USER'var{'DOC_BASE'}); + @result = &_MifBookBuild(*_mif_component_tbl, $SDF_USER::var{'DOC_BASE'}); } else { @result = &_MifFinalise(*result); @@ -732,16 +732,16 @@ sub _MifParaAdd { local($index, $index_code); # Get the example flag - $is_example = $SDF_USER'parastyles_category{$para_tag} eq 'example'; + $is_example = $SDF_USER::parastyles_category{$para_tag} eq 'example'; # After headings, use a FIRST tag instead of a normal tag if ($prev_tag =~ /^[HAP]\d$/ && $para_tag eq 'N' && - $SDF_USER'parastyles_to{'FIRST'} ne '') { + $SDF_USER::parastyles_to{'FIRST'} ne '') { $para_tag = 'FIRST'; } # Get the Frame format name - $para_fmt = $SDF_USER'parastyles_to{$para_tag}; + $para_fmt = $SDF_USER::parastyles_to{$para_tag}; $para_fmt = $para_tag if $para_fmt eq ''; $para_fmt .= 'NoTOC' if $para_attrs{'notoc'}; $_mif_parastyle_used{$para_fmt}++; @@ -772,9 +772,9 @@ sub _MifParaAdd { } # Get the format overrides - &SdfAttrMap(*para_attrs, 'mif', *SDF_USER'paraattrs_to, - *SDF_USER'paraattrs_map, *SDF_USER'paraattrs_attrs, - $SDF_USER'parastyles_attrs{$para_tag}); + &SdfAttrMap(*para_attrs, 'mif', *SDF_USER::paraattrs_to, + *SDF_USER::paraattrs_map, *SDF_USER::paraattrs_attrs, + $SDF_USER::parastyles_attrs{$para_tag}); $para_override = &_MifParaSdfAttr(*para_attrs, " "); # Build the paragraph header @@ -821,10 +821,10 @@ sub _MifParaAdd { # If this paragraph is in a generated list, add a cross reference, # unless we're in book mode - unless ($SDF_USER'var{'MIF_BOOK_MODE'}) { + unless ($SDF_USER::var{'MIF_BOOK_MODE'}) { if ($para_tag =~ /^[HAP](\d)$/) { $hdg_level = $1; - if ($hdg_level <= $SDF_USER'var{'DOC_TOC'} && + if ($hdg_level <= $SDF_USER::var{'DOC_TOC'} && !$para_attrs{'notoc'}) { &_MifAddListXref(*para, $para_fmt, *_mif_toc_list, 'TOC'); } @@ -1238,7 +1238,7 @@ sub _MifParasToText { &_MifBuildAttrInfo(); # Decide on the styles to output - @styles = $SDF_USER'var{'MIF_ALL_STYLES'} ? sort keys %paras : + @styles = $SDF_USER::var{'MIF_ALL_STYLES'} ? sort keys %paras : sort keys %_mif_parastyle_used; # Build the result @@ -1371,7 +1371,7 @@ sub _MifTblsToText { local($name, %attr); # Decide on the styles to output - @styles = $SDF_USER'var{'MIF_ALL_STYLES'} ? sort keys %tbls : + @styles = $SDF_USER::var{'MIF_ALL_STYLES'} ? sort keys %tbls : sort keys %_mif_tblstyle_used; # Build the result @@ -1405,7 +1405,7 @@ sub _MifTblFormat { # Add the attributes for $id (sort keys %attr) { - $type = $SDF_USER'tableparams_type{"mif.$id"}; + $type = $SDF_USER::tableparams_type{"mif.$id"}; $value = &_MifAttrFromText($attr{$id}, $type); push(@text, " "); } @@ -1471,7 +1471,7 @@ sub _MifCtrlsToText { # Get the matching variable name and type $var_name = "MIF_" . &MiscMixedToUpper(substr($name, 1)); - $type = $SDF_USER'variables_type{$var_name}; + $type = $SDF_USER::variables_type{$var_name}; # format the value $value = &_MifAttrFromText($ctrls{$name}, $type); @@ -1630,10 +1630,10 @@ sub _MifParaSdfAttr { # get the attribute value & type $value = $attrs{$attr}; - $type = $SDF_USER'paraattrs_type{$attr}; + $type = $SDF_USER::paraattrs_type{$attr}; # Get the Frame prefix - $fm_prefix = $SDF_USER'phraseattrs_name{$attr} ? 'F' : 'Pgf'; + $fm_prefix = $SDF_USER::phraseattrs_name{$attr} ? 'F' : 'Pgf'; # Check it's a Frame attribute next unless $attr =~ s/^mif\.//; @@ -1676,7 +1676,7 @@ sub _MifBuildAttrInfo { return if @_mif_paraattr_name; # Add the attribute information - for $name (sort keys %SDF_USER'paraattrs_type) { + for $name (sort keys %SDF_USER::paraattrs_type) { next unless $name =~ /^mif\./; # Skip attributes we don't weant to output @@ -1699,7 +1699,7 @@ sub _MifBuildAttrInfo { # Store the information push(@_mif_paraattr_name, $short_name); push(@_mif_paraattr_full, $new_name); - push(@_mif_paraattr_type, $SDF_USER'paraattrs_type{$name}); + push(@_mif_paraattr_type, $SDF_USER::paraattrs_type{$name}); } } @@ -1778,7 +1778,7 @@ sub _MifFontFormat { $short_name =~ s/^mif\.//; # get the attribute type and value - $type = $SDF_USER'phraseattrs_type{"mif.$short_name"}; + $type = $SDF_USER::phraseattrs_type{"mif.$short_name"}; $value = $attr{$attr}; # For MIF font definitions, an empty value implies "as-is" @@ -1816,7 +1816,7 @@ sub _MifCharFont { for $attr (sort keys %attr) { # get the attribute type and value - $type = $SDF_USER'phraseattrs_type{$attr}; + $type = $SDF_USER::phraseattrs_type{$attr}; $value = $attr{$attr}; # Check it's a Frame attribute and map it to a MIF name @@ -1857,7 +1857,7 @@ sub _MifParaText { # Escape any special characters if ($sect_type eq 'phrase') { - ($text) = &SDF_USER'ExpandLink($text) if $char_tag eq 'L'; + ($text) = &SDF_USER::ExpandLink($text) if $char_tag eq 'L'; &_MifEscape(*text, $is_example); } elsif ($sect_type eq 'string') { @@ -1886,10 +1886,10 @@ sub _MifParaText { } # Process formatting attributes - &SdfAttrMap(*sect_attrs, 'mif', *SDF_USER'phraseattrs_to, - *SDF_USER'phraseattrs_map, *SDF_USER'phraseattrs_attrs, - $SDF_USER'phrasestyles_attrs{$char_tag}); - $char_font = &_MifCharFont($SDF_USER'phrasestyles_to{$char_tag}, " ", + &SdfAttrMap(*sect_attrs, 'mif', *SDF_USER::phraseattrs_to, + *SDF_USER::phraseattrs_map, *SDF_USER::phraseattrs_attrs, + $SDF_USER::phrasestyles_attrs{$char_tag}); + $char_font = &_MifCharFont($SDF_USER::phrasestyles_to{$char_tag}, " ", %sect_attrs); push(@char_fonts, $char_font); $para .= $char_font; @@ -1993,7 +1993,7 @@ sub _MifAddLink { # local(); if ($link) { - $link = &_MifLink($link, $SDF_USER'var{'MIF_EXT'}); + $link = &_MifLink($link, $SDF_USER::var{'MIF_EXT'}); $para .= " \n" . " \n" . @@ -2023,18 +2023,18 @@ sub _MifFinalise { local($mainflow); # Process document control settings - &_MifProcessControls(*SDF_USER'var, $component_type); + &_MifProcessControls(*SDF_USER::var, $component_type); # Get the page width and height - $pwidth = $SDF_USER'var{'DOC_PAGE_WIDTH'}; - $pheight = $SDF_USER'var{'DOC_PAGE_HEIGHT'}; + $pwidth = $SDF_USER::var{'DOC_PAGE_WIDTH'}; + $pheight = $SDF_USER::var{'DOC_PAGE_HEIGHT'}; # Generate the master pages $component_prefix = $component_type eq '' ? '' : $component_type . "_"; &_MifAddMasterPage('First', $component_prefix . "FIRST", $pwidth, $pheight, $_MIF_TEXTFLOW_MAIN); &_MifAddMasterPage('Right', $component_prefix . "RIGHT", $pwidth, $pheight); - if ($SDF_USER'var{'DOC_TWO_SIDES'}) { + if ($SDF_USER::var{'DOC_TWO_SIDES'}) { &_MifAddMasterPage('Left', $component_prefix . "LEFT", $pwidth, $pheight); } @@ -2127,8 +2127,8 @@ $igc_start = time; "", "", "", - "", - "", + "", + "", " # end of Notes", @text); @@ -2191,12 +2191,12 @@ sub _MifProcessControls { $_mif_ctrls{'DPageNumStyle'} = 'Arabic'; if ($component_type eq 'CHAPTER') { $sdf_tag = $vars{'OPT_COMPONENT_COVER'} ? 'H1NUM' : 'H1'; - $mif_tag = $SDF_USER'parastyles_to{$sdf_tag}; + $mif_tag = $SDF_USER::parastyles_to{$sdf_tag}; $prefix = "<\$paranumonly[$mif_tag]>"; } elsif ($component_type eq 'APPENDIX') { $sdf_tag = $vars{'OPT_COMPONENT_COVER'} ? 'A1NUM' : 'A1'; - $mif_tag = $SDF_USER'parastyles_to{$sdf_tag}; + $mif_tag = $SDF_USER::parastyles_to{$sdf_tag}; $prefix = "<\$paranumonly[$mif_tag]>"; } elsif ($component_type eq 'IX') { @@ -2280,7 +2280,7 @@ sub _MifAddMasterPage { $prefix = $sdf_type =~ /^IX/ ? 'OPT_IX' : 'OPT'; $sh_width = &SdfVarPoints("${prefix}_SIDEHEAD_WIDTH"); $sh_gap = &SdfVarPoints("${prefix}_SIDEHEAD_GAP"); - $col_count = $SDF_USER'var{"${prefix}_COLUMNS"}; + $col_count = $SDF_USER::var{"${prefix}_COLUMNS"}; $col_gap = &SdfVarPoints("${prefix}_COLUMN_GAP"); # Add the main section @@ -2565,7 +2565,7 @@ sub _MifAddPageBackground { #$bg_ext = 'bg' . substr($sdf_fmext, -1); $bg_ext = 'mif'; $bg_short = &NameJoin('', $background, $bg_ext); - $bg_file = &SDF_USER'FindFile($bg_short); + $bg_file = &SDF_USER::FindFile($bg_short); if ($bg_file eq '') { &AppMsg("warning", "unable to find background file '$bg_short'"); return; @@ -2637,7 +2637,7 @@ sub _MifAddRefPages { for $name (sort keys %_mif_frames) { %attr = &_MifAttrSplit($_mif_frames{$name}); $width = $attr{'Width'}; - $width = $SDF_USER'var{'DOC_FULL_WIDTH'} if $width eq ''; + $width = $SDF_USER::var{'DOC_FULL_WIDTH'} if $width eq ''; $height = $attr{'Height'}; $page_y += $height + 36; @@ -2706,9 +2706,9 @@ sub _MifAddSpecialTextFlow { # we make sure this cannot happen!!! @mif_text = (); if ($name eq 'TOC') { - for ($j = 1; $j <= $SDF_USER'var{'DOC_TOC'}; $j++) { + for ($j = 1; $j <= $SDF_USER::var{'DOC_TOC'}; $j++) { for $tagtype ('H', 'A', 'P') { - $hdgtag = $SDF_USER'parastyles_to{"$tagtype$j"}; + $hdgtag = $SDF_USER::parastyles_to{"$tagtype$j"}; $tag = $hdgtag . $name; $_mif_parastyle_used{$tag}++; $layout = &_MifFixLayout($attr{'Layout'}, $hdgtag); @@ -2723,7 +2723,7 @@ sub _MifAddSpecialTextFlow { } # Ensure the index makes it into the contents - $hdgtag = $SDF_USER'parastyles_to{"IXT"}; + $hdgtag = $SDF_USER::parastyles_to{"IXT"}; $tag = $hdgtag . $name; $_mif_parastyle_used{$tag}++; $layout = &_MifFixLayout($attr{'Layout'}, $hdgtag); @@ -2736,7 +2736,7 @@ sub _MifAddSpecialTextFlow { "> # end of Para"); } elsif ($name eq 'LOF') { - $hdgtag = $SDF_USER'parastyles_to{"FT"}; + $hdgtag = $SDF_USER::parastyles_to{"FT"}; $tag = $hdgtag . $name; $_mif_parastyle_used{$tag}++; $layout = &_MifFixLayout($attr{'Layout'}, $hdgtag); @@ -2749,7 +2749,7 @@ sub _MifAddSpecialTextFlow { "> # end of Para"); } elsif ($name eq 'LOT') { - $hdgtag = $SDF_USER'parastyles_to{"TT"}; + $hdgtag = $SDF_USER::parastyles_to{"TT"}; $tag = $hdgtag . $name; $_mif_parastyle_used{$tag}++; $layout = &_MifFixLayout($attr{'Layout'}, $hdgtag); @@ -2835,7 +2835,7 @@ sub _MifAddLists { local($toc_offset); # Set some flags based on the output ultimately generated - $target = $SDF_USER'var{'OPT_TARGET'}; + $target = $SDF_USER::var{'OPT_TARGET'}; $soft = $target eq 'help' || $target eq 'html'; # Process the list definitions (add xrefs, etc.) @@ -2887,16 +2887,16 @@ sub _MifListTitle { # If we're building component covers, make sure that the relevant SDF # macro gets called $mif = ''; - if ($SDF_USER'var{'OPT_COMPONENT_COVER'} && + if ($SDF_USER::var{'OPT_COMPONENT_COVER'} && ($type eq 'TOC' || $type eq 'IX')) { @sdf_data = ('!DOC_COMPONENT_COVER_BEGIN'); &_MifAddSection(*mif_data, *sdf_data); $mif = join("\n", @mif_data) . "\n"; } - $tag = $SDF_USER'parastyles_to{$type . 'T'}; + $tag = $SDF_USER::parastyles_to{$type . 'T'}; $_mif_parastyle_used{$tag}++; - $title = $SDF_USER'var{"DOC_${type}_TITLE"}; + $title = $SDF_USER::var{"DOC_${type}_TITLE"}; $title = $default_title if $title eq ''; &_MifEscape(*title); $mif .= @@ -3034,7 +3034,7 @@ sub _MifHandlerTuning { # Find the template file. A template file is searched for by # looking for {{tuning}}.{{fmver}} along the SDF include # path, where {{sdfver}} is fm4 or fm5 (typically). - $template_file = &SDF_USER'FindFile(&NameJoin('', $tuning, $sdf_fmext)); + $template_file = &SDF_USER::FindFile(&NameJoin('', $tuning, $sdf_fmext)); if ($template_file eq '') { #&AppMsg("warning", "unable to find template '$tuning'"); return; @@ -3092,7 +3092,7 @@ sub _MifHandlerTable { # Get the style $style = $attr{'style'}; - $style_tag = $SDF_USER'tablestyles_to{$style}; + $style_tag = $SDF_USER::tablestyles_to{$style}; if ($style_tag eq '') { &AppMsg("warning", "unknown table style '$style'"); $style_tag = $style; @@ -3128,10 +3128,10 @@ sub _MifHandlerTable { # Get the table width and 1% (i.e. unit) width if ($attr{'wide'}) { - $tbl_width = $SDF_USER'var{'DOC_FULL_WIDTH'} - $indent; + $tbl_width = $SDF_USER::var{'DOC_FULL_WIDTH'} - $indent; } else { - $tbl_width = $SDF_USER'var{'DOC_TEXT_WIDTH'} - $indent; + $tbl_width = $SDF_USER::var{'DOC_TEXT_WIDTH'} - $indent; } $unit_width = $tbl_width / 100; @@ -3161,7 +3161,7 @@ sub _MifHandlerTable { # If we're ultimately going to rtf or hlp, output a simple set of # column widths - $target = $SDF_USER'var{'OPT_TARGET'}; + $target = $SDF_USER::var{'OPT_TARGET'}; if ($target eq 'hlp' || $target eq 'rtf') { push(@outbuffer, " "); @widths = split(/,/, $attr{'format'}); @@ -3387,7 +3387,7 @@ sub _MifHandlerEndTable { $tbl_title = pop(@_mif_tbl_title); $landscape = pop(@_mif_tbl_landscape); if (@_mif_tbl_id) { - &'AppMsg("warning", "ignoring nested MIF table"); + &::AppMsg("warning", "ignoring nested MIF table"); } else { if ($landscape) { @@ -3891,7 +3891,7 @@ sub _MifRunningHF { # Convert the SDF tag names to Frame ones @tags = split(/,/, $tags); for $tag (@tags) { - $fmtag = $SDF_USER'parastyles_to{$tag}; + $fmtag = $SDF_USER::parastyles_to{$tag}; $tag = $fmtag if $fmtag ne ''; } $defn = "<\$$type\[" . join(",", @tags) . "]>"; @@ -4042,7 +4042,7 @@ sub _MifAddRef { #if (! &NameIsAbsolute($name) && $attr{'root'} ne '') { #$name = &NameJoin($attr{'root'}, $name); #} - if ($SDF_USER'var{'OPT_TARGET'} eq 'hlp') { + if ($SDF_USER::var{'OPT_TARGET'} eq 'hlp') { $mif_path = &_MifPathName($name); } else { @@ -4129,7 +4129,7 @@ sub _MifUpdateMainFlow { # Get the paragraph tag: 'Title' or 'Body'? if ($title ne '') { - $tag = $SDF_USER'parastyles_to{$_MIF_TITLE_TAG{$what}}; + $tag = $SDF_USER::parastyles_to{$_MIF_TITLE_TAG{$what}}; # Escape special characters $title =~ s/([\>\\])/\\$1/g; @@ -4138,7 +4138,7 @@ sub _MifUpdateMainFlow { $title =~ s/([`])/\\Q/g; } else { - $tag = $SDF_USER'parastyles_to{$_MIF_NOTITLE_TAG{$what}}; + $tag = $SDF_USER::parastyles_to{$_MIF_NOTITLE_TAG{$what}}; } # Build the paragraph @@ -4283,12 +4283,12 @@ sub _MifAddNestedText { # The height is calculated as a percentage of the text column # height. We also need an "adjusted height" for the embedded # text rectangle, otherwise Frame crops the table border. - $width = $SDF_USER'var{'DOC_TEXT_WIDTH'}; + $width = $SDF_USER::var{'DOC_TEXT_WIDTH'}; if ($nested == 1) { - $height = $SDF_USER'var{'DOC_TEXT_HEIGHT'}; + $height = $SDF_USER::var{'DOC_TEXT_HEIGHT'}; } elsif ($nested =~ /^(\d+)\%?$/) { - $height = $SDF_USER'var{'DOC_TEXT_HEIGHT'} * $1 / 100; + $height = $SDF_USER::var{'DOC_TEXT_HEIGHT'} * $1 / 100; } else { $height = &SdfPoints($nested); @@ -4316,7 +4316,7 @@ sub _MifAddNestedText { push(@_mif_figure, join("\n", @frame)); # Build the new text - $tag = $SDF_USER'parastyles_to{'N'}; + $tag = $SDF_USER::parastyles_to{'N'}; $_mif_parastyle_used{$tag}++; @result = ( " 2) { - &SDF_USER'PrependText( + &SDF_USER::PrependText( "!DOC_COMPONENT_END", "!output '-'", "!output '$cname'", @@ -4494,7 +4494,7 @@ sub MifNewComponent { "!DOC_COMPONENT_BEGIN"); } else { - $SDF_USER'var{'DOC_COMPONENT'} = $type; + $SDF_USER::var{'DOC_COMPONENT'} = $type; } # Return the component name (needed for stdlib/mif.sdt) @@ -4511,7 +4511,7 @@ sub _MifComponentName { local($cname); $_mif_component_cntr++; - $cname = $SDF_USER'var{'MIF_COMPONENT_PATTERN'}; + $cname = $SDF_USER::var{'MIF_COMPONENT_PATTERN'}; $cname = '$b_$n.$o' if $cname eq ''; $cname =~ s/\$b/$base/g; $cname =~ s/\$n/$_mif_component_cntr/; @@ -4548,17 +4548,17 @@ sub _MifBookBuild { %values = &TableRecSplit(*flds, $book[$i]); $type = $values{'Type'}; if ($added_toc == 0 && $type ne 'front' && $type ne 'pretoc') { - if ($SDF_USER'var{'DOC_TOC'}) { + if ($SDF_USER::var{'DOC_TOC'}) { $mif_file = &_MifBookDerived($base, 'toc', 'Table of Contents'); &_MifBookAddPart(*newbook, *batch, $mif_file, 'toc'); push(@sdf_book_files, $mif_file); } - if ($SDF_USER'var{'DOC_LOF'}) { + if ($SDF_USER::var{'DOC_LOF'}) { $mif_file = &_MifBookDerived($base, 'lof', 'List of Figures'); &_MifBookAddPart(*newbook, *batch, $mif_file, 'lof'); push(@sdf_book_files, $mif_file); } - if ($SDF_USER'var{'DOC_LOT'}) { + if ($SDF_USER::var{'DOC_LOT'}) { $mif_file = &_MifBookDerived($base, 'lot', 'List of Tables'); &_MifBookAddPart(*newbook, *batch, $mif_file, 'lot'); push(@sdf_book_files, $mif_file); @@ -4571,7 +4571,7 @@ sub _MifBookBuild { &_MifBookAddPart(*newbook, *batch, $mif_file, $type); push(@sdf_book_files, $mif_file); } - if ($SDF_USER'var{'DOC_IX'}) { + if ($SDF_USER::var{'DOC_IX'}) { $mif_file = &_MifBookDerived($base, 'ix', 'Index'); &_MifBookAddPart(*newbook, *batch, $mif_file, 'ix'); push(@sdf_book_files, $mif_file); @@ -4581,10 +4581,10 @@ sub _MifBookBuild { &_MifRunBatch(*batch, $verbose); # Cleanup the MIF for each part - &SDF_USER'SdfBookClean(); + &SDF_USER::SdfBookClean(); # Return result - return &MifBook(*newbook, $SDF_USER'var{'OPT_NUMBER_PER_COMPONENT'}); + return &MifBook(*newbook, $SDF_USER::var{'OPT_NUMBER_PER_COMPONENT'}); } # @@ -4604,7 +4604,7 @@ sub _MifBookDerived { # Build the sdf $upper_type = "\U$type"; $tag = $upper_type . 'T'; - $title = $SDF_USER'var{"DOC_${upper_type}_TITLE"}; + $title = $SDF_USER::var{"DOC_${upper_type}_TITLE"}; $title = $default_title if $title eq ''; @sdf_text = ("$tag:$title"); @@ -4710,22 +4710,22 @@ sub MifBook { if ($type eq 'toc') { $suffix = 'TOC'; @tags = (); - for ($j = 1; $j <= $SDF_USER'var{'DOC_TOC'}; $j++) { - push(@tags, $SDF_USER'parastyles_to{"H$j"}, - $SDF_USER'parastyles_to{"A$j"}, $SDF_USER'parastyles_to{"P$j"}); + for ($j = 1; $j <= $SDF_USER::var{'DOC_TOC'}; $j++) { + push(@tags, $SDF_USER::parastyles_to{"H$j"}, + $SDF_USER::parastyles_to{"A$j"}, $SDF_USER::parastyles_to{"P$j"}); } - push(@tags, $SDF_USER'parastyles_to{"LOFT"}); - push(@tags, $SDF_USER'parastyles_to{"LOTT"}); - push(@tags, $SDF_USER'parastyles_to{"IXT"}); + push(@tags, $SDF_USER::parastyles_to{"LOFT"}); + push(@tags, $SDF_USER::parastyles_to{"LOTT"}); + push(@tags, $SDF_USER::parastyles_to{"IXT"}); } elsif ($type eq 'lof') { $suffix = 'LOF'; - @tags = ($SDF_USER'parastyles_to{"FT"}); + @tags = ($SDF_USER::parastyles_to{"FT"}); $settings{'StartPageSide'} = 'NextAvailableSide'; } elsif ($type eq 'lot') { $suffix = 'LOT'; - @tags = ($SDF_USER'parastyles_to{"TT"}); + @tags = ($SDF_USER::parastyles_to{"TT"}); $settings{'StartPageSide'} = 'NextAvailableSide'; } elsif ($type eq 'ix') { diff --git a/perllib/sdf/topod.pl b/perllib/sdf/topod.pl index 81ae301..963a170 100755 --- a/perllib/sdf/topod.pl +++ b/perllib/sdf/topod.pl @@ -202,22 +202,22 @@ sub _PodParaAdd { local($indent); # Set the example flag - $_pod_in_example = $SDF_USER'parastyles_category{$para_tag} eq 'example'; + $_pod_in_example = $SDF_USER::parastyles_category{$para_tag} eq 'example'; # Get the target format name - $para_fmt = $SDF_USER'parastyles_to{$para_tag}; + $para_fmt = $SDF_USER::parastyles_to{$para_tag}; $para_fmt = $para_tag if $para_fmt eq ''; # Map the attributes - &SdfAttrMap(*para_attrs, 'pod', *SDF_USER'paraattrs_to, - *SDF_USER'paraattrs_map, *SDF_USER'paraattrs_attrs, - $SDF_USER'parastyles_attrs{$para_tag}); + &SdfAttrMap(*para_attrs, 'pod', *SDF_USER::paraattrs_to, + *SDF_USER::paraattrs_map, *SDF_USER::paraattrs_attrs, + $SDF_USER::parastyles_attrs{$para_tag}); # Build the Table of Contents as we go $toc_jump = ''; if ($para_tag =~ /^[HAP](\d)$/) { $hdg_level = $1; - if ($hdg_level <= $SDF_USER'var{'DOC_TOC'} && !$para_attrs{'notoc'}) { + if ($hdg_level <= $SDF_USER::var{'DOC_TOC'} && !$para_attrs{'notoc'}) { # Build a plain list in SDF $toc_jump = $para_attrs{'id'}; @@ -326,12 +326,12 @@ sub _PodParaText { $text = &_PodEscape($text, 1); # Process formatting attributes - &SdfAttrMap(*sect_attrs, 'pod', *SDF_USER'phraseattrs_to, - *SDF_USER'phraseattrs_map, *SDF_USER'phraseattrs_attrs, - $SDF_USER'phrasestyles_attrs{$char_tag}); + &SdfAttrMap(*sect_attrs, 'pod', *SDF_USER::phraseattrs_to, + *SDF_USER::phraseattrs_map, *SDF_USER::phraseattrs_attrs, + $SDF_USER::phrasestyles_attrs{$char_tag}); # Map the font - italics is the default - $char_font = $SDF_USER'phrasestyles_to{$char_tag}; + $char_font = $SDF_USER::phrasestyles_to{$char_tag}; $char_font = 'I' if $char_font eq ''; # Add the text for this phrase @@ -442,7 +442,7 @@ sub _PodElement { # For headings, map the tag to a command if ($tag =~ /^head/) { - if ($SDF_USER'var{'MAN_CONVENTIONS'}) { + if ($SDF_USER::var{'MAN_CONVENTIONS'}) { if ($tag =~ /^head1/ && !$seen_name) { $seen_name = 1; return "=$tag NAME\n\n$text\n"; diff --git a/perllib/sdf/tosgml.pl b/perllib/sdf/tosgml.pl index 79f34fc..6779719 100755 --- a/perllib/sdf/tosgml.pl +++ b/perllib/sdf/tosgml.pl @@ -197,7 +197,7 @@ sub _SgmlParaAdd { local($list_tag); # Get the example flag - $is_example = $SDF_USER'parastyles_category{$para_tag} eq 'example'; + $is_example = $SDF_USER::parastyles_category{$para_tag} eq 'example'; # Enumerated lists are the same as list paragraphs at the previous level, # except that we bold the text @@ -207,13 +207,13 @@ sub _SgmlParaAdd { } # Get the target format name - $para_fmt = $SDF_USER'parastyles_to{$para_tag}; + $para_fmt = $SDF_USER::parastyles_to{$para_tag}; $para_fmt = $is_example ? 'tscreen' : 'p' if $para_fmt eq ''; # Map the attributes - &SdfAttrMap(*para_attrs, 'sgml', *SDF_USER'paraattrs_to, - *SDF_USER'paraattrs_map, *SDF_USER'paraattrs_attrs, - $SDF_USER'parastyles_attrs{$para_tag}); + &SdfAttrMap(*para_attrs, 'sgml', *SDF_USER::paraattrs_to, + *SDF_USER::paraattrs_map, *SDF_USER::paraattrs_attrs, + $SDF_USER::parastyles_attrs{$para_tag}); # Handle headings if ($para_tag =~ /^[HAP](\d)$/) { @@ -326,7 +326,7 @@ sub _SgmlParaText { # Expand out link phrases if ($char_tag eq 'L') { - ($text, $url) = &SDF_USER'ExpandLink($text); + ($text, $url) = &SDF_USER::ExpandLink($text); $sect_attrs{'jump'} = $url; } @@ -342,12 +342,12 @@ sub _SgmlParaText { $added_anchors = &_SgmlAddAnchors(*text, *sect_attrs); # Process formatting attributes - &SdfAttrMap(*sect_attrs, 'sgml', *SDF_USER'phraseattrs_to, - *SDF_USER'phraseattrs_map, *SDF_USER'phraseattrs_attrs, - $SDF_USER'phrasestyles_attrs{$char_tag}); + &SdfAttrMap(*sect_attrs, 'sgml', *SDF_USER::phraseattrs_to, + *SDF_USER::phraseattrs_map, *SDF_USER::phraseattrs_attrs, + $SDF_USER::phrasestyles_attrs{$char_tag}); # Map the font - $char_font = $SDF_USER'phrasestyles_to{$char_tag}; + $char_font = $SDF_USER::phrasestyles_to{$char_tag}; $char_font = 'em' if $char_font eq '' && !$added_anchors; # Add the text for this phrase @@ -532,7 +532,7 @@ sub _SgmlAddAnchors { # requested, change the jump value accordingly. Also, # we make sure than any special characters are escaped. $value = $attr{'jump'}; - $user_ext = $SDF_USER'var{'SGML_EXT'}; + $user_ext = $SDF_USER::var{'SGML_EXT'}; if ($user_ext) { $value =~ s/\.sgml/.$user_ext/; } diff --git a/perllib/sdf/totxt.pl b/perllib/sdf/totxt.pl index 289d5e1..33dfd1e 100755 --- a/perllib/sdf/totxt.pl +++ b/perllib/sdf/totxt.pl @@ -168,7 +168,7 @@ $_TXT_INCELL = 3; ##### Variables ##### # Right margin position -$_txt_margin = $SDF_USER'var{'TXT_MARGIN'} || $_TXT_DEFAULT_MARGIN; +$_txt_margin = $SDF_USER::var{'TXT_MARGIN'} || $_TXT_DEFAULT_MARGIN; # Counters for ordered lists - index is the level @_txt_list_num = 0; @@ -199,7 +199,7 @@ sub TxtFormat { local(@contents); # Initialise defaults - $_txt_margin = $SDF_USER'var{'TXT_MARGIN'} || $_TXT_DEFAULT_MARGIN; + $_txt_margin = $SDF_USER::var{'TXT_MARGIN'} || $_TXT_DEFAULT_MARGIN; # Format the paragraphs @contents = (); @@ -273,7 +273,7 @@ sub _TxtParaAdd { local($label); # Set the example flag - $in_example = $SDF_USER'parastyles_category{$para_tag} eq 'example'; + $in_example = $SDF_USER::parastyles_category{$para_tag} eq 'example'; # Enumerated lists are the same as list paragraphs at the previous level if ($para_tag =~ /^LI(\d)$/) { @@ -281,20 +281,20 @@ sub _TxtParaAdd { } # Get the target format name - $para_fmt = $SDF_USER'parastyles_to{$para_tag}; + $para_fmt = $SDF_USER::parastyles_to{$para_tag}; $para_fmt = $para_tag if $para_fmt eq ''; # Map the attributes - &SdfAttrMap(*para_attrs, 'txt', *SDF_USER'paraattrs_to, - *SDF_USER'paraattrs_map, *SDF_USER'paraattrs_attrs, - $SDF_USER'parastyles_attrs{$para_tag}); + &SdfAttrMap(*para_attrs, 'txt', *SDF_USER::paraattrs_to, + *SDF_USER::paraattrs_map, *SDF_USER::paraattrs_attrs, + $SDF_USER::parastyles_attrs{$para_tag}); # Build the Table of Contents as we go $toc_jump = ''; if ($para_tag =~ /^([HAP])(\d)$/) { $hdg_level = $2; $para_text = &SdfHeadingPrefix($1, $2) . $para_text; - if ($hdg_level <= $SDF_USER'var{'DOC_TOC'} && !$para_attrs{'notoc'}) { + if ($hdg_level <= $SDF_USER::var{'DOC_TOC'} && !$para_attrs{'notoc'}) { # Build a plain list in SDF $toc_jump = $para_attrs{'id'}; @@ -391,7 +391,7 @@ sub _TxtParaText { } elsif ($sect_type eq 'phrase') { - ($text) = &SDF_USER'ExpandLink($text) if $char_tag eq 'L'; + ($text) = &SDF_USER::ExpandLink($text) if $char_tag eq 'L'; $para .= $text; } @@ -449,7 +449,7 @@ sub _TxtElement { # For headings, underline the text unless requested not to elsif ($tag =~ /^[HAP](\d)/) { $txt = "$text\n"; - unless ($SDF_USER'var{'TXT_HDG_UL_OFF'}){ + unless ($SDF_USER::var{'TXT_HDG_UL_OFF'}){ $char = $1 == 1 ? "=" : "-"; $txt .= ($char x length($text)) . "\n"; } diff --git a/perllib/sdf/values.pl b/perllib/sdf/values.pl index 83de635..19c2b53 100644 --- a/perllib/sdf/values.pl +++ b/perllib/sdf/values.pl @@ -61,7 +61,7 @@ sub references_Printdoc_Value { # Get the filename and check it exists $jump = &Value("references", $name, "Jump", $view); - $jump = &'NameSubExt($jump, "ps"); + $jump = &::NameSubExt($jump, "ps"); return '' unless -f $jump; # Build the cgi call, using DIR_ABS_URL to get the absolute URL of @@ -121,11 +121,11 @@ sub AttrToFile { # Get the filename $jump = &Value($class, $name, "Jump", $view); if ($suffix) { - ($dir, $base, $ext) = &'NameSplit($jump); - $jump = &'NameJoin($dir, $base . "_$image", $ext); + ($dir, $base, $ext) = &::NameSplit($jump); + $jump = &::NameJoin($dir, $base . "_$image", $ext); } else { - $jump = &'NameSubExt($jump, $image); + $jump = &::NameSubExt($jump, $image); } # If the name looks like a URL, assume it exists. @@ -146,7 +146,7 @@ sub references_PS_Value { # Get the filename $jump = &Value("references", $name, "Jump", $view); - $jump = &'NameSubExt($jump, "ps"); + $jump = &::NameSubExt($jump, "ps"); # If the name looks like a URL, assume it exists. # Otherwise, we assume it a filename and only return an icon @@ -165,7 +165,7 @@ sub references_PDF_Value { # Get the filename $jump = &Value("references", $name, "Jump", $view); - $jump = &'NameSubExt($jump, "pdf"); + $jump = &::NameSubExt($jump, "pdf"); # If the name looks like a URL, assume it exists. # Otherwise, we assume it a filename and only return an icon @@ -184,7 +184,7 @@ sub references_TXT_Value { # Get the filename $jump = &Value("references", $name, "Jump", $view); - $jump = &'NameSubExt($jump, "txt"); + $jump = &::NameSubExt($jump, "txt"); # If the name looks like a URL, assume it exists. # Otherwise, we assume it a filename and only return an icon @@ -203,7 +203,7 @@ sub references_DOC_Value { # Get the filename $jump = &Value("references", $name, "Jump", $view); - $jump = &'NameSubExt($jump, "doc"); + $jump = &::NameSubExt($jump, "doc"); # If the name looks like a URL, assume it exists. # Otherwise, we assume it a filename and only return an icon @@ -238,7 +238,7 @@ sub references_Pages_Value { # Get the filename and check it exists $jump = &Value("references", $name, "Jump", $view); - $jump = &'NameSubExt($jump, "ps"); + $jump = &::NameSubExt($jump, "ps"); return '' unless -f $jump; # build the result diff --git a/t/macro/inherit.sdf b/t/macro/inherit.sdf index 7663b35..f5e7f34 100644 --- a/t/macro/inherit.sdf +++ b/t/macro/inherit.sdf @@ -6,7 +6,7 @@ sub dump_path_Macro { local($sdfhome, $igc); - $sdfhome = $'app_lib_dir; + $sdfhome = $::app_lib_dir; print "SDF include path is now:\n"; for $igc (@include_path) { $igc =~ s/$sdfhome/\$SDFHOME/; -- cgit v1.2.3