version 1.107, 2014/11/28 05:51:32 |
version 1.111, 2015/02/06 08:28:35 |
|
|
|
|
typedef void (*v_check)(CHKARGS); |
typedef void (*v_check)(CHKARGS); |
|
|
static void check_eq0(CHKARGS); |
|
static void check_eq2(CHKARGS); |
static void check_eq2(CHKARGS); |
static void check_le1(CHKARGS); |
static void check_le1(CHKARGS); |
static void check_le5(CHKARGS); |
static void check_le5(CHKARGS); |
Line 79 static v_check man_valids[MAN_MAX] = { |
|
Line 78 static v_check man_valids[MAN_MAX] = { |
|
NULL, /* I */ |
NULL, /* I */ |
NULL, /* IR */ |
NULL, /* IR */ |
NULL, /* RI */ |
NULL, /* RI */ |
check_eq0, /* na */ |
|
post_vs, /* sp */ |
post_vs, /* sp */ |
post_nf, /* nf */ |
post_nf, /* nf */ |
post_fi, /* fi */ |
post_fi, /* fi */ |
Line 183 check_##name(CHKARGS) \ |
|
Line 181 check_##name(CHKARGS) \ |
|
#ineq, (x), n->nchild); \ |
#ineq, (x), n->nchild); \ |
} |
} |
|
|
INEQ_DEFINE(0, ==, eq0) |
|
INEQ_DEFINE(2, ==, eq2) |
INEQ_DEFINE(2, ==, eq2) |
INEQ_DEFINE(1, <=, le1) |
INEQ_DEFINE(1, <=, le1) |
INEQ_DEFINE(5, <=, le5) |
INEQ_DEFINE(5, <=, le5) |
|
|
check_part(CHKARGS) |
check_part(CHKARGS) |
{ |
{ |
|
|
if (MAN_BODY == n->type && 0 == n->nchild) |
if (n->type == MAN_BODY && n->child == NULL) |
mandoc_msg(MANDOCERR_ARGCWARN, man->parse, n->line, |
mandoc_msg(MANDOCERR_BLK_EMPTY, man->parse, |
n->pos, "want children (have none)"); |
n->line, n->pos, man_macronames[n->tok]); |
} |
} |
|
|
static void |
static void |
Line 379 post_TH(CHKARGS) |
|
Line 376 post_TH(CHKARGS) |
|
|
|
if (n && (n = n->next)) |
if (n && (n = n->next)) |
man->meta.source = mandoc_strdup(n->string); |
man->meta.source = mandoc_strdup(n->string); |
|
else if (man->defos != NULL) |
|
man->meta.source = mandoc_strdup(man->defos); |
|
|
/* TITLE MSEC DATE SOURCE ->VOL<- */ |
/* TITLE MSEC DATE SOURCE ->VOL<- */ |
/* If missing, use the default VOL name for MSEC. */ |
/* If missing, use the default VOL name for MSEC. */ |
|
|
post_nf(CHKARGS) |
post_nf(CHKARGS) |
{ |
{ |
|
|
check_eq0(man, n); |
if (man->flags & MAN_LITERAL) |
|
|
if (MAN_LITERAL & man->flags) |
|
mandoc_msg(MANDOCERR_NF_SKIP, man->parse, |
mandoc_msg(MANDOCERR_NF_SKIP, man->parse, |
n->line, n->pos, "nf"); |
n->line, n->pos, "nf"); |
|
|
|
|
post_fi(CHKARGS) |
post_fi(CHKARGS) |
{ |
{ |
|
|
check_eq0(man, n); |
|
|
|
if ( ! (MAN_LITERAL & man->flags)) |
if ( ! (MAN_LITERAL & man->flags)) |
mandoc_msg(MANDOCERR_FI_SKIP, man->parse, |
mandoc_msg(MANDOCERR_FI_SKIP, man->parse, |
n->line, n->pos, "fi"); |
n->line, n->pos, "fi"); |
|
|
post_vs(CHKARGS) |
post_vs(CHKARGS) |
{ |
{ |
|
|
if (n->tok == MAN_br) |
if (n->tok == MAN_sp) |
check_eq0(man, n); |
|
else |
|
check_le1(man, n); |
check_le1(man, n); |
|
|
if (NULL != n->prev) |
if (NULL != n->prev) |