From f5b94dbc5c8c520ba699b3625ee96b70beec3a75 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 6 Feb 2015 16:06:25 +0000 Subject: replace the last legacy generic message type, "argument count wrong", by more specific messages, improving diagnostics for .cc .tr .Bl -column --- roff.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'roff.c') diff --git a/roff.c b/roff.c index 4ec05eb9..0caceed0 100644 --- a/roff.c +++ b/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.259 2015/01/30 00:19:46 schwarze Exp $ */ +/* $Id: roff.c,v 1.260 2015/02/06 16:06:25 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012, 2014 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -2538,7 +2538,8 @@ roff_cc(ROFF_ARGS) r->control = 0; if (*p != '\0') - mandoc_msg(MANDOCERR_ARGCOUNT, r->parse, ln, ppos, NULL); + mandoc_vmsg(MANDOCERR_ARG_EXCESS, r->parse, + ln, p - buf->buf, "cc ... %s", p); return(ROFF_IGN); } @@ -2553,7 +2554,7 @@ roff_tr(ROFF_ARGS) p = buf->buf + pos; if (*p == '\0') { - mandoc_msg(MANDOCERR_ARGCOUNT, r->parse, ln, ppos, NULL); + mandoc_msg(MANDOCERR_REQ_EMPTY, r->parse, ln, ppos, "tr"); return(ROFF_IGN); } @@ -2581,8 +2582,8 @@ roff_tr(ROFF_ARGS) } ssz = (size_t)(p - second); } else if (*second == '\0') { - mandoc_msg(MANDOCERR_ARGCOUNT, r->parse, - ln, (int)(p - buf->buf), NULL); + mandoc_vmsg(MANDOCERR_TR_ODD, r->parse, + ln, first - buf->buf, "tr %s", first); second = " "; p--; } -- cgit v1.2.3