From cdb13dfdb74f836f6d3b1fd54bc0b06dcc4d2ef5 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Mon, 17 May 2010 23:57:06 +0000 Subject: Increase performance by stashing the list type in struct mdoc_node. This will eventually be used so that mdoc_macro can known whether to dump list line arguments into the body (`Bl -column' overflowing). Remove a2list() and arg_listtype() because of this. --- mdoc_validate.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'mdoc_validate.c') diff --git a/mdoc_validate.c b/mdoc_validate.c index 474ed2ae..3976b282 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.79 2010/05/17 22:11:42 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.80 2010/05/17 23:57:06 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -568,27 +568,19 @@ pre_bl(PRE_ARGS) case (MDOC_Inset): /* FALLTHROUGH */ case (MDOC_Column): - /* - * Note that if a duplicate is detected, we - * remove the duplicate instead of passing it - * over. If we don't do this, mdoc_action will - * become confused when it scans over multiple - * types whilst setting its bitmasks. - * - * FIXME: this should occur in mdoc_action.c. - */ - if (type >= 0) { - if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_LISTREP)) - return(0); - mdoc_argn_free(n->args, pos); + if (type < 0) { + type = n->args->argv[pos].arg; break; } - type = n->args->argv[pos].arg; - break; + if (mdoc_nmsg(mdoc, n, MANDOCERR_LISTREP)) + break; + return(0); case (MDOC_Compact): - if (type < 0 && ! mdoc_nmsg(mdoc, n, MANDOCERR_LISTFIRST)) - return(0); - break; + if (type >= 0) + break; + if (mdoc_nmsg(mdoc, n, MANDOCERR_LISTFIRST)) + break; + return(0); case (MDOC_Width): if (width >= 0) if ( ! mdoc_nmsg(mdoc, n, MANDOCERR_ARGVREP)) -- cgit v1.2.3-56-ge451