From f745470abe60628aff3c8784d72eea1aed525383 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sat, 24 Sep 2022 06:41:09 +0100 Subject: [PATCH] Resolved #31, added exit and quit commands to the repl --- repl/repl_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/repl/repl_main.c b/repl/repl_main.c index ee88603..73a183e 100644 --- a/repl/repl_main.c +++ b/repl/repl_main.c @@ -158,6 +158,11 @@ void repl() { printf("> "); fgets(input, size, stdin); + //escape the repl (length of 5 to accomodate the newline) + if (strlen(input) == 5 && (!strncmp(input, "exit", 4) || !strncmp(input, "quit", 4))) { + break; + } + //setup this iteration Lexer lexer; Parser parser;