fix it according to docstrings
/* Read from the open file fp, and create the linked data structure
   that represents the Makefile contained in the file.
   See the top of pmake.h for the specification of Makefile contents.
 */
Rule *parse_file(FILE *fp) {
    // printf("%d", find_num_words("ian is a lil bitch"));
    char line[MAXLINE];
    //todo: check malloc return values
    Rule *head = malloc(sizeof(Rule));
    Rule *curr_rule = head;

    while (fgets(line, MAXLINE, fp) != NULL) {
        line[strcspn(line, "\n")] = '\0';

        if (is_comment_or_empty(line) == 0 && line[0] != '\n') { // target line or action line
            printf("\"%s\"\n", line);
            if (line[0] != '\t') { // target line
                printf("wtf\n");
                char *token = strtok(line, "\r \n"); // first word in line
                strcpy(curr_rule->target, token); 
                strcat(curr_rule->target, "\0"); // check

                //fill dependencies
                token = strtok(NULL, ": "); // obtain first dependency, if it exists
                //TODO: cleanup code
                if (token) { 
                    Dependency *curr_dep = malloc(sizeof(Dependency));
                    curr_rule->dependencies = curr_dep;
                    token = strtok(NULL, " ");
                    while (token) { 
                        curr_dep->next_dep = malloc(sizeof(Dependency));
                        curr_dep = curr_dep->next_dep;
                        token = strtok(NULL, " ");
                    }
                    curr_dep->next_dep = NULL; // terminate when none left
                } else {
                    curr_rule->dependencies = NULL; 
                }
                curr_rule->actions = NULL; 
            
            } 
            
            curr_rule->next_rule = NULL;
            curr_rule = curr_rule->next_rule;
            
        }
        
    }


    return head;
}