1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-27 16:49:31 +00:00

Add stdlib functions from anselme v1

This commit is contained in:
Étienne Fildadut 2024-01-04 20:22:18 +01:00
parent 581c60048d
commit dac5b74fa6
30 changed files with 272 additions and 14 deletions

View file

@ -77,7 +77,6 @@ local function run(path, interactive)
local state = anselme:new()
state:load_stdlib()
state:define("error", "(message=\"error\")", function(message) error(message, 0) end)
state:define("interrupt", "(code::string)", function(state, code) state:interrupt(code:to_lua(state), "interrupt") return ast.Nil:new() end, true)
state:define("interrupt", "()", function(state) state:interrupt() return ast.Nil:new() end, true)
state:define("wait", "(duration::number)", function(duration) coroutine.yield("wait", duration) end)