]> git.cameronkatri.com Git - mandoc.git/blobdiff - man_validate.c
Downgrade -man message of ignored empty paragraph to MANDOC_IGNPAR. The
[mandoc.git] / man_validate.c
index 136b63aae29edb66105362ea5523637ddca3d00d..0762c15afa1163415b330e43e3fb577ccc8d3843 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: man_validate.c,v 1.58 2011/01/12 15:50:42 kristaps Exp $ */
+/*     $Id: man_validate.c,v 1.59 2011/01/12 16:55:22 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
  *
@@ -80,12 +80,12 @@ static      const struct man_valid man_valids[MAN_MAX] = {
        { pres_bline, posts_th }, /* TH */
        { pres_bline, posts_sec }, /* SH */
        { pres_bline, posts_sec }, /* SS */
-       { pres_bline, posts_par }, /* TP */
+       { pres_bline, NULL }, /* TP */
        { pres_bline, posts_par }, /* LP */
        { pres_bline, posts_par }, /* PP */
        { pres_bline, posts_par }, /* P */
-       { pres_bline, posts_par }, /* IP */
-       { pres_bline, posts_par }, /* HP */
+       { pres_bline, NULL }, /* IP */
+       { pres_bline, NULL }, /* HP */
        { NULL, NULL }, /* SM */
        { NULL, NULL }, /* SB */
        { NULL, NULL }, /* BI */
@@ -359,33 +359,22 @@ static int
 check_par(CHKARGS)
 {
 
-       if (MAN_BODY == n->type) 
-               switch (n->tok) {
-               case (MAN_IP):
-                       /* FALLTHROUGH */
-               case (MAN_HP):
-                       /* FALLTHROUGH */
-               case (MAN_TP):
-                       /* Body-less lists are ok. */
-                       break;
-               default:
-                       if (0 == n->nchild)
-                               man_nmsg(m, n, MANDOCERR_NOBODY);
-                       break;
-               }
-       if (MAN_HEAD == n->type)
-               switch (n->tok) {
-               case (MAN_PP):
-                       /* FALLTHROUGH */
-               case (MAN_P):
-                       /* FALLTHROUGH */
-               case (MAN_LP):
-                       if (n->nchild)
-                               man_nmsg(m, n, MANDOCERR_ARGSLOST);
-                       break;
-               default:
-                       break;
-               }
+       switch (n->type) {
+       case (MAN_BLOCK):
+               if (0 == n->body->nchild)
+                       man_node_delete(m, n);
+               break;
+       case (MAN_BODY):
+               if (0 == n->nchild)
+                       man_nmsg(m, n, MANDOCERR_IGNPAR);
+               break;
+       case (MAN_HEAD):
+               if (n->nchild)
+                       man_nmsg(m, n, MANDOCERR_ARGSLOST);
+               break;
+       default:
+               break;
+       }
 
        return(1);
 }