Added return of node_init
This commit is contained in:
@@ -73,8 +73,8 @@ print_syntax_tree ( void )
|
||||
//tree_print(root, 0);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
// Changed so it returns the pointer to the new node, can be used as before, but makes the parser file cleaner
|
||||
node_t*
|
||||
node_init (node_t *nd, node_index_t type, void *data, uint64_t n_children, ...)
|
||||
{
|
||||
va_list child_list;
|
||||
@@ -89,6 +89,8 @@ node_init (node_t *nd, node_index_t type, void *data, uint64_t n_children, ...)
|
||||
for ( uint64_t i=0; i<n_children; i++ )
|
||||
nd->children[i] = va_arg ( child_list, node_t * );
|
||||
va_end ( child_list );
|
||||
|
||||
return nd;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user