aboutsummaryrefslogtreecommitdiff
path: root/tomo.c
diff options
context:
space:
mode:
Diffstat (limited to 'tomo.c')
-rw-r--r--tomo.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tomo.c b/tomo.c
index 8d95d45a..976c4b6b 100644
--- a/tomo.c
+++ b/tomo.c
@@ -14,6 +14,7 @@
#include "builtins/text.h"
#include "compile.h"
#include "parse.h"
+#include "repl.h"
#include "typecheck.h"
#include "types.h"
@@ -55,9 +56,6 @@ int main(int argc, char *argv[])
}
}
- if (filename == NULL)
- errx(1, "No file provided");
-
// register_printf_modifier(L"p");
if (register_printf_specifier('T', printf_type, printf_pointer_size))
errx(1, "Couldn't set printf specifier");
@@ -70,6 +68,11 @@ int main(int argc, char *argv[])
verbose = (getenv("VERBOSE") && strcmp(getenv("VERBOSE"), "1") == 0);
+ if (filename == NULL) {
+ repl();
+ return 0;
+ }
+
cconfig = getenv("CCONFIG");
if (!cconfig)
cconfig = "-std=c11 -fdollars-in-identifiers -fsanitize=signed-integer-overflow -fno-sanitize-recover -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE";