gbranden pushed a commit to branch master
in repository groff.
commit 4f18795280cb7c71365f9f708826fe2f1b3864a8
Author: G. Branden Robinson <[email protected]>
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\"
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit