=================================================================== RCS file: /cvs/mandoc/Attic/validate.c,v retrieving revision 1.76 retrieving revision 1.81 diff -u -p -r1.76 -r1.81 --- mandoc/Attic/validate.c 2009/03/08 20:57:35 1.76 +++ mandoc/Attic/validate.c 2009/03/12 06:32:17 1.81 @@ -1,4 +1,4 @@ -/* $Id: validate.c,v 1.76 2009/03/08 20:57:35 kristaps Exp $ */ +/* $Id: validate.c,v 1.81 2009/03/12 06:32:17 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -16,6 +16,8 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ +#include + #include #include #include @@ -135,6 +137,7 @@ static int bwarn_ge1(POST_ARGS); static int hwarn_eq1(POST_ARGS); static int ewarn_ge1(POST_ARGS); static int ebool(POST_ARGS); + static int post_an(POST_ARGS); static int post_at(POST_ARGS); static int post_bf(POST_ARGS); @@ -177,12 +180,14 @@ static v_post posts_in[] = { ewarn_eq1, NULL }; static v_post posts_ss[] = { herr_ge1, NULL }; static v_post posts_pf[] = { eerr_eq1, NULL }; static v_post posts_lb[] = { eerr_eq1, NULL }; +static v_post posts_mt[] = { eerr_ge1, NULL }; static v_post posts_st[] = { eerr_eq1, post_st, NULL }; static v_post posts_pp[] = { ewarn_eq0, NULL }; static v_post posts_ex[] = { eerr_eq0, post_ex, NULL }; static v_post posts_an[] = { post_an, NULL }; static v_post posts_at[] = { post_at, NULL }; static v_post posts_xr[] = { eerr_ge1, eerr_le2, NULL }; +static v_post posts_lk[] = { eerr_ge1, NULL }; static v_post posts_nm[] = { post_nm, NULL }; static v_post posts_bf[] = { hwarn_le1, post_bf, NULL }; static v_post posts_rs[] = { herr_eq0, bwarn_ge1, NULL }; @@ -300,6 +305,11 @@ const struct valids mdoc_valids[MDOC_MAX] = { { pres_lb, posts_lb }, /* Lb */ { NULL, NULL }, /* Lb */ { NULL, posts_pp }, /* Pp */ + { NULL, posts_lk }, /* Lk */ + { NULL, posts_mt }, /* Mt */ + { NULL, posts_wline }, /* Brq */ + { NULL, NULL }, /* Bro */ + { NULL, NULL }, /* Brc */ }; @@ -1177,15 +1187,13 @@ post_it(POST_ARGS) if (mdoc->last->body->child) if ( ! mwarn(mdoc, WNOMULTILINE)) return(0); - c = mdoc->last->head->child; - for (i = 0; c; c = c->next) + c = mdoc->last->child; + for (i = 0; c && MDOC_HEAD == c->type; c = c->next) i++; if (i == cols) break; - if ( ! mdoc_warn(mdoc, WARN_SYNTAX, - "column mismatch (have %d, want %d)", i, cols)) - return(0); - break; + return(mdoc_err(mdoc, "column mismatch (have " + "%d, want %d)", i, cols)); default: break; }