1
0
Fork 0
mirror of https://github.com/Reuh/candran.git synced 2025-10-27 09:59:29 +00:00

Fix can handling of --import

This commit is contained in:
Étienne Fildadut 2021-06-18 15:30:23 +02:00
parent 56f1901f9b
commit 7b0563b9dc

View file

@ -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