From 68882d05a393a2a435faba6ec98ef75b15661b75 Mon Sep 17 00:00:00 2001 From: Garritt McCune Date: Mon, 7 Feb 2022 19:53:29 +0000 Subject: [PATCH] Added an interactive shell, well the start of one. --- lox.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lox.c b/lox.c index 2c21d5b..071dbeb 100644 --- a/lox.c +++ b/lox.c @@ -49,5 +49,14 @@ char* GetFileContents(const char* path) { } void RunPrompt(void) { - printf("> \n"); + printf("> "); + char input[256]; + + while(fgets(input, sizeof input, stdin) != NULL) { + if (strcmp(input, "q\n") == 0) break; + + printf("E_NOT_IMPLEMENTED\n"); + + printf("> "); + } } \ No newline at end of file