Resolved #31, added exit and quit commands to the repl

This commit is contained in:
2022-09-24 06:41:09 +01:00
parent 04771b1f81
commit f745470abe

View File

@@ -158,6 +158,11 @@ void repl() {
printf("> "); printf("> ");
fgets(input, size, stdin); 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 //setup this iteration
Lexer lexer; Lexer lexer;
Parser parser; Parser parser;