[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 11/14: [grog]: Rename `tmac_ext` scalar.
From: |
G. Branden Robinson |
Subject: |
[groff] 11/14: [grog]: Rename `tmac_ext` scalar. |
Date: |
Mon, 28 Jun 2021 00:44:52 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 92d81ecca33de60a8e644d4cc989a980c6246ada
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Jun 27 16:32:08 2021 +1000
[grog]: Rename `tmac_ext` scalar.
* src/utils/grog/grog.pl: Rename `tmac_ext` scalar to
`inferred_main_package`.
---
ChangeLog | 5 ++++-
src/utils/grog/grog.pl | 24 +++++++++++++-----------
2 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fb439c0..a076da3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,13 @@
2021-06-27 G. Branden Robinson <g.branden.robinson@gmail.com>
- [grog]: Discard filename extension-based inference.
+ [grog]: Refactor. Discard filename extension-based inference.
* src/utils/grog/grog.pl (handle_file_ext): Delete.
(top level): Drop call site.
+ * src/utils/grog/grog.pl: Rename `tmac_ext` scalar to
+ `inferred_main_package`.
+
2021-06-27 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/utils/grog/grog.pl (handle_args): Complain less noisily
diff --git a/src/utils/grog/grog.pl b/src/utils/grog/grog.pl
index 4c2c193..012c176 100644
--- a/src/utils/grog/grog.pl
+++ b/src/utils/grog/grog.pl
@@ -161,7 +161,7 @@ my %preprocs_tmacs =
my @filespec;
-my $tmac_ext = '';
+my $inferred_main_package = '';
my $had_inference_problem = 0;
my $had_processing_problem = 0;
@@ -844,7 +844,7 @@ sub make_groff_preproc {
sub make_groff_tmac_man_ms {
- # globals: @filespec, $tmac_ext, %Groff
+ # globals: @filespec, $inferred_main_package, %Groff
# 'man' requests, not from 'ms'
if ( $Groff{'SS'} || $Groff{'SY'} || $Groff{'OP'} ||
@@ -852,10 +852,11 @@ sub make_groff_tmac_man_ms {
$Groff{'man'} = 1;
push(@m, '-man');
- $tmac_ext = 'man' unless ( $tmac_ext );
+ $inferred_main_package = 'man' unless ( $inferred_main_package );
&warn("man macro calls found, but file name extension was '"
- . $tmac_ext . "'") unless ( $tmac_ext eq 'man' );
- $tmac_ext = 'man';
+ . $inferred_main_package . "'")
+ unless ( $inferred_main_package eq 'man' );
+ $inferred_main_package = 'man';
return 1; # true
}
@@ -871,10 +872,11 @@ sub make_groff_tmac_man_ms {
$Groff{'ms'} = 1;
push(@m, '-ms');
- $tmac_ext = 'ms' unless ( $tmac_ext );
+ $inferred_main_package = 'ms' unless ( $inferred_main_package );
&warn("ms macro calls found, but file name extension was '"
- . $tmac_ext . "'") unless ( $tmac_ext eq 'ms' );
- $tmac_ext = 'ms';
+ . $inferred_main_package . "'")
+ unless ( $inferred_main_package eq 'ms' );
+ $inferred_main_package = 'ms';
return 1; # true
}
@@ -882,11 +884,11 @@ sub make_groff_tmac_man_ms {
# both 'man' and 'ms' requests
if ( $Groff{'P'} || $Groff{'IP'} ||
$Groff{'LP'} || $Groff{'PP'} || $Groff{'SH'} ) {
- if ( $tmac_ext eq 'man' ) {
+ if ( $inferred_main_package eq 'man' ) {
$Groff{'man'} = 1;
push(@m, '-man');
return 1; # true
- } elsif ( $tmac_ext eq 'ms' ) {
+ } elsif ( $inferred_main_package eq 'ms' ) {
$Groff{'ms'} = 1;
push(@m, '-ms');
return 1; # true
@@ -897,7 +899,7 @@ sub make_groff_tmac_man_ms {
sub make_groff_tmac_others {
- # globals: @filespec, $tmac_ext, %Groff
+ # globals: @filespec, $inferred_main_package, %Groff
# mdoc
if ( ( $Groff{'Oo'} && $Groff{'Oc'} ) || $Groff{'Dd'} ) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 11/14: [grog]: Rename `tmac_ext` scalar.,
G. Branden Robinson <=