summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TODO2
-rw-r--r--main.c2
-rw-r--r--mandoc.h2
-rw-r--r--mdoc_validate.c23
4 files changed, 17 insertions, 12 deletions
diff --git a/TODO b/TODO
index 526b5366..b1ba9ef5 100644
--- a/TODO
+++ b/TODO
@@ -59,6 +59,8 @@
flags defined for struct mdoc_macro
- set a meaningful default if no `Bl' list type is assigned
+
+- have a blank `It' head for `Bl -tag' not puke
************************************************************************
* formatting issues: ugly output
diff --git a/main.c b/main.c
index 2b2bb426..047b08e3 100644
--- a/main.c
+++ b/main.c
@@ -102,7 +102,6 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
"out of order prologue",
"repeated prologue entry",
"list type must come first",
- "column syntax is inconsistent",
"bad standard",
"bad library",
"bad escape sequence",
@@ -144,6 +143,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = {
"no title in document",
"line argument(s) will be lost",
"body argument(s) will be lost",
+ "column syntax is inconsistent",
"missing font type",
"missing display type",
"missing list type",
diff --git a/mandoc.h b/mandoc.h
index 956b65bf..bf11985a 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -31,7 +31,6 @@ enum mandocerr {
MANDOCERR_PROLOGOOO, /* out of order prologue */
MANDOCERR_PROLOGREP, /* repeated prologue entry */
MANDOCERR_LISTFIRST, /* list type must come first */
- MANDOCERR_COLUMNS, /* column syntax is inconsistent */
MANDOCERR_BADSTANDARD, /* bad standard */
MANDOCERR_BADLIB, /* bad library */
MANDOCERR_BADESCAPE, /* bad escape sequence */
@@ -78,6 +77,7 @@ enum mandocerr {
MANDOCERR_BODYLOST, /* body argument(s) will be lost */
#define MANDOCERR_ERROR MANDOCERR_BODYLOST
+ MANDOCERR_COLUMNS, /* column syntax is inconsistent */
/* FIXME: this should be a MANDOCERR_ERROR */
MANDOCERR_FONTTYPE, /* missing font type */
/* FIXME: this should be a MANDOCERR_ERROR */
diff --git a/mdoc_validate.c b/mdoc_validate.c
index e8a7b191..e2e358a5 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1024,20 +1024,23 @@ post_it(POST_ARGS)
static int
post_bl_head(POST_ARGS)
{
- int i;
- const struct mdoc_node *n;
- const struct mdoc_argv *a;
+ int i;
+ struct mdoc_node *n;
+ assert(mdoc->last->parent);
n = mdoc->last->parent;
- assert(n->args);
- for (i = 0; i < (int)n->args->argc; i++) {
- a = &n->args->argv[i];
- if (a->arg == MDOC_Column) {
- if (a->sz && mdoc->last->nchild)
- return(mdoc_nmsg(mdoc, n, MANDOCERR_COLUMNS));
- return(1);
+ if (LIST_column == n->data.list) {
+ for (i = 0; i < (int)n->args->argc; i++)
+ if (MDOC_Column == n->args->argv[i].arg)
+ break;
+ assert(i < (int)n->args->argc);
+
+ if (n->args->argv[i].sz && mdoc->last->nchild) {
+ mdoc_nmsg(mdoc, n, MANDOCERR_COLUMNS);
+ return(0);
}
+ return(1);
}
if (0 == (i = mdoc->last->nchild))