aboutsummaryrefslogtreecommitdiff
path: root/tomo.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-30 12:14:24 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-03-30 12:14:24 -0400
commit838c9963fc2216e827ceed80fc352d1d16ea30f9 (patch)
tree82eed3eb921ae36ba745122ed6b182d8b92ec329 /tomo.c
parent04d9adc8138566eec5d6bf7b233a6c617306bcce (diff)
Adding a REPL
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";