Ejemplo n.º 1
0
void asCScriptNode::AddChildLast(asCScriptNode *node)
{
	if( lastChild )
	{
		lastChild->next = node;
		node->next      = 0;
		node->prev      = lastChild;
		node->parent    = this;
		lastChild       = node;
	}
	else
	{
		firstChild   = node;
		lastChild    = node;
		node->next   = 0;
		node->prev   = 0;
		node->parent = this;
	}

	UpdateSourcePos(node->tokenPos, node->tokenLength);
}
Ejemplo n.º 2
0
void asCScriptNode::AddChildLast(asCScriptNode *node)
{
	// We might get a null pointer if the parser encounter an out-of-memory situation
	if( node == 0 ) return;

	if( lastChild )
	{
		lastChild->next = node;
		node->next      = 0;
		node->prev      = lastChild;
		node->parent    = this;
		lastChild       = node;
	}
	else
	{
		firstChild   = node;
		lastChild    = node;
		node->next   = 0;
		node->prev   = 0;
		node->parent = this;
	}

	UpdateSourcePos(node->tokenPos, node->tokenLength);
}