and report the macro name and argument.
-/* $Id: mandoc.h,v 1.92 2014/08/08 15:42:39 schwarze Exp $ */
+/* $Id: mandoc.h,v 1.93 2014/08/08 15:45:58 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
MANDOCERR_ARG_STD, /* missing -std argument, adding it: macro */
/* related to bad arguments */
- MANDOCERR_IGNARGV, /* skipping argument */
MANDOCERR_ARG_QUOTE, /* unterminated quoted argument */
MANDOCERR_ARG_REP, /* duplicate argument: macro arg */
+ MANDOCERR_AN_REP, /* skipping duplicate argument: An -arg */
MANDOCERR_BD_REP, /* skipping duplicate display type: type */
MANDOCERR_BL_REP, /* skipping duplicate list type: type */
+ MANDOCERR_BL_SKIPW, /* skipping -width argument: Bl -type */
MANDOCERR_AT_BAD, /* unknown AT&T UNIX version: version */
MANDOCERR_RS_BAD, /* invalid content in Rs block: macro */
MANDOCERR_SM_BAD, /* invalid Boolean argument: macro arg */
-/* $Id: mdoc_validate.c,v 1.155 2014/08/08 15:42:39 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.156 2014/08/08 15:45:58 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
pre_bl(PRE_ARGS)
{
struct mdoc_node *np;
- struct mdoc_argv *argv;
+ struct mdoc_argv *argv, *wa;
int i;
+ enum mdocargt mdoclt;
enum mdoc_list lt;
if (MDOC_BLOCK != n->type) {
* ones. If we find no list type, we default to LIST_item.
*/
+ wa = n->args->argv;
+ mdoclt = MDOC_ARG_MAX;
for (i = 0; n->args && i < (int)n->args->argc; i++) {
argv = n->args->argv + i;
lt = LIST__NONE;
n->norm->Bl.comp = 1;
break;
case MDOC_Width:
+ wa = argv;
if (0 == argv->sz) {
mandoc_msg(MANDOCERR_ARG_EMPTY,
mdoc->parse, argv->line,
}
if (LIST__NONE == lt)
continue;
+ mdoclt = argv->arg;
/* Check: multiple list types. */
/* FALLTHROUGH */
case LIST_item:
if (n->norm->Bl.width)
- mdoc_nmsg(mdoc, n, MANDOCERR_IGNARGV);
+ mandoc_vmsg(MANDOCERR_BL_SKIPW, mdoc->parse,
+ wa->line, wa->pos, "Bl -%s",
+ mdoc_argnames[mdoclt]);
break;
case LIST_bullet:
/* FALLTHROUGH */
static int
pre_an(PRE_ARGS)
{
- int i;
+ struct mdoc_argv *argv;
+ size_t i;
- if (NULL == n->args)
+ if (n->args == NULL)
return(1);
- for (i = 1; i < (int)n->args->argc; i++)
- mdoc_pmsg(mdoc, n->args->argv[i].line,
- n->args->argv[i].pos, MANDOCERR_IGNARGV);
+ for (i = 1; i < n->args->argc; i++) {
+ argv = n->args->argv + i;
+ mandoc_vmsg(MANDOCERR_AN_REP,
+ mdoc->parse, argv->line, argv->pos,
+ "An -%s", mdoc_argnames[argv->arg]);
+ }
- if (MDOC_Split == n->args->argv[0].arg)
+ argv = n->args->argv;
+ if (argv->arg == MDOC_Split)
n->norm->An.auth = AUTH_split;
- else if (MDOC_Nosplit == n->args->argv[0].arg)
+ else if (argv->arg == MDOC_Nosplit)
n->norm->An.auth = AUTH_nosplit;
else
abort();
-/* $Id: read.c,v 1.53 2014/08/08 15:42:39 schwarze Exp $ */
+/* $Id: read.c,v 1.54 2014/08/08 15:45:58 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
"missing -std argument, adding it",
/* related to bad macro arguments */
- "skipping argument",
"unterminated quoted argument",
"duplicate argument",
+ "skipping duplicate argument",
"skipping duplicate display type",
"skipping duplicate list type",
+ "skipping -width argument",
"unknown AT&T UNIX version",
"invalid content in Rs block",
"invalid Boolean argument",