summaryrefslogtreecommitdiffstats
path: root/roff.7
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-04-08 01:37:27 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-04-08 01:37:27 +0000
commit4ceb7196c5a7cbee79cd5e93dee6f864e9b35949 (patch)
tree20e2e9476c702dc1e34a0dfbd26fd7e5896b3d2e /roff.7
parent710a62e5240ad4a0f3ebc05b57319d98b097afc7 (diff)
downloadmandoc-4ceb7196c5a7cbee79cd5e93dee6f864e9b35949.tar.gz
Fully implement the \B (validate numerical expression) and
partially implement the \w (measure text width) escape sequence in a way that makes them usable in numerical expressions and in conditional requests, similar to how \n (interpolate number register) and \* (expand user-defined string) are implemented. This lets mandoc(1) handle the baroque low-level roff code found at the beginning of the ggrep(1) manual. Thanks to pascal@ for the report.
Diffstat (limited to 'roff.7')
-rw-r--r--roff.721
1 files changed, 15 insertions, 6 deletions
diff --git a/roff.7 b/roff.7
index 6c5b6cb1..c6bb631e 100644
--- a/roff.7
+++ b/roff.7
@@ -1172,10 +1172,15 @@ Digit width space character.
Anchor definition; ignored by
.Xr mandoc 1 .
.Ss \eB\(aq Ns Ar string Ns \(aq
-Test whether
+Interpolate
+.Sq 1
+if
.Ar string
-is a numerical expession; ignored by
-.Xr mandoc 1 .
+conforms to the syntax of
+.Sx Numerical expressions
+explained above and
+.Sq 0
+otherwise.
.Ss \eb\(aq Ns Ar string Ns \(aq
Bracket building function; ignored by
.Xr mandoc 1 .
@@ -1299,9 +1304,13 @@ Vertical motion; ignored by
.Xr mandoc 1 .
.Ss \ew\(aq Ns Ar string Ns \(aq
Interpolate the width of the
-.Ar string ;
-ignored by
-.Xr mandoc 1 .
+.Ar string .
+The
+.Xr mandoc 1
+implementation assumes that after expansion of user-defined strings, the
+.Ar string
+only contains normal characters, no escape sequences, and that each
+character has a width of 24 basic units.
.Ss \eX\(aq Ns Ar string Ns \(aq
Output
.Ar string