diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-08-22 14:02:48 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-08-22 14:02:48 -0400 |
| commit | ad51b208b4924d04f1d6a804178a67994b4f9e59 (patch) | |
| tree | 9ae29e0af02b7406a0cf07fdd8b0dd7fdac0aedf /repl.c | |
| parent | 2055439be4f5053b9a4d631cefd8bb7c83a8e4e3 (diff) | |
Overhaul of import syntax. Now everything uses `use`: `use foo`, `use
./foo.tm`, `use <foo.h>`, `use libfoo.so`
Diffstat (limited to 'repl.c')
| -rw-r--r-- | repl.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -9,6 +9,7 @@ #include <unistd.h> #include "builtins/tomo.h" +#include "builtins/util.h" #include "typecheck.h" #include "parse.h" @@ -46,9 +47,8 @@ void repl(void) while ((len=getline(&line, &buf_size, stdin)) >= 0) { if (len > 1) { char *code = line; -#define starts_with(line, prefix) (strncmp(line, prefix " ", strlen(prefix)+1) == 0) - if (starts_with(line, "if") || starts_with(line, "for") || starts_with(line, "while") - || starts_with(line, "func") || starts_with(line, "struct") || starts_with(line, "lang")) { + if (starts_with(line, "if ") || starts_with(line, "for ") || starts_with(line, "while ") + || starts_with(line, "func ") || starts_with(line, "struct ") || starts_with(line, "lang ")) { printf("\x1b[33;1m..\x1b[m "); fflush(stdout); code = GC_strdup(line); |
