diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-10 21:42:02 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-06-10 21:42:02 +0000 |
commit | 151317239c987cf45872d3ee4ec105feb30ddcc9 (patch) | |
tree | a174ca825d0104808fab8d5aaaf3c01fc2bf45f1 /roff.7 | |
parent | f9e4d0ae086987ed162fde69bc3ae4c3048ff293 (diff) | |
download | mandoc-151317239c987cf45872d3ee4ec105feb30ddcc9.tar.gz mandoc-151317239c987cf45872d3ee4ec105feb30ddcc9.tar.zst mandoc-151317239c987cf45872d3ee4ec105feb30ddcc9.zip |
Fix adding some minimal intelligence to conditional parser. See roff.7
for what's supported. This simplified the roff_cond() function quite
nicely. From a bug report by uqs@.
Added regression test based on bug-report example by uqs@.
Also added ROFF_DEBUG to see what the hell the parser is actually doing.
Obviously turned off by default.
Diffstat (limited to 'roff.7')
-rw-r--r-- | roff.7 | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -1,4 +1,4 @@ -.\" $Id: roff.7,v 1.8 2010/06/01 11:54:23 kristaps Exp $ +.\" $Id: roff.7,v 1.9 2010/06/10 21:42:02 kristaps Exp $ .\" .\" Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 1 2010 $ +.Dd $Mdocdate: June 10 2010 $ .Dt ROFF 7 .Os .Sh NAME @@ -173,8 +173,19 @@ BODY... BODY .Ed .Pp -COND is a conditional (for the time being, this always evaluates to -false). +COND is a conditional statement. +roff allows for complicated conditionals; mandoc is much simpler. +At this time, mandoc supports only +.Sq n , +evaluating to true; +and +.Sq t , +.Sq e , +and +.Sq o , +evaluating to false. +All other invocations are read up to the next end of line or space and +evaluate as false. .Pp If the BODY section is begun by an escaped brace .Sq \e{ , |