diff options
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | mandoc.h | 5 | ||||
-rw-r--r-- | mdoc.7 | 9 | ||||
-rw-r--r-- | mdoc_html.c | 6 | ||||
-rw-r--r-- | mdoc_term.c | 6 | ||||
-rw-r--r-- | mdoc_validate.c | 18 |
6 files changed, 28 insertions, 20 deletions
@@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.115 2010/12/02 20:41:46 schwarze Exp $ */ +/* $Id: main.c,v 1.116 2010/12/05 15:37:30 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -146,6 +146,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "NAME section must come first", "bad Boolean value", "child violates parent syntax", + "displays may not be nested", "bad AT&T symbol", "bad standard", "list type repeated", @@ -183,7 +184,6 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "generic fatal error", "column syntax is inconsistent", - "displays may not be nested", "unsupported display type", "blocks badly nested", "no such block is open", @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.26 2010/12/01 16:54:25 kristaps Exp $ */ +/* $Id: mandoc.h,v 1.27 2010/12/05 15:37:30 kristaps Exp $ */ /* * Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -69,6 +69,7 @@ enum mandocerr { MANDOCERR_NAMESECFIRST, /* NAME section must come first */ MANDOCERR_BADBOOL, /* bad Boolean value */ MANDOCERR_CHILD, /* child violates parent syntax */ + MANDOCERR_NESTEDDISP, /* displays may not be nested */ MANDOCERR_BADATT, /* bad AT&T symbol */ MANDOCERR_BADSTANDARD, /* bad standard */ MANDOCERR_LISTREP, /* list type repeated */ @@ -106,8 +107,6 @@ enum mandocerr { MANDOCERR_FATAL, /* ===== start of fatal errors ===== */ MANDOCERR_COLUMNS, /* column syntax is inconsistent */ - /* FIXME: this should be a MANDOCERR_ERROR */ - MANDOCERR_NESTEDDISP, /* displays may not be nested */ MANDOCERR_BADDISP, /* unsupported display type */ MANDOCERR_SCOPEFATAL, /* blocks badly nested */ MANDOCERR_SYNTNOSCOPE, /* no scope to rewind: syntax violated */ @@ -1,4 +1,4 @@ -.\" $Id: mdoc.7,v 1.167 2010/11/30 21:44:59 schwarze Exp $ +.\" $Id: mdoc.7,v 1.168 2010/12/05 15:37:30 kristaps Exp $ .\" .\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2010 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: November 30 2010 $ +.Dd $Mdocdate: December 5 2010 $ .Dt MDOC 7 .Os .Sh NAME @@ -2739,6 +2739,11 @@ The following problematic behaviour is found in groff: .Pp .Bl -dash -compact .It +Display macros +.Pq Sx \&Bd , Sx \&Dl , and Sx \&D1 +may not be nested. +\*[hist] +.It .Sx \&At with unknown arguments produces no output at all. \*[hist] diff --git a/mdoc_html.c b/mdoc_html.c index bdf00386..83503873 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.113 2010/11/29 13:02:47 kristaps Exp $ */ +/* $Id: mdoc_html.c,v 1.114 2010/12/05 15:37:30 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -1331,6 +1331,10 @@ mdoc_bd_pre(MDOC_ARGS) /* FALLTHROUGH */ case (MDOC_Bl): /* FALLTHROUGH */ + case (MDOC_D1): + /* FALLTHROUGH */ + case (MDOC_Dl): + /* FALLTHROUGH */ case (MDOC_Lp): /* FALLTHROUGH */ case (MDOC_Pp): diff --git a/mdoc_term.c b/mdoc_term.c index 15568dd2..bdc16100 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.195 2010/11/29 13:02:47 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.196 2010/12/05 15:37:30 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -1592,6 +1592,10 @@ termp_bd_pre(DECL_ARGS) /* FALLTHROUGH */ case (MDOC_Bl): /* FALLTHROUGH */ + case (MDOC_D1): + /* FALLTHROUGH */ + case (MDOC_Dl): + /* FALLTHROUGH */ case (MDOC_Lp): /* FALLTHROUGH */ case (MDOC_Pp): diff --git a/mdoc_validate.c b/mdoc_validate.c index c5dd3934..2b10fd06 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.134 2010/12/01 13:05:13 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.135 2010/12/05 15:37:30 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -42,7 +42,7 @@ #define POST_ARGS struct mdoc *mdoc #define NUMSIZ 32 -#define DATESIZ 32 +#define DATESIZE 32 enum check_ineq { CHECK_LT, @@ -575,22 +575,18 @@ pre_display(PRE_ARGS) { struct mdoc_node *node; - /* Display elements (`Bd', `D1'...) cannot be nested. */ - if (MDOC_BLOCK != n->type) return(1); - /* LINTED */ for (node = mdoc->last->parent; node; node = node->parent) if (MDOC_BLOCK == node->type) if (MDOC_Bd == node->tok) break; - if (NULL == node) - return(1); + if (node) + mdoc_nmsg(mdoc, n, MANDOCERR_NESTEDDISP); - mdoc_nmsg(mdoc, n, MANDOCERR_NESTEDDISP); - return(0); + return(1); } @@ -1951,7 +1947,7 @@ pre_literal(PRE_ARGS) static int post_dd(POST_ARGS) { - char buf[DATESIZ]; + char buf[DATESIZE]; struct mdoc_node *n; n = mdoc->last; @@ -1961,7 +1957,7 @@ post_dd(POST_ARGS) return(1); } - if ( ! concat(mdoc, buf, n->child, DATESIZ)) + if ( ! concat(mdoc, buf, n->child, DATESIZE)) return(0); mdoc->meta.date = mandoc_a2time |