From e14c4c11b206a0357a2ddae810cac6b903c7f0ab Mon Sep 17 00:00:00 2001 From: schwarze Date: Fri, 8 Aug 2014 15:38:46 +0000 Subject: [PATCH] Remove the useless FATAL error "argument count wrong, violates syntax". The last remaining instance was .It in .Bl -column with more than one excessive .Ta. However, simply downgrading from FATAL to ERROR, it just works fine, almost the same way as in groff, without any other changes. --- usr.bin/mandoc/mandoc.h | 3 +-- usr.bin/mandoc/mdoc_validate.c | 18 ++++++------------ usr.bin/mandoc/read.c | 3 +-- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/usr.bin/mandoc/mandoc.h b/usr.bin/mandoc/mandoc.h index 3763a33cb0b..bf6cfb5022d 100644 --- a/usr.bin/mandoc/mandoc.h +++ b/usr.bin/mandoc/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.90 2014/08/08 15:26:28 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.91 2014/08/08 15:38:46 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -163,7 +163,6 @@ enum mandocerr { MANDOCERR_TOOLARGE, /* input too large */ MANDOCERR_COLUMNS, /* column syntax is inconsistent */ MANDOCERR_BADDISP, /* NOT IMPLEMENTED: .Bd -file */ - MANDOCERR_SYNTARGCOUNT, /* argument count wrong, violates syntax */ MANDOCERR_SO_PATH, /* NOT IMPLEMENTED: .so with absolute path or ".." */ MANDOCERR_SO_FAIL, /* .so request failed */ MANDOCERR_MEM, /* static buffer exhausted */ diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 19706ca03e5..21a6ebbd26f 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.153 2014/08/08 15:26:28 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.154 2014/08/08 15:38:46 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -1206,7 +1206,6 @@ post_it(POST_ARGS) int i, cols; enum mdoc_list lt; struct mdoc_node *nbl, *nit, *nch; - enum mandocerr er; nit = mdoc->last; if (MDOC_BLOCK != nit->type) @@ -1257,16 +1256,11 @@ post_it(POST_ARGS) if (MDOC_BODY == nch->type) i++; - if (i < cols) - er = MANDOCERR_ARGCOUNT; - else if (i == cols || i == cols + 1) - break; - else - er = MANDOCERR_SYNTARGCOUNT; - - mandoc_vmsg(er, mdoc->parse, nit->line, nit->pos, - "columns == %d (have %d)", cols, i); - return(MANDOCERR_ARGCOUNT == er); + if (i < cols || i > cols + 1) + mandoc_vmsg(MANDOCERR_ARGCOUNT, + mdoc->parse, nit->line, nit->pos, + "columns == %d (have %d)", cols, i); + break; default: abort(); } diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c index bba7c9f3c8c..bad2eec70a7 100644 --- a/usr.bin/mandoc/read.c +++ b/usr.bin/mandoc/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.51 2014/08/08 15:26:28 schwarze Exp $ */ +/* $Id: read.c,v 1.52 2014/08/08 15:38:46 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -199,7 +199,6 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "input too large", "column syntax is inconsistent", "NOT IMPLEMENTED: .Bd -file", - "argument count wrong, violates syntax", "NOT IMPLEMENTED: .so with absolute path or \"..\"", ".so request failed", "static buffer exhausted", -- 2.20.1