mirror of
https://github.com/Reuh/candran.git
synced 2025-10-28 02:09:30 +00:00
Candran 0.3.0
* Added @ self alias * Added short anonymous functions declaration * Made assignment operators works in every direction, except up, down, behind and below, because this would be hard to visualize. * Moved files around. * Error rewriting. * Discover the amazing can commandline tool, which includes a fantastic° REPL and program running abilities. * Added functions which plagiarize Lua. * Added 0.1.0 to the version number. * If you still love pineapple flavored bread, don't hesitate to show your feelings. Also, the tests are out of date. Sad. °: not really.
This commit is contained in:
parent
2a1e293aa5
commit
4af2b41a0d
17 changed files with 2413 additions and 1865 deletions
26
util.can
26
util.can
|
|
@ -1,26 +0,0 @@
|
|||
local util = {}
|
||||
|
||||
function util.search(modpath, exts={"can", "lua"})
|
||||
for _, ext in ipairs(exts) do
|
||||
for path in package.path:gmatch("[^;]+") do
|
||||
local fpath = path:gsub("%.lua", "."..ext):gsub("%?", (modpath:gsub("%.", "/")))
|
||||
local f = io.open(fpath)
|
||||
if f then
|
||||
f:close()
|
||||
return fpath
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function util.loadenv(str, name, env)
|
||||
if _VERSION == "Lua 5.1" then
|
||||
local fn, err = loadstring(str, name)
|
||||
if not fn then return fn, err end
|
||||
return env ~= nil and setfenv(fn, env) or fn
|
||||
else
|
||||
return load(str, name, nil, env)
|
||||
end
|
||||
end
|
||||
|
||||
return util
|
||||
Loading…
Add table
Add a link
Reference in a new issue