diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-03 21:23:54 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-03 21:23:54 +0000 |
commit | b3a2c4a288eaff61368f73f9008d243d10ff5f7c (patch) | |
tree | d2b35c144ce05d47ad6dbea71b081846fdc19539 | |
parent | 02c50c123f386b824e755e7f6334792530c88411 (diff) | |
download | mandoc-b3a2c4a288eaff61368f73f9008d243d10ff5f7c.tar.gz |
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.
-rw-r--r-- | mandoc.h | 4 | ||||
-rw-r--r-- | read.c | 2 | ||||
-rw-r--r-- | roff.c | 6 |
3 files changed, 9 insertions, 3 deletions
@@ -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 */ @@ -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", @@ -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; |