-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.luau
More file actions
38 lines (30 loc) · 947 Bytes
/
init.luau
File metadata and controls
38 lines (30 loc) · 947 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
30
31
32
33
34
35
36
37
38
local Lexer = require(script.Lexer)
local Parser = require(script.Parser)
local Lowerer = require(script.Lowerer)
local VM = require(script.VM)
local Serialiser = require(script.Serialiser)
local Sandbox = require(script.Sandbox)
local Splice = {}
function Splice.Compile(Source: string): any
local Tokens = Lexer.Tokenize(Source)
local AST = Parser.Parse(Tokens)
local Proto = Lowerer.Compile(AST)
return Proto
end
function Splice.Serialise(Proto: any): buffer
return Serialiser.Serialise(Proto)
end
function Splice.Deserialise(Buf: buffer): any
return Serialiser.Deserialise(Buf)
end
function Splice.CreateEnv(Config: Sandbox.SandboxConfig?): { [string]: any }
return Sandbox.CreateEnv(Config)
end
function Splice.Execute(Proto: any, Env: any?): ...any
return VM.Execute(Proto, Env)
end
function Splice.Run(Source: string, Env: any?): ...any
local Proto = Splice.Compile(Source)
return VM.Execute(Proto, Env)
end
return Splice