FreeBSD/contrib/mdocml/man_macro.c
/*
 * Rewinding entails ascending the parse tree until a coherent point,
 * for example, the `SH' macro will close out any intervening `SS'
 * scopes.  When a scope is closed, it must be validated and actioned.
 */
Rewinding entails ascending the parse tree until a coherent point,
for example, the `SH' macro will close out any intervening `SS'
scopes.  When a scope is closed, it must be validated and actioned.
Rewinding entails ascending the parse tree until a coherent point for example the ` SH ' macro will close out any intervening ` SS ' scopes . When a scope is closed it must be validated and actioned .
static void
rew_scope(struct roff_man *man, int tok)
{
	struct roff_node *n;
	n = man->last;
	if (tok == MAN_RS && n->child == NULL &&
	    (n->tok == MAN_P || n->tok == MAN_PP || n->tok == MAN_LP))
		return;
	for (;;) {
		if (n->type == ROFFT_ROOT)
			return;
		if (n->flags & MAN_VALID) {
			n = n->parent;
			continue;
		}
		if (n->type != ROFFT_BLOCK) {
			if (n->parent->type == ROFFT_ROOT) {
				man_unscope(man, n);
				return;
			} else {
				n = n->parent;
				continue;
			}
		}
		if (tok != MAN_SH && (n->tok == MAN_SH ||
		    (tok != MAN_SS && (n->tok == MAN_SS ||
		     man_macros[n->tok].fp == blk_exp))))
			return;
		man_unscope(man, n);
		n = man->last;
	}
}
static void rew_scope ( struct roff_man * man , int tok ) { struct roff_node * n ; n = man -> last ; if ( tok == MAN_RS && n -> child == NULL && ( n -> tok == MAN_P || n -> tok == MAN_PP || n -> tok == MAN_LP ) ) return ; for ( ; ; ) { if ( n -> type == ROFFT_ROOT ) return ; if ( n -> flags & MAN_VALID ) { n = n -> parent ; continue ; } if ( n -> type != ROFFT_BLOCK ) { if ( n -> parent -> type == ROFFT_ROOT ) { man_unscope ( man , n ) ; return ; } else { n = n -> parent ; continue ; } } if ( tok != MAN_SH && ( n -> tok == MAN_SH || ( tok != MAN_SS && ( n -> tok == MAN_SS || man_macros [ n -> tok ] . fp == blk_exp ) ) ) ) return ; man_unscope ( man , n ) ; n = man -> last ; } }
Rewinding entails ascending the parse tree until a coherent point,
 for example, the `SH' macro will close out any intervening `SS'
 scopes.
Rewinding entails ascending the parse tree until a coherent point for example the ` SH ' macro will close out any intervening ` SS ' scopes .
/* Preserve empty paragraphs before RS. */