[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 37/74: tmac/s.tmac (@EQ): Trivially refactor.
From: |
G. Branden Robinson |
Subject: |
[groff] 37/74: tmac/s.tmac (@EQ): Trivially refactor. |
Date: |
Fri, 28 Apr 2023 15:10:46 -0400 (EDT) |
gbranden pushed a commit to branch branden-2023-04-28
in repository groff.
commit 567d7b81b5423a21d1c1b4e647f4d1abf0352637
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Apr 7 20:31:50 2023 -0500
tmac/s.tmac (@EQ): Trivially refactor.
* tmac/s.tmac (@EQ): Trivially refactor. Shift valid pseudo-enumeration
type values from 0..2 to 1..3 so that they more idiomatically test for
truth values in roff (where zero and negative values are false).
Simplify a conditional accordingly.
---
ChangeLog | 7 +++++++
tmac/s.tmac | 26 +++++++++++++-------------
2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ab8f67461..d6bd6635d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-04-07 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * tmac/s.tmac (@EQ): Trivially refactor. Shift valid
+ pseudo-enumeration type values from 0..2 to 1..3 so that they
+ more idiomatically test for truth values in roff (where zero and
+ negative values are false). Simplify a conditional accordingly.
+
2023-04-07 G. Branden Robinson <g.branden.robinson@gmail.com>
[ms]: Fix Savannah #64013.
diff --git a/tmac/s.tmac b/tmac/s.tmac
index dad2d6371..5abccc567 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -1885,12 +1885,12 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.if \\n[tbl@within-table] \
. @error .EQ is not allowed within a .TS/.TE table
.br
-.nr eqn*type -1
+.nr eqn*type 0
.ds eqn*num "\\$2
-.if '\\$1'L' .nr eqn*type 0
-.if '\\$1'I' .nr eqn*type 1
-.if '\\$1'C' .nr eqn*type 2
-.if (\\n[eqn*type] < 0) \{\
+.if '\\$1'L' .nr eqn*type 1
+.if '\\$1'I' .nr eqn*type 2
+.if '\\$1'C' .nr eqn*type 3
+.if !\\n[eqn*type] \{\
. ds eqn*msg .EQ: unrecognized alignment '\\$1';
. ie (\\n[.$] = 1) \{\
. if !'\\$1'' \{\
@@ -1913,12 +1913,12 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
. nr eqn*ll \\n[.l]
. ll 1000n
.\}
-.if \\n[eqn*type]=0 .EQN-HTML-IMAGE-LEFT
-.if \\n[eqn*type]=1 \{\
+.if \\n[eqn*type]=1 .EQN-HTML-IMAGE-LEFT
+.if \\n[eqn*type]=2 \{\
. if '\*(.T'html' .RS
.EQN-HTML-IMAGE-INLINE
.\}
-.if \\n[eqn*type]=2 .EQN-HTML-IMAGE
+.if \\n[eqn*type]=3 .EQN-HTML-IMAGE
.nf
..
.de @div-end!eqn*div
@@ -1945,12 +1945,12 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
. ie r ps4html .ds@need \\n[dn]u-1v+\n[.V]u+1i
. el .ds@need \\n[dn]u-1v+\n[.V]u
. chop eqn*div
-. ie \\n[eqn*type]=0 \{\
+. ie \\n[eqn*type]=1 \{\
. ta (u;\\n[.l]-\\n[.i])R
\\*[eqn*div]\t\\*[eqn*num]
. \}
. el \{\
-. ie \\n[eqn*type]=1 .ta \\n[DI]u \
+. ie \\n[eqn*type]=2 .ta \\n[DI]u \
(u;\\n[.l]-\\n[.i])R
. el .ta (u;\\n[.l]-\\n[.i]/2)C \
(u;\\n[.l]-\\n[.i])R
@@ -1974,12 +1974,12 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
. if r ps4html \\*[eqn*div]
. \}
. if !'\*(.T'html' .fi
-. if \\n[eqn*type]=0 .EQN-HTML-IMAGE-END
-. if \\n[eqn*type]=1 \{\
+. if \\n[eqn*type]=1 .EQN-HTML-IMAGE-END
+. if \\n[eqn*type]=2 \{\
. EQN-HTML-IMAGE-END
. if '\*(.T'html' .RE
. \}
-. if \\n[eqn*type]=2 .EQN-HTML-IMAGE-END
+. if \\n[eqn*type]=3 .EQN-HTML-IMAGE-END
. if '\*(.T'html' \
. ll \\n[eqn*ll]u
.\}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 37/74: tmac/s.tmac (@EQ): Trivially refactor.,
G. Branden Robinson <=