summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-10-15 02:56:51 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-10-15 02:56:51 +0000
commit14b59d9098dc2d9988e25f8aef3f29d6c2862e58 (patch)
tree90886013798b7cc7065fa361480df923954aa41e /mdoc_validate.c
parent220b0aefa44e51fdbb7057b36adc3210b096e100 (diff)
downloadmandoc-14b59d9098dc2d9988e25f8aef3f29d6c2862e58.tar.gz
Added warning about specifying list arguments before type (suggested by Joerg Sonnenberg).
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 83add494..ee373de3 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -621,25 +621,33 @@ pre_bl(PRE_ARGS)
case (MDOC_Inset):
/* FALLTHROUGH */
case (MDOC_Column):
- if (-1 != type)
+ if (type >= 0)
return(mdoc_nerr(mdoc, n, EMULTILIST));
type = n->args->argv[pos].arg;
break;
+ case (MDOC_Compact):
+ if (type < 0 && ! mdoc_nwarn(mdoc, n, ENOTYPE))
+ return(0);
+ break;
case (MDOC_Width):
- if (-1 != width)
+ if (width >= 0)
return(mdoc_nerr(mdoc, n, EARGREP));
+ if (type < 0 && ! mdoc_nwarn(mdoc, n, ENOTYPE))
+ return(0);
width = n->args->argv[pos].arg;
break;
case (MDOC_Offset):
- if (-1 != offset)
+ if (offset >= 0)
return(mdoc_nerr(mdoc, n, EARGREP));
+ if (type < 0 && ! mdoc_nwarn(mdoc, n, ENOTYPE))
+ return(0);
offset = n->args->argv[pos].arg;
break;
default:
break;
}
- if (-1 == type)
+ if (type < 0)
return(mdoc_nerr(mdoc, n, ELISTTYPE));
/*
@@ -650,7 +658,7 @@ pre_bl(PRE_ARGS)
switch (type) {
case (MDOC_Tag):
- if (-1 == width && ! mdoc_nwarn(mdoc, n, EMISSWIDTH))
+ if (width < 0 && ! mdoc_nwarn(mdoc, n, EMISSWIDTH))
return(0);
break;
case (MDOC_Column):
@@ -660,7 +668,7 @@ pre_bl(PRE_ARGS)
case (MDOC_Inset):
/* FALLTHROUGH */
case (MDOC_Item):
- if (-1 != width && ! mdoc_nwarn(mdoc, n, ENOWIDTH))
+ if (width >= 0 && ! mdoc_nwarn(mdoc, n, ENOWIDTH))
return(0);
break;
default: