ain't afraid of no sleep,

This commit is contained in:
Yessiest 2022-05-20 22:20:49 +04:00
parent 38c9e580b9
commit ca17b716ba
9 changed files with 481 additions and 481 deletions

View File

@ -2,7 +2,7 @@
--That is, unability to load core modules from the files that were required --That is, unability to load core modules from the files that were required
return function(reqfunc) return function(reqfunc)
local function import(path) local function import(path)
local paths = { } local paths = {}
package.path:gsub("[^;]+",function(path) package.path:gsub("[^;]+",function(path)
table.insert(paths,path) table.insert(paths,path)
end) end)
@ -23,14 +23,14 @@ return function(reqfunc)
return reqfunc(path) return reqfunc(path)
else else
content = file:read("*a") content = file:read("*a")
local func,err = load(content,"import: "..filename,nil,setmetatable({ local f,err = load(content,"import: "..filename,nil,setmetatable({
require = reqfunc, require = reqfunc,
import = import, import = import,
},{__index = _G})) },{__index = _G}))
if err then if err then
error(err) error("[import: "..filname.."] "..tostring(err))
end end
return func() return f()
end end
end end
return import return import

@ -1 +1 @@
Subproject commit 9e6f09050f9ebecc4ffcea1234b920468254a79b Subproject commit 23fcea17c2eb380b6a6b1ba848d5bc7ebdc38b05

View File

@ -51,7 +51,7 @@ end
function markov.walk(self,start) function markov.walk(self,start)
if not self.init then if not self.init then
error("Attempted to use an instance method on an uninitialized instance") error("Attempted to use method on uninitialized instances")
end end
local random = math.random(0,1e7)/1e7 local random = math.random(0,1e7)/1e7
local words = {} local words = {}
@ -76,7 +76,7 @@ end
function markov.expand_vocabulary(self,source) function markov.expand_vocabulary(self,source)
if not self.init then if not self.init then
error("Attempted to use an instance method on an uninitialized instance") error("Attempted to use method on uninitialized instances")
end end
self.net = register_words(source,self.net) self.net = register_words(source,self.net)
end end