+static int
+check_parent(struct mdoc *mdoc, struct mdoc_node *n,
+ int tok, enum mdoc_type t)
+{
+
+ assert(n->parent);
+ if ((MDOC_ROOT == t || tok == n->parent->tok) &&
+ (t == n->parent->type))
+ return(1);
+
+ return(mdoc_nerr(mdoc, n, "require parent %s",
+ MDOC_ROOT == t ? "<root>" : mdoc_macronames[tok]));
+}
+
+
+