- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlispcode.lua
More file actions
Latest commit
29 lines (22 loc) · 611 Bytes
/
Copy pathlispcode.lua
File metadata and controls
29 lines (22 loc) · 611 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require"import"
LispParser=import"parser"
LispSexp=import"Sexp"
LispExecutor=import"executor"
LispFunctions=import"functions"
localfunctionpkg_init(Lisp)
Lisp.code=function(str)
localnewenv= {}
setmetatable(newenv, {__index=LispFunctions})
localparser=LispParser.parse(LispParser.stringstream(str))
localparsed,cont=parser()
localresult
whilecontdo
result=LispExecutor.exec(parsed, newenv)
parsed,cont=parser()
end
returnresult
end
Lisp.RunFile=LispFunctions["run-file"]
Lisp.require=LispFunctions["require-lisp"]
end
returnpkg_init