]> git.cameronkatri.com Git - mandoc.git/blobdiff - man_validate.c
Since resetting of offsets works quite differently in man(7) and mdoc(7),
[mandoc.git] / man_validate.c
index 208b7d241ff2b8c996ff727781a756967c7e7e1c..4bfaf764e6c8c542efad2d0960eeb99d5e85e019 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: man_validate.c,v 1.144 2018/12/31 07:08:12 schwarze Exp $ */
+/*     $Id: man_validate.c,v 1.146 2018/12/31 10:04:39 schwarze Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010, 2012-2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -48,6 +48,8 @@ static        void      check_root(CHKARGS);
 static void      check_text(CHKARGS);
 
 static void      post_AT(CHKARGS);
+static void      post_EE(CHKARGS);
+static void      post_EX(CHKARGS);
 static void      post_IP(CHKARGS);
 static void      post_OP(CHKARGS);
 static void      post_SH(CHKARGS);
@@ -88,8 +90,8 @@ static        const v_check man_valids[MAN_MAX - MAN_TH] = {
        NULL,       /* SY */
        NULL,       /* YS */
        post_OP,    /* OP */
-       NULL,       /* EX */
-       NULL,       /* EE */
+       post_EX,    /* EX */
+       post_EE,    /* EE */
        post_UR,    /* UR */
        NULL,       /* UE */
        post_UR,    /* MT */
@@ -151,7 +153,6 @@ man_validate(struct roff_man *man)
        default:
                if (n->tok < ROFF_MAX) {
                        roff_validate(man);
-                       man_state(man, n);
                        break;
                }
                assert(n->tok >= MAN_TH && n->tok < MAN_MAX);
@@ -159,7 +160,7 @@ man_validate(struct roff_man *man)
                if (*cp)
                        (*cp)(man, n);
                if (man->last == n)
-                       man_state(man, n);
+                       n->flags |= NODE_VALID;
                break;
        }
 }
@@ -206,7 +207,7 @@ check_text(CHKARGS)
 {
        char            *cp, *p;
 
-       if (man->flags & ROFF_NOFILL)
+       if (n->flags & NODE_NOFILL)
                return;
 
        cp = n->string;
@@ -215,6 +216,20 @@ check_text(CHKARGS)
                    n->line, n->pos + (int)(p - cp), NULL);
 }
 
+static void
+post_EE(CHKARGS)
+{
+       if ((n->flags & NODE_NOFILL) == 0)
+               mandoc_msg(MANDOCERR_FI_SKIP, n->line, n->pos, "EE");
+}
+
+static void
+post_EX(CHKARGS)
+{
+       if (n->flags & NODE_NOFILL)
+               mandoc_msg(MANDOCERR_NF_SKIP, n->line, n->pos, "EX");
+}
+
 static void
 post_OP(CHKARGS)
 {