Skip to content

Commit c068f72

Browse files
committed
Recompile with latest Aniseed/Fennel
1 parent ffc6068 commit c068f72

File tree

10 files changed

+752
-665
lines changed

10 files changed

+752
-665
lines changed

lua/conjure/aniseed/compile.lua

+14-13
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ local function macros_prefix(code, opts)
2727
filename = _1_
2828
end
2929
end
30-
local _3_
31-
if filename then
32-
_3_ = ("\"" .. string.gsub(filename, "\\", "\\\\") .. "\"")
33-
else
34-
_3_ = "nil"
30+
local function _3_()
31+
if filename then
32+
return ("\"" .. string.gsub(filename, "\\", "\\\\") .. "\"")
33+
else
34+
return "nil"
35+
end
3536
end
36-
return ("(local *file* " .. _3_ .. ")" .. "(require-macros \"" .. macros_module .. "\")\n" .. (code or ""))
37+
return ("(local *file* " .. _3_() .. ")" .. "(require-macros \"" .. macros_module .. "\")\n" .. (code or ""))
3738
end
3839
_2amodule_2a["macros-prefix"] = macros_prefix
3940
local marker_prefix = "ANISEED_"
@@ -45,20 +46,20 @@ do end (_2amodule_locals_2a)["delete-marker-pat"] = delete_marker_pat
4546
local function str(code, opts)
4647
ANISEED_STATIC_MODULES = (true == a.get(opts, "static?"))
4748
local fnl = fennel.impl()
48-
local function _5_()
49+
local function _4_()
4950
return string.gsub(string.gsub(fnl.compileString(macros_prefix(code, opts), a["merge!"]({allowedGlobals = false, compilerEnv = _G}, opts)), (delete_marker_pat .. "\n"), "\n"), (delete_marker_pat .. "$"), "")
5051
end
51-
return xpcall(_5_, fnl.traceback)
52+
return xpcall(_4_, fnl.traceback)
5253
end
5354
_2amodule_2a["str"] = str
5455
local function file(src, dest, opts)
5556
local code = a.slurp(src)
56-
local _6_, _7_ = str(code, a["merge!"]({filename = src, ["static?"] = true}, opts))
57-
if ((_6_ == false) and (nil ~= _7_)) then
58-
local err = _7_
57+
local _5_, _6_ = str(code, a["merge!"]({filename = src, ["static?"] = true}, opts))
58+
if ((_5_ == false) and (nil ~= _6_)) then
59+
local err = _6_
5960
return nvim.err_writeln(err)
60-
elseif ((_6_ == true) and (nil ~= _7_)) then
61-
local result = _7_
61+
elseif ((_5_ == true) and (nil ~= _6_)) then
62+
local result = _6_
6263
fs.mkdirp(fs.basename(dest))
6364
return a.spit(dest, result)
6465
else

lua/conjure/aniseed/core.lua

+16-4
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,30 @@ local function rand(n)
1818
return (math.random() * (n or 1))
1919
end
2020
_2amodule_2a["rand"] = rand
21-
local function string_3f(x)
22-
return ("string" == type(x))
23-
end
24-
_2amodule_2a["string?"] = string_3f
2521
local function nil_3f(x)
2622
return (nil == x)
2723
end
2824
_2amodule_2a["nil?"] = nil_3f
25+
local function number_3f(x)
26+
return ("number" == type(x))
27+
end
28+
_2amodule_2a["number?"] = number_3f
29+
local function boolean_3f(x)
30+
return ("boolean" == type(x))
31+
end
32+
_2amodule_2a["boolean?"] = boolean_3f
33+
local function string_3f(x)
34+
return ("string" == type(x))
35+
end
36+
_2amodule_2a["string?"] = string_3f
2937
local function table_3f(x)
3038
return ("table" == type(x))
3139
end
3240
_2amodule_2a["table?"] = table_3f
41+
local function function_3f(value)
42+
return ("function" == type(value))
43+
end
44+
_2amodule_2a["function?"] = function_3f
3345
local function count(xs)
3446
if table_3f(xs) then
3547
return table.maxn(xs)

0 commit comments

Comments
 (0)