From ad51b208b4924d04f1d6a804178a67994b4f9e59 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 22 Aug 2024 14:02:48 -0400 Subject: Overhaul of import syntax. Now everything uses `use`: `use foo`, `use ./foo.tm`, `use `, `use libfoo.so` --- repl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'repl.c') diff --git a/repl.c b/repl.c index 111aff1d..8ac4c7d5 100644 --- a/repl.c +++ b/repl.c @@ -9,6 +9,7 @@ #include #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); -- cgit v1.2.3