diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2012-05-31 01:36:57 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2012-05-31 01:36:57 +0000 |
commit | 888e94cd1aad71d5bfdb1e1e714dc67af87dd586 (patch) | |
tree | ba1e400887bea93678dc605019e42022819b5633 /regress | |
parent | 71aa403b0ea414cfc5c43d9e103a0c163971ef75 (diff) |
Fix blank line handling in .if.
In particular, two cases were wrong:
- single-line .if with trailing whitespace gave no blank line
- multiline .if with \{ but without \{\ gave no blank line
While here, simplify roff_cond() by partially reordering the code.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.bin/mandoc/roff/cond/if.in | 18 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/roff/cond/if.out_ascii | 9 |
2 files changed, 25 insertions, 2 deletions
diff --git a/regress/usr.bin/mandoc/roff/cond/if.in b/regress/usr.bin/mandoc/roff/cond/if.in index 9365444b686..a9a5779d9b1 100644 --- a/regress/usr.bin/mandoc/roff/cond/if.in +++ b/regress/usr.bin/mandoc/roff/cond/if.in @@ -1,9 +1,20 @@ -.TH IF 1 "April 25, 2010" OpenBSD +.TH IF 1 "May 30, 2012" OpenBSD .SH NAME if \- the roff conditional instruction .SH DESCRIPTION .if n One-line true condition. .if t One-line false condition. +.if n +Next-line empty true condition. +.if t +Next-line empty false condition. +.br +False condition with whitespace: +.if t +True condition with whitespace: +.if n +.if n \{One-line true condition with block.\} +.if t \{One-line false condition with block.\} .br .if n \{Two-line true condition without continuation and macros.\} @@ -19,6 +30,11 @@ Two-line false condition with continuation and macros. .\} .br +.if n \{ +Two-line true condition with blank line.\} +.if t \{ +Two-line false condition with blank line.\} +.br .if n \{Outer true condition. .br .if n Inner one-line true condition. diff --git a/regress/usr.bin/mandoc/roff/cond/if.out_ascii b/regress/usr.bin/mandoc/roff/cond/if.out_ascii index dcf68bda630..3e6b5e98257 100644 --- a/regress/usr.bin/mandoc/roff/cond/if.out_ascii +++ b/regress/usr.bin/mandoc/roff/cond/if.out_ascii @@ -7,8 +7,15 @@ NNAAMMEE DDEESSCCRRIIPPTTIIOONN One-line true condition. + + Next-line empty true condition. + False condition with whitespace: True condition with whitespace: + + One-line true condition with block. Two-line true condition without continuation and macros. Two-line true condition with continuation and macros. + + Two-line true condition with blank line. Outer true condition. Inner one-line true condition. Inner two-line true condition without continuation and macros. @@ -16,4 +23,4 @@ DDEESSCCRRIIPPTTIIOONN -OpenBSD April 25, 2010 IF(1) +OpenBSD May 30, 2012 IF(1) |