finish the elimination of MD_PushSibling

This commit is contained in:
Allen Webster
2021-06-28 06:44:06 -04:00
parent 9a93a40135
commit 0d57e26ba5
8 changed files with 75 additions and 37 deletions
+4 -6
View File
@@ -5,20 +5,18 @@
int main(int argument_count, char **arguments)
{
// TODO(allen): use list system
// NOTE(rjf): Parse all the files passed in via command line.
MD_Node *first = MD_NilNode();
MD_Node *last = MD_NilNode();
MD_Node *list = MD_MakeList();
for(int i = 1; i < argument_count; i += 1)
{
MD_Node *root = MD_ParseWholeFile(MD_S8CString(arguments[i])).node;
MD_PushSibling(&first, &last, root);
MD_PushReference(list, root);
}
// NOTE(rjf): Print errors on every single node.
for(MD_EachNode(root, first))
for(MD_EachNode(ref, list->first_child))
{
MD_Node *root = MD_Deref(ref);
for(MD_EachNode(node, root->first_child))
{
MD_NodeMessageF(stderr, node, MD_MessageKind_Error, "This node has an error!");