From: Elijah Cohen Date: Wed, 14 Aug 2024 05:16:30 +0000 (-0500) Subject: swapped linenoise for editline X-Git-Url: https://git.eli173.com/?a=commitdiff_plain;h=a84faa65714b4d93bd95cfe6beba8667b9e9f971;p=klapaucius swapped linenoise for editline --- diff --git a/src/repl.c b/src/repl.c index eec6619..a7f907e 100644 --- a/src/repl.c +++ b/src/repl.c @@ -1,9 +1,10 @@ #include +#include #include -#include "linenoise.h" +#include #include "types.h" #include "eval.h" @@ -14,6 +15,7 @@ + int main(int argc, char** argv) { Sexpr* env = init_dict(); @@ -21,10 +23,10 @@ int main(int argc, char** argv) { // now do the loop, right? char* input = NULL; while(1) { - input = linenoise("> "); + input = readline("> "); if(input == NULL) return 0; - linenoiseHistoryAdd(input); + add_history(input); Sexpr* in = parse(input); if(in == NULL) { printf("bad input\n"); @@ -34,7 +36,7 @@ int main(int argc, char** argv) { Sexpr* out = eval(car(in), env); printf(" - %s\n", sprint_sexpr(out)); } - linenoiseFree(input); + free(input); } return 0; }