mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 09:09:31 +00:00
Move anselme code into its own directory
This commit is contained in:
parent
404e7dd56e
commit
5dd971ff8f
179 changed files with 603 additions and 579 deletions
35
anselme/stdlib/init.lua
Normal file
35
anselme/stdlib/init.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
local parser = require("anselme.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("anselme.stdlib."..m))
|
||||
end
|
||||
end
|
||||
|
||||
return function(main_state)
|
||||
load(main_state, {
|
||||
"boolean",
|
||||
"tag",
|
||||
"conditionals",
|
||||
"base",
|
||||
"type_check"
|
||||
})
|
||||
|
||||
local boot = parser(require("anselme.stdlib.boot_script"), "boot.ans")
|
||||
boot:eval(main_state)
|
||||
|
||||
load(main_state, {
|
||||
"number",
|
||||
"string",
|
||||
"text",
|
||||
"structures",
|
||||
"closure",
|
||||
"checkpoint",
|
||||
"persist",
|
||||
})
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue