mirror of
https://github.com/Adorable-Catgirl/LuaComp.git
synced 2025-04-12 22:58:18 +10:00
Cross-platform(?) file existence check.
This commit is contained in:
parent
832798a3a5
commit
20aa15556a
@ -1,8 +1,8 @@
|
|||||||
function directives.include(env, file)
|
function directives.include(env, file)
|
||||||
if (not os.execute("stat "..file..">/dev/null")) then
|
local f = io.open(file, "r")
|
||||||
|
if f == nil then
|
||||||
return false, "File `"..file.."' does not exist!"
|
return false, "File `"..file.."' does not exist!"
|
||||||
end
|
end
|
||||||
local f = io.open(file, "r")
|
|
||||||
local fast = mkast(f, file)
|
local fast = mkast(f, file)
|
||||||
fast.file = file
|
fast.file = file
|
||||||
local code = generate(fast)
|
local code = generate(fast)
|
||||||
|
Loading…
Reference in New Issue
Block a user