From f48e1bf5c9b7e491072c116193ef17bf68235135 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Tue, 29 Mar 2022 22:51:13 -0400 Subject: [PATCH] REPL defers to sh when a symbol isn't found. --- src/pebblisp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pebblisp.c b/src/pebblisp.c index 29ea9dd..5f9d220 100644 --- a/src/pebblisp.c +++ b/src/pebblisp.c @@ -618,10 +618,16 @@ void repl(struct Environment* env) free(oldBuf); } Object o = parseEval(buf, env); + if (isError(o, DID_NOT_FIND_SYMBOL)) { + cleanObject(&o); + system(buf); + free(buf); + continue; + } free(buf); size_t length; - char *output = stringObj(&o, &length); + char* output = stringObj(&o, &length); cleanObject(&o); printColored(output); free(output);