=================================================================== RCS file: /cvs/mandoc/Attic/validate.c,v retrieving revision 1.79 retrieving revision 1.83 diff -u -p -r1.79 -r1.83 --- mandoc/Attic/validate.c 2009/03/11 00:39:58 1.79 +++ mandoc/Attic/validate.c 2009/03/13 13:56:13 1.83 @@ -1,4 +1,4 @@ -/* $Id: validate.c,v 1.79 2009/03/11 00:39:58 kristaps Exp $ */ +/* $Id: validate.c,v 1.83 2009/03/13 13:56:13 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -139,10 +139,10 @@ static int ewarn_ge1(POST_ARGS); static int ebool(POST_ARGS); static int post_an(POST_ARGS); +static int post_args(POST_ARGS); static int post_at(POST_ARGS); static int post_bf(POST_ARGS); static int post_bl(POST_ARGS); -static int post_ex(POST_ARGS); static int post_it(POST_ARGS); static int post_nm(POST_ARGS); static int post_root(POST_ARGS); @@ -180,14 +180,13 @@ 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_ex[] = { eerr_eq0, post_args, NULL }; +static v_post posts_rv[] = { eerr_eq0, post_args, 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 }; @@ -232,7 +231,7 @@ const struct valids mdoc_valids[MDOC_MAX] = { { NULL, posts_wline }, /* Op */ { NULL, NULL }, /* Ot */ { NULL, NULL }, /* Pa */ - { pres_rv, posts_notext }, /* Rv */ + { pres_rv, posts_rv }, /* Rv */ { NULL, posts_st }, /* St */ { NULL, posts_text }, /* Va */ { NULL, posts_text }, /* Vt */ @@ -303,13 +302,14 @@ const struct valids mdoc_valids[MDOC_MAX] = { { NULL, NULL }, /* Fr */ { NULL, posts_notext }, /* Ud */ { pres_lb, posts_lb }, /* Lb */ - { NULL, NULL }, /* Lb */ - { NULL, posts_pp }, /* Pp */ - { NULL, posts_lk }, /* Lk */ - { NULL, posts_mt }, /* Mt */ + { NULL, NULL }, /* Ap */ + { NULL, posts_pp }, /* Lp */ + { NULL, posts_text }, /* Lk */ + { NULL, posts_text }, /* Mt */ { NULL, posts_wline }, /* Brq */ { NULL, NULL }, /* Bro */ { NULL, NULL }, /* Brc */ + { NULL, posts_text }, /* %C */ }; @@ -669,7 +669,7 @@ check_argv(struct mdoc *m, const struct mdoc_node *n, if ( ! check_text(m, v->line, v->pos, v->value[i])) return(0); - if (MDOC_Std == v->arg && MDOC_Ex == n->tok) { + if (MDOC_Std == v->arg) { /* `Nm' name must be set. */ if (v->sz || m->meta.name) return(1); @@ -1084,7 +1084,7 @@ post_an(POST_ARGS) static int -post_ex(POST_ARGS) +post_args(POST_ARGS) { if (mdoc->last->args) @@ -1187,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; }