<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <readline/readline.h>

#include "types.h"
#include "parser.h"

char *READ(char prompt[]) {
    char *line;
    line = readline(prompt);
    if (!line) return NULL; // EOF
    add_history(line); // Add input to history.
    return line;
}

char *EVAL(char *ast, void *env) {
    return ast;
}

char *PRINT(char *exp) {
    return exp;
}


int
main (void)
{
    Expr * head[100];

    char *ast, *exp;
    char prompt[100];
    char * tokens[100];

    // Set the initial prompt
    snprintf(prompt, sizeof(prompt), "> ");
    head[0] = (Expr *)malloc(sizeof(Expr));

    for(;;){
        ast = READ(prompt);
        if (!ast) {return 0;}
        else{
            tokenize(ast,tokens);
            exp = EVAL(ast, NULL);
            if (strcmp(exp, "show")){
                int i;
                for (i = 0;i < 100;i++){
                    if (tokens[i] != NULL){
                        printf("%s.",tokens[i]);
                    }else{
                        break;
                    }
                    printf("\n");
                }
            }else{
                puts(PRINT(exp));
            }
            freeTokenize(tokens);
        }
        free(ast); // Free input string
    }
    free(head[0]);
}
<commit_msg>いい感じにした<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <readline/readline.h>

#include "types.h"
#include "parser.h"

char *READ(char prompt[]) {
    char *line;
    line = readline(prompt);
    if (!line) return NULL; // EOF
    add_history(line); // Add input to history.
    return line;
}

char *EVAL(char *ast, void *env) {
    return ast;
}

char *PRINT(char *exp) {
    return exp;
}


int
main (void)
{
    Expr * head[100];

    char *ast, *exp;
    char prompt[100];
    char * tokens[100];

    // Set the initial prompt
    snprintf(prompt, sizeof(prompt), "> ");
    head[0] = (Expr *)malloc(sizeof(Expr));

    for(;;){
        ast = READ(prompt);
        if (!ast) {return 0;}
        else{
            tokenize(ast,tokens);
            exp = EVAL(ast, NULL);
            if (strcmp(exp, "show")){
                int i;
                for (i = 0;i < 100;i++){
                    if (tokens[i] != NULL){
                        printf("%s",tokens[i]);
                    }else{
                        break;
                    }
                    printf("\n");
                }
            }else{
                puts(PRINT(exp));
            }
            freeTokenize(tokens);
        }
        free(ast); // Free input string
    }
    free(head[0]);
}

{'fraction_non_alphanumeric': 0.15675271230826787, 'fraction_numerical': 0.011971567527123082, 'mean_word_length': 1.5226415094339623, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2568928', 'n_tokens_mistral': 911, 'n_tokens_neox': 847, 'n_words': 204}