FreeBSD/contrib/mdocml/eqn.c
/*
 * Reparent the current last node (of the current parent) under a new
 * EQN_SUBEXPR as the first element.
 * Then return the new parent.
 * The new EQN_SUBEXPR will have a two-child limit.
 */
Reparent the current last node (of the current parent) under a new
EQN_SUBEXPR as the first element.
Then return the new parent.
The new EQN_SUBEXPR will have a two-child limit.
Reparent the current last node ( of the current parent ) under a new EQN_SUBEXPR as the first element . Then return the new parent . The new EQN_SUBEXPR will have a two - child limit .
static struct eqn_box *
eqn_box_makebinary(struct eqn_node *ep,
	enum eqn_post pos, struct eqn_box *parent)
{
	struct eqn_box	*b, *newb;
	assert(NULL != parent->last);
	b = parent->last;
	if (parent->last == parent->first)
		parent->first = NULL;
	parent->args--;
	parent->last = b->prev;
	b->prev = NULL;
	newb = eqn_box_alloc(ep, parent);
	newb->pos = pos;
	newb->type = EQN_SUBEXPR;
	newb->expectargs = 2;
	newb->args = 1;
	newb->first = newb->last = b;
	newb->first->next = NULL;
	b->parent = newb;
	return newb;
}
static struct eqn_box * eqn_box_makebinary ( struct eqn_node * ep , enum eqn_post pos , struct eqn_box * parent ) { struct eqn_box * b , * newb ; assert ( NULL != parent -> last ) ; b = parent -> last ; if ( parent -> last == parent -> first ) parent -> first = NULL ; parent -> args -- ; parent -> last = b -> prev ; b -> prev = NULL ; newb = eqn_box_alloc ( ep , parent ) ; newb -> pos = pos ; newb -> type = EQN_SUBEXPR ; newb -> expectargs = 2 ; newb -> args = 1 ; newb -> first = newb -> last = b ; newb -> first -> next = NULL ; b -> parent = newb ; return newb ; }
Reparent the current last node (of the current parent) under a new
 EQN_SUBEXPR as the first element.
Reparent the current last node ( of the current parent ) under a new EQN_SUBEXPR as the first element .