mirror of
https://github.com/Oreolek/ink-instead.git
synced 2024-05-12 22:18:26 +03:00
22 lines
456 B
Lua
22 lines
456 B
Lua
local folderOfThisFile = (...):match("(.-)[^%.]+$")
|
|
local parser = require(folderOfThisFile .. 'parser')
|
|
local runtime = require(folderOfThisFile .. 'runtime')
|
|
|
|
|
|
local function read(file)
|
|
local f = io.open(file, "rb")
|
|
if not f then error('failed to open "'..file..'"') end
|
|
local content = f:read("*all")
|
|
f:close()
|
|
return content
|
|
end
|
|
|
|
|
|
return {
|
|
getStory = function (filename)
|
|
return runtime(parser:match(read(filename)))
|
|
end
|
|
|
|
|
|
}
|