diff options
author | 2014-07-02 13:10:15 +0000 | |
---|---|---|
committer | 2014-07-02 13:10:15 +0000 | |
commit | dd25b57cd0c71df251dea8c8ae7a850931559dae (patch) | |
tree | 02f74f05af663a438a77c48c6743ae09b33648e2 | |
parent | better indentation; no functional change (diff) | |
download | wireguard-openbsd-dd25b57cd0c71df251dea8c8ae7a850931559dae.tar.xz wireguard-openbsd-dd25b57cd0c71df251dea8c8ae7a850931559dae.zip |
Disentangle the MANDOCERR_CHILD message, which reported three
completely different things, into three distinct messages.
Also mention the macro names we are talking about.
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Bl/Makefile | 4 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Bl/noIt.out_lint | 5 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Vt/Makefile | 5 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Vt/child.in | 15 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Vt/child.out_ascii | 12 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Vt/child.out_lint | 2 | ||||
-rw-r--r-- | usr.bin/mandoc/mandoc.h | 6 | ||||
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 12 | ||||
-rw-r--r-- | usr.bin/mandoc/read.c | 6 |
9 files changed, 55 insertions, 12 deletions
diff --git a/regress/usr.bin/mandoc/mdoc/Bl/Makefile b/regress/usr.bin/mandoc/mdoc/Bl/Makefile index 4c15cba12f7..68971c97342 100644 --- a/regress/usr.bin/mandoc/mdoc/Bl/Makefile +++ b/regress/usr.bin/mandoc/mdoc/Bl/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.18 2014/07/02 11:42:56 schwarze Exp $ +# $OpenBSD: Makefile,v 1.19 2014/07/02 13:10:15 schwarze Exp $ REGRESS_TARGETS = item inset diag ohang bullet dash enum hang tag REGRESS_TARGETS += column extend nested REGRESS_TARGETS += multitype multitag empty noIt bareTa unclosed break broken -LINT_TARGETS = break broken +LINT_TARGETS = noIt break broken # groff-1.20.1 defects: # - empty lists ruin indentation and sometimes cause empty lines diff --git a/regress/usr.bin/mandoc/mdoc/Bl/noIt.out_lint b/regress/usr.bin/mandoc/mdoc/Bl/noIt.out_lint new file mode 100644 index 00000000000..00f22c91dd1 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Bl/noIt.out_lint @@ -0,0 +1,5 @@ +mandoc: noIt.in:9:1: WARNING: moving content out of list: text +mandoc: noIt.in:10:2: WARNING: moving content out of list: Em +mandoc: noIt.in:15:1: WARNING: moving content out of list: text +mandoc: noIt.in:16:2: WARNING: moving content out of list: Em +mandoc: noIt.in:21:1: WARNING: moving content out of list: text diff --git a/regress/usr.bin/mandoc/mdoc/Vt/Makefile b/regress/usr.bin/mandoc/mdoc/Vt/Makefile index 5e89cf0641c..4522c22c21f 100644 --- a/regress/usr.bin/mandoc/mdoc/Vt/Makefile +++ b/regress/usr.bin/mandoc/mdoc/Vt/Makefile @@ -1,5 +1,6 @@ -# $OpenBSD: Makefile,v 1.4 2012/07/09 17:52:09 schwarze Exp $ +# $OpenBSD: Makefile,v 1.5 2014/07/02 13:10:15 schwarze Exp $ -REGRESS_TARGETS = noarg spacing font +REGRESS_TARGETS = noarg spacing font child +LINT_TARGETS = child .include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/mdoc/Vt/child.in b/regress/usr.bin/mandoc/mdoc/Vt/child.in new file mode 100644 index 00000000000..a35aa674467 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Vt/child.in @@ -0,0 +1,15 @@ +.Dd July 2, 2014 +.Dt VT-CHILD 1 +.Os OpenBSD +.Sh NAME +.Nm Vt-child +.Nd the variable type macro does not want children +.Sh SYNOPSIS +.Vt extern Sy int Li errno +.Sh DESCRIPTION +various types, for example +.Vt unsigned Sy int , +.Vt long Li int +and +.Vt float , +.Vt double diff --git a/regress/usr.bin/mandoc/mdoc/Vt/child.out_ascii b/regress/usr.bin/mandoc/mdoc/Vt/child.out_ascii new file mode 100644 index 00000000000..c256f2db588 --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Vt/child.out_ascii @@ -0,0 +1,12 @@ +VT-CHILD(1) OpenBSD Reference Manual VT-CHILD(1) + +NNAAMMEE + VVtt--cchhiilldd - the variable type macro does not want children + +SSYYNNOOPPSSIISS + _e_x_t_e_r_n iinntt errno + +DDEESSCCRRIIPPTTIIOONN + various types, for example _u_n_s_i_g_n_e_d iinntt, _l_o_n_g int and _f_l_o_a_t, _d_o_u_b_l_e + +OpenBSD July 2, 2014 OpenBSD diff --git a/regress/usr.bin/mandoc/mdoc/Vt/child.out_lint b/regress/usr.bin/mandoc/mdoc/Vt/child.out_lint new file mode 100644 index 00000000000..b4e2ed93dbe --- /dev/null +++ b/regress/usr.bin/mandoc/mdoc/Vt/child.out_lint @@ -0,0 +1,2 @@ +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.h b/usr.bin/mandoc/mandoc.h index 48a95f5ef75..4a043412878 100644 --- a/usr.bin/mandoc/mandoc.h +++ b/usr.bin/mandoc/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.72 2014/07/02 11:42:56 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.73 2014/07/02 13:10:15 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -76,8 +76,9 @@ enum mandocerr { MANDOCERR_PAR_MOVE, /* moving paragraph macro out of list: macro */ MANDOCERR_NS_SKIP, /* skipping no-space macro */ MANDOCERR_BLOCK_NEST, /* blocks badly nested: macro ... */ - MANDOCERR_CHILD, /* child violates parent syntax */ 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_LINESCOPE, /* line scope broken: macro breaks macro */ @@ -136,6 +137,7 @@ enum mandocerr { MANDOCERR_MACRO, /* skipping unknown macro */ MANDOCERR_REQUEST, /* NOT IMPLEMENTED: skipping request */ MANDOCERR_ARGCOUNT, /* argument count wrong */ + MANDOCERR_RS_SKIP, /* skipping invalid content in .Rs block: macro */ MANDOCERR_STRAYTA, /* skipping column outside column list */ MANDOCERR_NOSCOPE, /* skipping end of block that is not open */ MANDOCERR_SCOPEBROKEN, /* missing end of block */ diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 83c45f34cd1..9ff94ee2628 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.138 2014/07/02 11:42:56 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.139 2014/07/02 13:10:15 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -1113,7 +1113,8 @@ post_vt(POST_ARGS) for (n = mdoc->last->child; n; n = n->next) if (MDOC_TEXT != n->type) - mdoc_nmsg(mdoc, n, MANDOCERR_CHILD); + mandoc_msg(MANDOCERR_VT_CHILD, mdoc->parse, + n->line, n->pos, mdoc_macronames[n->tok]); return(1); } @@ -1609,7 +1610,9 @@ post_bl(POST_ARGS) continue; } - mdoc_nmsg(mdoc, nchild, MANDOCERR_CHILD); + mandoc_msg(MANDOCERR_BL_MOVE, mdoc->parse, + nchild->line, nchild->pos, + mdoc_macronames[nchild->tok]); /* * Move the node out of the Bl block. @@ -1778,7 +1781,8 @@ post_rs(POST_ARGS) } next = nn->next; - mdoc_nmsg(mdoc, nn, MANDOCERR_CHILD); + mandoc_msg(MANDOCERR_RS_SKIP, mdoc->parse, + nn->line, nn->pos, mdoc_macronames[nn->tok]); mdoc_node_delete(mdoc, nn); } diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c index dc836512468..09fd7143e64 100644 --- a/usr.bin/mandoc/read.c +++ b/usr.bin/mandoc/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.34 2014/07/02 11:42:56 schwarze Exp $ */ +/* $Id: read.c,v 1.35 2014/07/02 13:10:15 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -112,8 +112,9 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "moving paragraph macro out of list", "skipping no-space macro", "blocks badly nested", - "child violates parent syntax", "nested displays are not portable", + "moving content out of list", + ".Vt block has child macro", "fill mode already enabled, skipping .fi", "fill mode already disabled, skipping .nf", "line scope broken", @@ -172,6 +173,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "skipping unknown macro", "NOT IMPLEMENTED, please use groff: skipping request", "argument count wrong", + "skipping invalid content in .Rs block", "skipping column outside column list", "skipping end of block that is not open", "missing end of block", |