mirror of
https://github.com/Reuh/candran.git
synced 2025-10-27 17:59:30 +00:00
Fix can handling of --import
This commit is contained in:
parent
56f1901f9b
commit
7b0563b9dc
1 changed files with 4 additions and 2 deletions
6
bin/can
6
bin/can
|
|
@ -118,18 +118,20 @@ else
|
||||||
print("Candran " .. candran.VERSION .. ", targeting " .. candran.default.target)
|
print("Candran " .. candran.VERSION .. ", targeting " .. candran.default.target)
|
||||||
candran.setup()
|
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
|
do
|
||||||
local r, e = candran.load("local _", "stdin")
|
local r, e = candran.load("local _", "stdin")
|
||||||
if not r then
|
if not r then
|
||||||
print("In static import: "..e)
|
print("In static import: "..e)
|
||||||
|
candran.default.import = {}
|
||||||
else
|
else
|
||||||
r, e = pcall(r)
|
r, e = pcall(r)
|
||||||
if not r then
|
if not r then
|
||||||
print("In static import: "..e)
|
print("In static import: "..e)
|
||||||
|
candran.default.import = {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
candran.default.import = {}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- REPL loop
|
-- REPL loop
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue