groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 07/12: tmac/an.tmac (TH): Tweak code style.


From: G. Branden Robinson
Subject: [groff] 07/12: tmac/an.tmac (TH): Tweak code style.
Date: Wed, 3 Aug 2022 20:40:42 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 4f18795280cb7c71365f9f708826fe2f1b3864a8
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Aug 3 15:49:37 2022 -0500

    tmac/an.tmac (TH): Tweak code style.
    
    This is to clarify and more clearily illustrate its simulation of a
    switch/case control structure from other programming languages; there
    are plans to adapt this for an example in our Texinfo manual.
---
 tmac/an.tmac | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/tmac/an.tmac b/tmac/an.tmac
index 99084db76..cf28fc3ce 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -271,18 +271,21 @@
 .  ds an-title "\\$1\"
 .  if \\n[CT] .stringup an-title
 .  ds an-section "\\$2\"
-.  ie (\\n[.$] > 4)    .ds an-extra3 "\\$5\"
-.  el \{ .ie '\\$2'1'  .ds an-extra3 \\*[an*section1]\"
-.  el \{ .ie '\\$2'2'  .ds an-extra3 \\*[an*section2]\"
-.  el \{ .ie '\\$2'3'  .ds an-extra3 \\*[an*section3]\"
-.  el \{ .ie '\\$2'4'  .ds an-extra3 \\*[an*section4]\"
-.  el \{ .ie '\\$2'5'  .ds an-extra3 \\*[an*section5]\"
-.  el \{ .ie '\\$2'6'  .ds an-extra3 \\*[an*section6]\"
-.  el \{ .ie '\\$2'7'  .ds an-extra3 \\*[an*section7]\"
-.  el \{ .ie '\\$2'8'  .ds an-extra3 \\*[an*section8]\"
-.  el \{ .ie '\\$2'9'  .ds an-extra3 \\*[an*section9]\"
-.  el                  .ds an-extra3 \" empty
-.  \}\}\}\}\}\}\}\}\}
+.  ie (\\n[.$] > 4) .ds an-extra3 "\\$5\"
+.  el \{\
+.    \" Simulate switch/case in roff.
+.          ie '\\$2'1' .ds an-extra3 \\*[an*section1]\"
+.    el \{.ie '\\$2'2' .ds an-extra3 \\*[an*section2]\"
+.    el \{.ie '\\$2'3' .ds an-extra3 \\*[an*section3]\"
+.    el \{.ie '\\$2'4' .ds an-extra3 \\*[an*section4]\"
+.    el \{.ie '\\$2'5' .ds an-extra3 \\*[an*section5]\"
+.    el \{.ie '\\$2'6' .ds an-extra3 \\*[an*section6]\"
+.    el \{.ie '\\$2'7' .ds an-extra3 \\*[an*section7]\"
+.    el \{.ie '\\$2'8' .ds an-extra3 \\*[an*section8]\"
+.    el \{.ie '\\$2'9' .ds an-extra3 \\*[an*section9]\"
+.    el                .ds an-extra3 \" empty
+.    \}\}\}\}\}\}\}\}
+.  \}
 .
 .  ds an-extra1 "\\$3\"
 .  ie (\\n[.$] > 3)    .ds an-extra2 "\\$4\"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]