diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-09-14 15:35:48 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-09-14 15:35:48 +0000 |
commit | 68618fc7b7935c078b7950b05298984b61acb1b3 (patch) | |
tree | 14107d60ea12e99af242dd18b60803c856aa3092 | |
parent | 6ec4b7c12056eccf19484fcc6fb0fc85bd3bd4f1 (diff) |
Remove the warning about children of .Vt blocks because actually,
.Vt type global_variable No = Dv defined_constant ;
is the best way to specify in the SYNOPSIS how a global variable
is initialized in the rare case where that matters.
Issue noticed by jmc@.
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Vt/Makefile | 4 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Vt/child.out_lint | 2 | ||||
-rw-r--r-- | usr.bin/mandoc/mandoc.1 | 11 | ||||
-rw-r--r-- | usr.bin/mandoc/mandoc.h | 3 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 27 | ||||
-rw-r--r-- | usr.bin/mandoc/read.c | 3 |
6 files changed, 8 insertions, 42 deletions
diff --git a/regress/usr.bin/mandoc/mdoc/Vt/Makefile b/regress/usr.bin/mandoc/mdoc/Vt/Makefile index 173e4101d08..d1f0a9bd1c9 100644 --- a/regress/usr.bin/mandoc/mdoc/Vt/Makefile +++ b/regress/usr.bin/mandoc/mdoc/Vt/Makefile @@ -1,6 +1,6 @@ -# $OpenBSD: Makefile,v 1.6 2014/07/02 20:18:42 schwarze Exp $ +# $OpenBSD: Makefile,v 1.7 2015/09/14 15:35:47 schwarze Exp $ REGRESS_TARGETS = noarg spacing font child -LINT_TARGETS = noarg child +LINT_TARGETS = noarg .include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/mdoc/Vt/child.out_lint b/regress/usr.bin/mandoc/mdoc/Vt/child.out_lint deleted file mode 100644 index b4e2ed93dbe..00000000000 --- a/regress/usr.bin/mandoc/mdoc/Vt/child.out_lint +++ /dev/null @@ -1,2 +0,0 @@ -mandoc: child.in:8:12: WARNING: .Vt block has child macro: Sy -mandoc: child.in:8:19: WARNING: .Vt block has child macro: Li diff --git a/usr.bin/mandoc/mandoc.1 b/usr.bin/mandoc/mandoc.1 index a3715d3b1f8..3ffc0553e08 100644 --- a/usr.bin/mandoc/mandoc.1 +++ b/usr.bin/mandoc/mandoc.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: mandoc.1,v 1.83 2015/04/03 08:45:27 schwarze Exp $ +.\" $OpenBSD: mandoc.1,v 1.84 2015/09/14 15:35:47 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> @@ -15,7 +15,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: April 3 2015 $ +.Dd $Mdocdate: September 14 2015 $ .Dt MANDOC 1 .Os .Sh NAME @@ -934,13 +934,6 @@ list block contains text or macros before the first .Ic \&It macro. The offending children are moved before the beginning of the list. -.It Sy ".Vt block has child macro" -.Pq mdoc -The -.Ic \&Vt -macro supports plain text arguments only. -Formatting may be ugly and semantic searching -for the affected content might not work. .It Sy "fill mode already enabled, skipping" .Pq man A diff --git a/usr.bin/mandoc/mandoc.h b/usr.bin/mandoc/mandoc.h index 9dc09ed0ad8..fc01785b99e 100644 --- a/usr.bin/mandoc/mandoc.h +++ b/usr.bin/mandoc/mandoc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mandoc.h,v 1.146 2015/07/19 05:59:07 schwarze Exp $ */ +/* $OpenBSD: mandoc.h,v 1.147 2015/09/14 15:35:47 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -86,7 +86,6 @@ enum mandocerr { MANDOCERR_BLK_NEST, /* blocks badly nested: macro ... */ MANDOCERR_BD_NEST, /* nested displays are not portable: macro ... */ MANDOCERR_BL_MOVE, /* moving content out of list: macro */ - MANDOCERR_VT_CHILD, /* .Vt block has child macro: macro */ MANDOCERR_FI_SKIP, /* fill mode already enabled, skipping: fi */ MANDOCERR_NF_SKIP, /* fill mode already disabled, skipping: nf */ MANDOCERR_BLK_LINE, /* line scope broken: macro breaks macro */ diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 0c664f672ea..543b5d7ef98 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_validate.c,v 1.207 2015/04/23 16:17:04 schwarze Exp $ */ +/* $OpenBSD: mdoc_validate.c,v 1.208 2015/09/14 15:35:47 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -105,7 +105,6 @@ static void post_sh_see_also(POST_ARGS); static void post_sh_authors(POST_ARGS); static void post_sm(POST_ARGS); static void post_st(POST_ARGS); -static void post_vt(POST_ARGS); static void pre_an(PRE_ARGS); static void pre_bd(PRE_ARGS); @@ -159,7 +158,7 @@ static const struct valids mdoc_valids[MDOC_MAX] = { { pre_std, NULL }, /* Rv */ { NULL, post_st }, /* St */ { NULL, NULL }, /* Va */ - { NULL, post_vt }, /* Vt */ + { NULL, NULL }, /* Vt */ { NULL, NULL }, /* Xr */ { NULL, NULL }, /* %A */ { NULL, post_hyph }, /* %B */ /* FIXME: can be used outside Rs/Re. */ @@ -924,28 +923,6 @@ post_fa(POST_ARGS) } static void -post_vt(POST_ARGS) -{ - const struct roff_node *n; - - /* - * The Vt macro comes in both ELEM and BLOCK form, both of which - * have different syntaxes (yet more context-sensitive - * behaviour). ELEM types must have a child, which is already - * guaranteed by the in_line parsing routine; BLOCK types, - * specifically the BODY, should only have TEXT children. - */ - - if (mdoc->last->type != ROFFT_BODY) - return; - - for (n = mdoc->last->child; n; n = n->next) - if (n->type != ROFFT_TEXT) - mandoc_msg(MANDOCERR_VT_CHILD, mdoc->parse, - n->line, n->pos, mdoc_macronames[n->tok]); -} - -static void post_nm(POST_ARGS) { struct roff_node *n; diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c index e05a2b70c2b..d060f9a8b51 100644 --- a/usr.bin/mandoc/read.c +++ b/usr.bin/mandoc/read.c @@ -1,4 +1,4 @@ -/* $OpenBSD: read.c,v 1.115 2015/07/19 05:59:07 schwarze Exp $ */ +/* $OpenBSD: read.c,v 1.116 2015/09/14 15:35:47 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org> @@ -124,7 +124,6 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "blocks badly nested", "nested displays are not portable", "moving content out of list", - ".Vt block has child macro", "fill mode already enabled, skipping", "fill mode already disabled, skipping", "line scope broken", |