From 7b0563b9dce20dc1a915bd201551d5cb6cbb3180 Mon Sep 17 00:00:00 2001 From: Reuh Date: Fri, 18 Jun 2021 15:30:23 +0200 Subject: [PATCH] Fix can handling of --import --- bin/can | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/can b/bin/can index 8a0fc97..6b62a3f 100644 --- a/bin/can +++ b/bin/can @@ -118,18 +118,20 @@ else print("Candran " .. candran.VERSION .. ", targeting " .. candran.default.target) candran.setup() - -- only perform static imports once, on startup + -- check errors in static import + -- note: static imports will be run every line, as preprocessors macros and constants aren't kept between compilations... do local r, e = candran.load("local _", "stdin") if not r then print("In static import: "..e) + candran.default.import = {} else r, e = pcall(r) if not r then print("In static import: "..e) + candran.default.import = {} end end - candran.default.import = {} end -- REPL loop