<commit_before>#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "cfg_tokenizer.h"


struct Result {
    enum Token type;
    char *value;
};

struct Test {
    char *config;
    struct Result *results;
    int len;
};

static char config1[] = "# Comment\n"
                 "numbers {\n"
                 "   one\n"
                 "   two\n"
                 "   three\n"
                 "}";
static struct Result results1[] = {
    { TOKEN_EOL, NULL },
    { TOKEN_WORD, "numbers" },
    { TOKEN_OBRACE, NULL },
    { TOKEN_EOL, NULL },
    { TOKEN_WORD, "one" },
    { TOKEN_EOL, NULL },
    { TOKEN_WORD, "two" },
    { TOKEN_EOL, NULL },
    { TOKEN_WORD, "three" },
    { TOKEN_EOL, NULL },
    { TOKEN_CBRACE, NULL },
    { TOKEN_END, NULL },
};

static struct Test tests[] = {
    { config1, results1, sizeof(results1) / sizeof(struct Result) },
    { NULL, NULL, 0 } /* End of tests */
};

int main() {
    FILE *cfg;
    char buffer[256];<commit_msg>Test config tokenizer quoting and escape mechanisms<commit_after>#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "cfg_tokenizer.h"


struct Result {
    enum Token type;
    char *value;
};

struct Test {
    char *config;
    struct Result *results;
    int len;
};

static char config1[] = "# Comment\n"
                 "numbers {\n"
                 "   one\n"
                 "   two\n"
                 "   three\n"
                 "   \"[0-9a-z-]+\\.edu\"\n"
                 "}";
static struct Result results1[] = {
    { TOKEN_EOL, NULL },
    { TOKEN_WORD, "numbers" },
    { TOKEN_OBRACE, NULL },
    { TOKEN_EOL, NULL },
    { TOKEN_WORD, "one" },
    { TOKEN_EOL, NULL },
    { TOKEN_WORD, "two" },
    { TOKEN_EOL, NULL },
    { TOKEN_WORD, "three" },
    { TOKEN_EOL, NULL },
    { TOKEN_WORD, "[0-9a-z-]+.edu" },
    { TOKEN_EOL, NULL },
    { TOKEN_CBRACE, NULL },
    { TOKEN_END, NULL },
};

static struct Test tests[] = {
    { config1, results1, sizeof(results1) / sizeof(struct Result) },
    { NULL, NULL, 0 } /* End of tests */
};

int main() {
    FILE *cfg;
    char buffer[256];
{'fraction_non_alphanumeric': 0.15891840607210625, 'fraction_numerical': 0.010436432637571158, 'mean_word_length': 2.0085592011412268, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4197535', 'n_tokens_mistral': 798, 'n_tokens_neox': 754, 'n_words': 174}