From b3b89a43d7165af5fd4fe84f88cdeef6cb5ee1aa Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 20 Jun 2014 17:24:00 +0000 Subject: Start systematic improvements of error reporting. So far, this covers all WARNINGs related to the prologue. 1) hierarchical naming of MANDOCERR_* constants 2) mention the macro name in messages where that adds clarity 3) add one missing MANDOCERR_DATE_MISSING msg 4) fix the wording of one message related to the man(7) prologue Started on the plane back from Ottawa. --- mdoc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mdoc.c') diff --git a/mdoc.c b/mdoc.c index c56fad41..38ed0612 100644 --- a/mdoc.c +++ b/mdoc.c @@ -1,4 +1,4 @@ -/* $Id: mdoc.c,v 1.214 2014/04/25 14:11:30 schwarze Exp $ */ +/* $Id: mdoc.c,v 1.215 2014/06/20 17:24:00 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze @@ -305,7 +305,8 @@ mdoc_macro(MACRO_PROT_ARGS) if (MDOC_PROLOGUE & mdoc_macros[tok].flags && MDOC_PBODY & mdoc->flags) { - mdoc_pmsg(mdoc, line, ppos, MANDOCERR_BADBODY); + mandoc_vmsg(MANDOCERR_PROLOG_ONLY, mdoc->parse, + line, ppos, "%s", mdoc_macronames[tok]); return(1); } @@ -313,7 +314,8 @@ mdoc_macro(MACRO_PROT_ARGS) if ( ! (MDOC_PROLOGUE & mdoc_macros[tok].flags) && ! (MDOC_PBODY & mdoc->flags)) { - mdoc_pmsg(mdoc, line, ppos, MANDOCERR_BADPROLOG); + mandoc_vmsg(MANDOCERR_PROLOG_BAD, mdoc->parse, + line, ppos, "%s", mdoc_macronames[tok]); if (NULL == mdoc->meta.msec) mdoc->meta.msec = mandoc_strdup("1"); if (NULL == mdoc->meta.title) -- cgit v1.2.3-56-ge451