+/*
+ * Close out a generic explicit macro.
+ */
+/* ARGSUSED */
+int
+blk_close(MACRO_PROT_ARGS)
+{
+ enum mant ntok;
+ const struct man_node *nn;
+
+ switch (tok) {
+ case (MAN_RE):
+ ntok = MAN_RS;
+ break;
+ default:
+ abort();
+ /* NOTREACHED */
+ }
+
+ for (nn = m->last->parent; nn; nn = nn->parent)
+ if (ntok == nn->tok && MAN_BLOCK == nn->type)
+ break;
+
+ if (NULL != nn)
+ man_unscope(m, nn, MANDOCERR_MAX);
+ else
+ man_pmsg(m, line, ppos, MANDOCERR_NOSCOPE);
+
+ return(1);
+}
+
+
+/* ARGSUSED */
+int
+blk_exp(MACRO_PROT_ARGS)
+{
+ struct man_node *n;
+ int la;
+ char *p;
+
+ /* Close out prior implicit scopes. */
+
+ if ( ! rew_scope(MAN_BLOCK, m, tok))
+ return(0);
+
+ if ( ! man_block_alloc(m, line, ppos, tok))
+ return(0);
+ if ( ! man_head_alloc(m, line, ppos, tok))
+ return(0);
+
+ for (;;) {
+ la = *pos;
+ if ( ! man_args(m, line, pos, buf, &p))
+ break;
+ if ( ! man_word_alloc(m, line, la, p))
+ return(0);
+ }
+
+ assert(m);
+ assert(tok != MAN_MAX);
+
+ for (n = m->last; n; n = n->parent) {
+ if (n->tok != tok)
+ continue;
+ assert(MAN_HEAD == n->type);
+ man_unscope(m, n, MANDOCERR_MAX);
+ break;
+ }
+
+ return(man_body_alloc(m, line, ppos, tok));
+}
+
+
+