diff options
author | 2013-10-21 23:32:32 +0000 | |
---|---|---|
committer | 2013-10-21 23:32:32 +0000 | |
commit | ec2beb5357bc38d7dada1fc8a9acf496db5abdf1 (patch) | |
tree | 89c79c3f3d30ca50fbadea7ff61ac85d026f944d /usr.bin/mandoc/mdoc_validate.c | |
parent | sync (diff) | |
download | wireguard-openbsd-ec2beb5357bc38d7dada1fc8a9acf496db5abdf1.tar.xz wireguard-openbsd-ec2beb5357bc38d7dada1fc8a9acf496db5abdf1.zip |
There are three kinds of input lines: text lines, macros taking
positional arguments (like Dt Fn Xr) and macros taking text as
arguments (like Nd Sh Em %T An). In the past, even the latter put
each word of their arguments into its own MDOC_TEXT node; instead,
concatenate arguments unless delimiters, keeps or spacing mode
prevent that. Regarding mandoc(1), this is internal refactoring,
no output change intended.
Once we will switch mandocdb(8) from DB to SQLite in the future,
this is going to be required to support search expressions crossing
word boundaries, and it will reduce both database sizes and build
times by a bit more than 5% each.
Diffstat (limited to 'usr.bin/mandoc/mdoc_validate.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 041a5ec57fb..2d85c62f0a5 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.114 2013/10/06 22:45:13 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.115 2013/10/21 23:32:33 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org> @@ -1670,10 +1670,16 @@ ebool(struct mdoc *mdoc) assert(MDOC_TEXT == mdoc->last->child->type); - if (0 == strcmp(mdoc->last->child->string, "on")) + if (0 == strcmp(mdoc->last->child->string, "on")) { + if (MDOC_Sm == mdoc->last->tok) + mdoc->flags &= ~MDOC_SMOFF; return(1); - if (0 == strcmp(mdoc->last->child->string, "off")) + } + if (0 == strcmp(mdoc->last->child->string, "off")) { + if (MDOC_Sm == mdoc->last->tok) + mdoc->flags |= MDOC_SMOFF; return(1); + } mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_BADBOOL); return(1); |