-/* $OpenBSD$ */
+/* $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>
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);
NULL, /* I */
NULL, /* IR */
NULL, /* RI */
- NULL, /* nf */
- NULL, /* fi */
NULL, /* RE */
check_part, /* RS */
NULL, /* DT */
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 */
/* Validate the subtree rooted at man->last. */
void
-man_node_validate(struct roff_man *man)
+man_validate(struct roff_man *man)
{
struct roff_node *n;
const v_check *cp;
man->last = man->last->child;
while (man->last != NULL) {
- man_node_validate(man);
+ man_validate(man);
if (man->last == n)
man->last = man->last->child;
else
if (*cp)
(*cp)(man, n);
if (man->last == n)
- man_state(man, n);
+ n->flags |= NODE_VALID;
break;
}
}
{
char *cp, *p;
- if (MAN_LITERAL & man->flags)
+ if (n->flags & NODE_NOFILL)
return;
cp = n->string;
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)
{