<commit_before>#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#include "parse.h"

Rule* parse_rule(FILE* file);
Condition* parse_conditions(FILE* file);
Condition* parse_condition(char* line, Condition* previous);
int condition_depth(Condition* condition);

Node* parse_node(char* line, Node* previous);
int node_depth(Node* node);

void error(char* message, char* line);
char* node_type_for(char** line_position, char* current_line);

char* get_line(FILE* file);
bool is_blank(char* line);

Rule* parse_rules(FILE* file) {
  Rule* first = parse_rule(file);
  if (!first)
    error("At least one rule must be specified", "");

  Rule* current = first;

  while (current->next = parse_rule(file))
    current = current->next;

  current->next = NULL;

  return first;
}
<commit_msg>the NULL tail is already set by the loop<commit_after>#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#include "parse.h"

Rule* parse_rule(FILE* file);
Condition* parse_conditions(FILE* file);
Condition* parse_condition(char* line, Condition* previous);
int condition_depth(Condition* condition);

Node* parse_node(char* line, Node* previous);
int node_depth(Node* node);

void error(char* message, char* line);
char* node_type_for(char** line_position, char* current_line);

char* get_line(FILE* file);
bool is_blank(char* line);

Rule* parse_rules(FILE* file) {
  Rule* first = parse_rule(file);
  if (!first)
    error("At least one rule must be specified", "");

  Rule* current = first;

  while (current->next = parse_rule(file))
    current = current->next;

  return first;
}

{'fraction_non_alphanumeric': 0.1421383647798742, 'fraction_numerical': 0.0, 'mean_word_length': 5.684873949579832, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1702429', 'n_tokens_mistral': 532, 'n_tokens_neox': 522, 'n_words': 152}