1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-28 17:19:31 +00:00

Move anselme code into its own directory

This commit is contained in:
Étienne Fildadut 2023-12-29 18:41:06 +01:00
parent 404e7dd56e
commit 5dd971ff8f
179 changed files with 603 additions and 579 deletions

View file

@ -1,37 +0,0 @@
local parser = require("parser")
local function define_lua(state, list)
for _, fn in ipairs(list) do
state.scope:define_lua(fn[1], fn[2], fn[3], true)
end
end
local function load(state, l)
for _, m in ipairs(l) do
define_lua(state, require("stdlib."..m))
end
end
return function(main_state)
load(main_state, {
"boolean",
"tag",
"conditionals",
"base",
"type_check"
})
local f = assert(io.open("stdlib/boot.ans"))
local boot = parser(f:read("*a"), "boot.ans")
f:close()
boot:eval(main_state)
load(main_state, {
"number",
"string",
"text",
"structures",
"closure",
"checkpoint",
"persist",
})
end