aboutsummaryrefslogtreecommitdiffstats
path: root/src/bootstrap/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bootstrap/main.c')
-rwxr-xr-xsrc/bootstrap/main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/bootstrap/main.c b/src/bootstrap/main.c
index b5fd821..662831e 100755
--- a/src/bootstrap/main.c
+++ b/src/bootstrap/main.c
@@ -4,6 +4,7 @@
4#include <stdlib.h> 4#include <stdlib.h>
5 5
6#include "string_view.c" 6#include "string_view.c"
7#include "read_line.c"
7 8
8void 9void
9process_source(const StringView *source) { 10process_source(const StringView *source) {
@@ -14,11 +15,17 @@ process_source(const StringView *source) {
14 15
15void 16void
16run_repl(void) { 17run_repl(void) {
17 printf("BDL REPL (Press Ctrl-C to exit)\n"); 18 printf("BDL REPL (Press Ctrl-D or Ctrl-C to exit)\n");
18 while (true) { 19 while (true) {
19 printf(REPL_PROMPT); 20 printf(REPL_PROMPT);
20 getchar(); 21 StringView sv = read_line();
21 process_source(NULL); 22 if (sv.start == NULL) {
23 return;
24 }
25 process_source(&sv);
26 if (sv.n != 0) {
27 printf("\n");
28 }
22 } 29 }
23} 30}
24 31