+ case (MDOC_Dl):
+ /* These can't be nested in a display block. */
+ assert(mdoc->last);
+ for (n = mdoc->last->parent ; n; n = n->parent)
+ if (MDOC_BLOCK != n->type)
+ continue;
+ else if (MDOC_Bd == n->data.block.tok)
+ break;
+ if (NULL == n)
+ break;
+ return(mdoc_err(mdoc, tok, ppos, ERR_SCOPE_NONEST));
+ default:
+ break;
+ }
+
+ /*
+ * All line-scoped macros have a HEAD and optionally a BODY
+ * section. We open our scope here; when we exit this function,
+ * we'll rewind our scope appropriately.
+ */
+
+ mdoc_block_alloc(mdoc, ppos, tok, 0, NULL);
+ mdoc_head_alloc(mdoc, ppos, tok, 0, NULL);
+
+ /* Process line parameters. */
+
+ j = 0;
+ lastarg = ppos;
+
+again:
+ if (j == MDOC_LINEARG_MAX)
+ return(mdoc_err(mdoc, tok, lastarg, ERR_ARGS_MANY));
+
+ lastarg = *pos;
+ c = mdoc_args(mdoc, tok, pos, buf, ARGS_DELIM, &p);
+
+ switch (c) {
+ case (ARGS_ERROR):
+ return(0);
+ case (ARGS_WORD):
+ break;
+ case (ARGS_PUNCT):
+ if ( ! append_delims(mdoc, tok, pos, buf))
+ return(0);
+ return(scope_rewind_imp(mdoc, ppos, tok));
+ case (ARGS_EOLN):
+ return(scope_rewind_imp(mdoc, ppos, tok));
+ default:
+ abort();
+ /* NOTREACHED */
+ }
+
+ if (MDOC_MAX != (c = mdoc_find(mdoc, p))) {
+ if ( ! mdoc_macro(mdoc, c, lastarg, pos, buf))
+ return(0);
+ if ( ! append_delims(mdoc, tok, pos, buf))
+ return(0);
+ return(scope_rewind_imp(mdoc, ppos, tok));
+ }
+
+ if (mdoc_isdelim(p))
+ j = 0;
+
+ mdoc_word_alloc(mdoc, lastarg, p);
+ goto again;
+ /* NOTREACHED */
+}
+
+
+/*
+ * Partial-line scope is identical to line scope (macro_scoped_line())
+ * except that trailing punctuation is appended to the BLOCK, instead of
+ * contained within the HEAD.
+ */
+int
+macro_scoped_pline(MACRO_PROT_ARGS)
+{
+ int lastarg, c, j;
+ char *p;
+
+ if (SEC_PROLOGUE == mdoc->sec_lastn)
+ return(mdoc_err(mdoc, tok, ppos, ERR_SEC_PROLOGUE));
+
+ /* Token pre-processing. */
+
+ switch (tok) {
+ case (MDOC_Ql):
+ if ( ! mdoc_warn(mdoc, tok, ppos, WARN_COMPAT_TROFF))