<commit_before>#include "cfl_parser.h"
#include "cfl_type.h"
#include "cfl_eval.h"

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

int main(int argc, char* argv[])
{
    cfl_node node;

    if(!cfl_parse_file(&node, "lol.cfl"))
        return 1;

    cfl_print_node(&node);

    printf("\n$$$$$$$$$$$$$$$$$$$$$$$$$$"
           "\n          TYPE            "
           "\n$$$$$$$$$$$$$$$$$$$$$$$$$$\n\n");

    cfl_type* type = cfl_typecheck(&node);

    if(!type)
    {
        cfl_delete_node(&node);

        printf("ERROR: Failed to typecheck\n");

        return 1;
    }

    cfl_print_type(type);

    cfl_free_type(type);<commit_msg>Take command line file arguments<commit_after>#include "cfl_parser.h"
#include "cfl_type.h"
#include "cfl_eval.h"

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

int main(int argc, char* argv[])
{
    char* file;

    if(argc > 1)
        file = argv[1];
    else
        file = "lol.cfl";

    cfl_node node;

    if(!cfl_parse_file(&node, file))
        return 1;

    cfl_print_node(&node);

    printf("\n$$$$$$$$$$$$$$$$$$$$$$$$$$"
           "\n          TYPE            "
           "\n$$$$$$$$$$$$$$$$$$$$$$$$$$\n\n");

    cfl_type* type = cfl_typecheck(&node);

    if(!type)
    {
        cfl_delete_node(&node);

        printf("ERROR: Failed to typecheck\n");

        return 1;
    }

    cfl_print_type(type);

    cfl_free_type(type);
{'fraction_non_alphanumeric': 0.21262699564586357, 'fraction_numerical': 0.0043541364296081275, 'mean_word_length': 2.388206388206388, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '5954113', 'n_tokens_mistral': 555, 'n_tokens_neox': 522, 'n_words': 90}