From 0e0f84f24a0e2abd3e01008fb6f411cdfaee205d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 29 Mar 2022 22:35:07 -0700 Subject: Fix misuses of formatting macros in man pages. --- cppawk-case.1 | 66 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'cppawk-case.1') diff --git a/cppawk-case.1 b/cppawk-case.1 index 9fd33f3..f3496b0 100644 --- a/cppawk-case.1 +++ b/cppawk-case.1 @@ -27,45 +27,45 @@ case \- macro for portable switch statement .SH DESCRIPTION The -.BI case +.B case macro provides syntax which -.B cppawk +.I cppawk translates very directly to the GNU Awk -.BI switch +.B switch statement, or else to alternative code which works with other Awk implementations. The purpose of the macro is easy conversion of -.BI switch +.B switch code; therefore, it has the same semantics with regard to fall through between cases, requiring an explicit break. The clauses of -.BI case +.B case are labeled with the identifiers -.BI of, -.BI matching, +.BR of , +.BR matching , or -.BI mixed +.BR mixed , which take arguments, and are followed by one or more statements. The last one of those statements must always be a -.BI cbreak, -.BI cfall +.BR cbreak , +.B cfall or -.BI cret +.B cret statement, described below. Regular expression keys must use the -.BI matching +.B matching label; ordinary keys compared for equality must use the -.BI of +.B of label. The -.BI mixed +.B mixed label allows for both keys to be included in one case. The -.BI of +.B of and -.BI matching +.B matching macros take variable arguments. Multiple matching keys or regular expressions are specified as multiple arguments, rather than by repetition of the construct: @@ -75,7 +75,7 @@ construct: of (3, 4) print "3 or 4"; cbreak // correct The -.BI mixed +.B mixed macro takes exactly two arguments, which are parenthesized lists of keys. The left list must be a list of ordinary value keys, and the second of regular expression literals: @@ -83,15 +83,15 @@ second of regular expression literals: mixed ((1, 2, "a"), (/xyz$/, /^\et/)) Each clause must specify how it terminates: whether it breaks out of the -.BI case +.B case statement, "falls through" to the next case, or returns from the surrounding function. The macros -.BI cbreak, -.BI cfall +.BR cbreak , +.B cfall and -.BI cret +.B cret must be used for this purpose. The -.BI cret +.B cret macro takes exactly one argument, the expression whose value is to be returned from the surrounding function: @@ -112,22 +112,22 @@ returned from the surrounding function: } When -.BI case +.B case is transformed into portable code rather than -.BI switch, +.BR switch , that code depends on hidden state variables. If -.BI case +.B case is used in a top-level -.BI BEGIN, -.BI END +.BR BEGIN , +.B END or Awk action, those variables will be global. They will also be global if -.BI case +.B case is used in a function, unless defined as local variables in the parameter list. Defining the temporary variables as local is done using the provided -.BI case_temps +.B case_temps macro: #include @@ -144,13 +144,13 @@ macro: } } -.BI case_temps +.B case_temps does not have to be in the last argument position. It is guaranteed to expand to one or more identifiers separated by commas, with no leading or trailing comma. When the target is GNU Awk, -.BI case_temps +.B case_temps expands to an unspecified identifier in the -.BI __[a-z] +.B __[a-z] reserved namespace. .SH "SEE ALSO" @@ -159,7 +159,7 @@ cppawk(1) .SH BUGS The -.BI cond +.B cond macro does not currently safely nest with itself. Forgetting to declare the temporary variables is a programmer pitfall. -- cgit v1.2.3