mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Resolved #31, added exit and quit commands to the repl
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user