version 1.97, 2014/07/04 16:12:08 |
version 1.103, 2014/08/01 17:40:34 |
Line 62 static int post_vs(CHKARGS); |
|
Line 62 static int post_vs(CHKARGS); |
|
static int post_fi(CHKARGS); |
static int post_fi(CHKARGS); |
static int post_ft(CHKARGS); |
static int post_ft(CHKARGS); |
static int post_nf(CHKARGS); |
static int post_nf(CHKARGS); |
static int post_sec(CHKARGS); |
|
static int post_TH(CHKARGS); |
static int post_TH(CHKARGS); |
static int post_UC(CHKARGS); |
static int post_UC(CHKARGS); |
static int pre_sec(CHKARGS); |
static int pre_sec(CHKARGS); |
Line 78 static v_check posts_le1[] = { check_le1, NULL }; |
|
Line 77 static v_check posts_le1[] = { check_le1, NULL }; |
|
static v_check posts_nf[] = { check_eq0, post_nf, NULL }; |
static v_check posts_nf[] = { check_eq0, post_nf, NULL }; |
static v_check posts_par[] = { check_par, NULL }; |
static v_check posts_par[] = { check_par, NULL }; |
static v_check posts_part[] = { check_part, NULL }; |
static v_check posts_part[] = { check_part, NULL }; |
static v_check posts_sec[] = { post_sec, NULL }; |
|
static v_check posts_sp[] = { post_vs, check_le1, NULL }; |
static v_check posts_sp[] = { post_vs, check_le1, NULL }; |
static v_check posts_th[] = { check_ge2, check_le5, post_TH, NULL }; |
static v_check posts_th[] = { check_ge2, check_le5, post_TH, NULL }; |
static v_check posts_uc[] = { post_UC, NULL }; |
static v_check posts_uc[] = { post_UC, NULL }; |
Line 88 static v_check pres_sec[] = { pre_sec, NULL }; |
|
Line 86 static v_check pres_sec[] = { pre_sec, NULL }; |
|
static const struct man_valid man_valids[MAN_MAX] = { |
static const struct man_valid man_valids[MAN_MAX] = { |
{ NULL, posts_br }, /* br */ |
{ NULL, posts_br }, /* br */ |
{ NULL, posts_th }, /* TH */ |
{ NULL, posts_th }, /* TH */ |
{ pres_sec, posts_sec }, /* SH */ |
{ pres_sec, NULL }, /* SH */ |
{ pres_sec, posts_sec }, /* SS */ |
{ pres_sec, NULL }, /* SS */ |
{ NULL, NULL }, /* TP */ |
{ NULL, NULL }, /* TP */ |
{ NULL, posts_par }, /* LP */ |
{ NULL, posts_par }, /* LP */ |
{ NULL, posts_par }, /* PP */ |
{ NULL, posts_par }, /* PP */ |
|
|
check_root(CHKARGS) |
check_root(CHKARGS) |
{ |
{ |
|
|
if (MAN_BLINE & man->flags) |
assert((man->flags & (MAN_BLINE | MAN_ELINE)) == 0); |
man_nmsg(man, n, MANDOCERR_SCOPEEXIT); |
|
else if (MAN_ELINE & man->flags) |
|
man_nmsg(man, n, MANDOCERR_SCOPEEXIT); |
|
|
|
man->flags &= ~MAN_BLINE; |
|
man->flags &= ~MAN_ELINE; |
|
|
|
if (NULL == man->first->child) |
if (NULL == man->first->child) |
man_nmsg(man, n, MANDOCERR_DOC_EMPTY); |
mandoc_msg(MANDOCERR_DOC_EMPTY, man->parse, |
|
n->line, n->pos, NULL); |
else |
else |
man->meta.hasbody = 1; |
man->meta.hasbody = 1; |
|
|
if (NULL == man->meta.title) { |
if (NULL == man->meta.title) { |
man_nmsg(man, n, MANDOCERR_TH_MISSING); |
mandoc_msg(MANDOCERR_TH_MISSING, man->parse, |
|
n->line, n->pos, NULL); |
|
|
/* |
/* |
* If a title hasn't been set, do so now (by |
* If a title hasn't been set, do so now (by |
Line 230 check_text(CHKARGS) |
|
Line 224 check_text(CHKARGS) |
|
|
|
cp = n->string; |
cp = n->string; |
for (p = cp; NULL != (p = strchr(p, '\t')); p++) |
for (p = cp; NULL != (p = strchr(p, '\t')); p++) |
man_pmsg(man, n->line, (int)(p - cp), MANDOCERR_BADTAB); |
mandoc_msg(MANDOCERR_FI_TAB, man->parse, |
|
n->line, n->pos + (p - cp), NULL); |
} |
} |
|
|
#define INEQ_DEFINE(x, ineq, name) \ |
#define INEQ_DEFINE(x, ineq, name) \ |
Line 303 post_ft(CHKARGS) |
|
Line 298 post_ft(CHKARGS) |
|
} |
} |
|
|
if (0 == ok) { |
if (0 == ok) { |
mandoc_vmsg(MANDOCERR_BADFONT, man->parse, n->line, |
mandoc_vmsg(MANDOCERR_FT_BAD, man->parse, |
n->pos, "%s", cp); |
n->line, n->pos, "ft %s", cp); |
*cp = '\0'; |
*cp = '\0'; |
} |
} |
|
|
Line 325 pre_sec(CHKARGS) |
|
Line 320 pre_sec(CHKARGS) |
|
} |
} |
|
|
static int |
static int |
post_sec(CHKARGS) |
|
{ |
|
|
|
if ( ! (MAN_HEAD == n->type && 0 == n->nchild)) |
|
return(1); |
|
|
|
man_nmsg(man, n, MANDOCERR_SYNTARGCOUNT); |
|
return(0); |
|
} |
|
|
|
static int |
|
check_part(CHKARGS) |
check_part(CHKARGS) |
{ |
{ |
|
|
Line 422 post_TH(CHKARGS) |
|
Line 406 post_TH(CHKARGS) |
|
/* Only warn about this once... */ |
/* Only warn about this once... */ |
if (isalpha((unsigned char)*p) && |
if (isalpha((unsigned char)*p) && |
! isupper((unsigned char)*p)) { |
! isupper((unsigned char)*p)) { |
mandoc_msg(MANDOCERR_TITLE_CASE, |
mandoc_vmsg(MANDOCERR_TITLE_CASE, |
man->parse, n->line, |
man->parse, n->line, |
n->pos + (p - n->string), |
n->pos + (p - n->string), |
n->string); |
"TH %s", n->string); |
break; |
break; |
} |
} |
} |
} |
Line 453 post_TH(CHKARGS) |
|
Line 437 post_TH(CHKARGS) |
|
n->line, n->pos); |
n->line, n->pos); |
} else { |
} else { |
man->meta.date = mandoc_strdup(""); |
man->meta.date = mandoc_strdup(""); |
man_nmsg(man, n ? n : nb, MANDOCERR_DATE_MISSING); |
mandoc_msg(MANDOCERR_DATE_MISSING, man->parse, |
|
n ? n->line : nb->line, |
|
n ? n->pos : nb->pos, "TH"); |
} |
} |
|
|
/* TITLE MSEC DATE ->SOURCE<- VOL */ |
/* TITLE MSEC DATE ->SOURCE<- VOL */ |
Line 483 post_nf(CHKARGS) |
|
Line 469 post_nf(CHKARGS) |
|
{ |
{ |
|
|
if (MAN_LITERAL & man->flags) |
if (MAN_LITERAL & man->flags) |
man_nmsg(man, n, MANDOCERR_NF_SKIP); |
mandoc_msg(MANDOCERR_NF_SKIP, man->parse, |
|
n->line, n->pos, "nf"); |
|
|
man->flags |= MAN_LITERAL; |
man->flags |= MAN_LITERAL; |
return(1); |
return(1); |
Line 494 post_fi(CHKARGS) |
|
Line 481 post_fi(CHKARGS) |
|
{ |
{ |
|
|
if ( ! (MAN_LITERAL & man->flags)) |
if ( ! (MAN_LITERAL & man->flags)) |
man_nmsg(man, n, MANDOCERR_FI_SKIP); |
mandoc_msg(MANDOCERR_FI_SKIP, man->parse, |
|
n->line, n->pos, "fi"); |
|
|
man->flags &= ~MAN_LITERAL; |
man->flags &= ~MAN_LITERAL; |
return(1); |
return(1); |