is there a seg fault?
Rule *parse_file(FILE *fp) {
    // Implement this function and remove the stubbed return statement below.

Rule *head = NULL;
Rule *target = NULL;

char line[MAXLINE];

while(fgets(line, MAXLINE, fp)){
    line[MAXLINE - 1] = '\0';
    int i = strlen(line) -1;

    while((isspace(line[i])!= 0) && (is_comment_or_empty(line) != 1)){
        line[i] = '\0';
        i = i - 1;
    }

    if (((is_comment_or_empty(line) != 1)) && (strlen(line)!= 0)){
        char * duplicate = strdup(line);
        char *token = strtok(line, " ");
        if (token[0] != '\r'){
            if (token[0] != '\t'){
                if (token[0] == ':'){
                    token = strtok(NULL, " "); // go to the next token
                    }
                else{
                    parse_rule(&head, &target, token); // add the target rule and dependency in a helper
            }
        }
        else{
            // action line as first char is a tab
            parse_action(&head, token, duplicate); // add the action line to the node
            
        }
    }
}
}
    return head;

}