=================================================================== RCS file: /cvs/mandoc/mdoc_validate.c,v retrieving revision 1.23 retrieving revision 1.27 diff -u -p -r1.23 -r1.27 --- mandoc/mdoc_validate.c 2009/07/06 13:04:52 1.23 +++ mandoc/mdoc_validate.c 2009/07/12 16:34:16 1.27 @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.23 2009/07/06 13:04:52 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.27 2009/07/12 16:34:16 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -85,8 +85,8 @@ static int eerr_le2(POST_ARGS); static int eerr_eq1(POST_ARGS); static int eerr_ge1(POST_ARGS); static int ewarn_eq0(POST_ARGS); -static int ewarn_eq1(POST_ARGS); static int bwarn_ge1(POST_ARGS); +static int berr_ge1(POST_ARGS); static int hwarn_eq1(POST_ARGS); static int ewarn_ge1(POST_ARGS); static int ebool(POST_ARGS); @@ -129,8 +129,9 @@ static v_post posts_wline[] = { bwarn_ge1, herr_eq0, N static v_post posts_sh[] = { herr_ge1, bwarn_ge1, post_sh, NULL }; static v_post posts_bl[] = { bwarn_ge1, post_bl, NULL }; static v_post posts_it[] = { post_it, NULL }; -static v_post posts_in[] = { ewarn_eq1, NULL }; +static v_post posts_in[] = { eerr_eq1, NULL }; static v_post posts_ss[] = { herr_ge1, NULL }; +static v_post posts_nd[] = { berr_ge1, NULL }; static v_post posts_pf[] = { eerr_eq1, NULL }; static v_post posts_lb[] = { eerr_eq1, NULL }; static v_post posts_st[] = { eerr_eq1, post_st, NULL }; @@ -176,7 +177,7 @@ const struct valids mdoc_valids[MDOC_MAX] = { { NULL, posts_text }, /* Ic */ { NULL, posts_in }, /* In */ { NULL, NULL }, /* Li */ - { NULL, posts_wtext }, /* Nd */ + { NULL, posts_nd }, /* Nd */ { NULL, posts_nm }, /* Nm */ { NULL, posts_wline }, /* Op */ { NULL, NULL }, /* Ot */ @@ -408,7 +409,7 @@ CHECK_CHILD_DEFN(err, eq, ==) /* err_child_eq() */ CHECK_CHILD_DEFN(err, lt, <) /* err_child_lt() */ CHECK_CHILD_DEFN(warn, lt, <) /* warn_child_lt() */ CHECK_BODY_DEFN(ge1, warn, warn_child_gt, 0) /* bwarn_ge1() */ -CHECK_ELEM_DEFN(eq1, warn, warn_child_eq, 1) /* ewarn_eq1() */ +CHECK_BODY_DEFN(ge1, err, err_child_gt, 0) /* berr_ge1() */ CHECK_ELEM_DEFN(eq0, warn, warn_child_eq, 0) /* ewarn_eq0() */ CHECK_ELEM_DEFN(ge1, warn, warn_child_gt, 0) /* ewarn_gt1() */ CHECK_ELEM_DEFN(eq1, err, err_child_eq, 1) /* eerr_eq1() */ @@ -853,14 +854,12 @@ post_bf(POST_ARGS) head = mdoc->last->head; if (mdoc->last->args && head->child) - return(mdoc_verr(mdoc, mdoc->last->line, - mdoc->last->pos, "one argument expected")); + return(mdoc_nerr(mdoc, mdoc->last, ELINE)); else if (mdoc->last->args) return(1); if (NULL == head->child || MDOC_TEXT != head->child->type) - return(mdoc_verr(mdoc, mdoc->last->line, - mdoc->last->pos, "text argument expected")); + return(mdoc_nerr(mdoc, mdoc->last, ELINE)); p = head->child->string; @@ -1169,13 +1168,11 @@ post_sh_body(POST_ARGS) for ( ; n && n->next; n = n->next) { if (MDOC_ELEM == n->type && MDOC_Nm == n->tok) continue; - if (MDOC_TEXT == n->type) - continue; if ( ! mdoc_nwarn(mdoc, mdoc->last, ENAMESECINC)) return(0); } - if (MDOC_ELEM == n->type && MDOC_Nd == n->tok) + if (MDOC_BLOCK == n->type && MDOC_Nd == n->tok) return(1); return(mdoc_nwarn(mdoc, mdoc->last, ENAMESECINC)); } @@ -1221,9 +1218,11 @@ post_sh_head(POST_ARGS) if (SEC_CUSTOM == sec) return(1); if (sec == mdoc->lastnamed) - return(mdoc_nwarn(mdoc, mdoc->last, ESECREP)); + if ( ! mdoc_nwarn(mdoc, mdoc->last, ESECREP)) + return(0); if (sec < mdoc->lastnamed) - return(mdoc_nwarn(mdoc, mdoc->last, ESECOOO)); + if ( ! mdoc_nwarn(mdoc, mdoc->last, ESECOOO)) + return(0); /* * Check particular section/manual conventions. LIBRARY can