aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff.7
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-10 21:42:02 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-10 21:42:02 +0000
commit151317239c987cf45872d3ee4ec105feb30ddcc9 (patch)
treea174ca825d0104808fab8d5aaaf3c01fc2bf45f1 /roff.7
parentf9e4d0ae086987ed162fde69bc3ae4c3048ff293 (diff)
downloadmandoc-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.719
1 files changed, 15 insertions, 4 deletions
diff --git a/roff.7 b/roff.7
index aee1aad5..12ccfc35 100644
--- a/roff.7
+++ b/roff.7
@@ -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{ ,