From: Ingo Schwarze Date: Thu, 3 Jul 2014 21:23:54 +0000 (+0000) Subject: MANDOCERR_NOARGS reported three completely unrelated classes of problems. X-Git-Tag: VERSION_1_13_1~118 X-Git-Url: https://git.cameronkatri.com/mandoc.git/commitdiff_plain/b20db833ab9fe345d4463b10d6fa74aa21c49aca?ds=sidebyside MANDOCERR_NOARGS reported three completely unrelated classes of problems. Split the roff(7) parts out of it and report the request names for these cases. --- diff --git a/mandoc.h b/mandoc.h index 2848d2bc..d0b530aa 100644 --- a/mandoc.h +++ b/mandoc.h @@ -1,4 +1,4 @@ -/* $Id: mandoc.h,v 1.130 2014/07/02 20:19:11 schwarze Exp $ */ +/* $Id: mandoc.h,v 1.131 2014/07/03 21:23:54 schwarze Exp $ */ /* * Copyright (c) 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -83,7 +83,9 @@ enum mandocerr { MANDOCERR_NF_SKIP, /* fill mode already disabled, skipping .nf */ MANDOCERR_LINESCOPE, /* line scope broken: macro breaks macro */ - /* related to missing macro arguments */ + /* related to missing arguments */ + MANDOCERR_REQ_EMPTY, /* skipping empty request: request */ + MANDOCERR_COND_EMPTY, /* conditional request controls empty scope */ MANDOCERR_MACRO_EMPTY, /* skipping empty macro: macro */ MANDOCERR_ARGCWARN, /* argument count wrong */ MANDOCERR_DISPTYPE, /* missing display type */ diff --git a/read.c b/read.c index a60f42f9..ebda30be 100644 --- a/read.c +++ b/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.57 2014/07/02 13:10:45 schwarze Exp $ */ +/* $Id: read.c,v 1.58 2014/07/03 21:23:54 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -128,6 +128,8 @@ static const char * const mandocerrs[MANDOCERR_MAX] = { "line scope broken", /* related to missing macro arguments */ + "skipping empty request", + "conditional request controls empty scope", "skipping empty macro", "argument count wrong", "missing display type", diff --git a/roff.c b/roff.c index 465bba79..999fda5b 100644 --- a/roff.c +++ b/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.215 2014/07/01 00:32:29 schwarze Exp $ */ +/* $Id: roff.c,v 1.216 2014/07/03 21:23:54 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -917,7 +917,8 @@ roff_block(ROFF_ARGS) if (ROFF_ig != tok) { if ('\0' == *cp) { - mandoc_msg(MANDOCERR_NOARGS, r->parse, ln, ppos, NULL); + mandoc_msg(MANDOCERR_REQ_EMPTY, r->parse, + ln, ppos, roffs[tok].name); return(ROFF_IGN); } @@ -1285,7 +1286,8 @@ roff_cond(ROFF_ARGS) */ if ('\0' == (*bufp)[pos]) - mandoc_msg(MANDOCERR_NOARGS, r->parse, ln, ppos, NULL); + mandoc_msg(MANDOCERR_COND_EMPTY, r->parse, + ln, ppos, roffs[tok].name); r->last->endspan = 1;