summaryrefslogtreecommitdiff
path: root/server-beta/src/brave
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/brave')
-rw-r--r--server-beta/src/brave/init.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/server-beta/src/brave/init.lua b/server-beta/src/brave/init.lua
index 39b66bac..aac92a38 100644
--- a/server-beta/src/brave/init.lua
+++ b/server-beta/src/brave/init.lua
@@ -1,5 +1,6 @@
local brave = require 'brave.brave'
local jsonrpc = require 'jsonrpc'
+local parser = require 'parser'
brave.on('loadProto', function ()
while true do
@@ -10,4 +11,16 @@ brave.on('loadProto', function ()
end
end)
+brave.on('compile', function (text)
+ local state, err = parser:compile(text, 'lua', 'Lua 5.4')
+ if not state then
+ log.debug(err)
+ return
+ end
+ return {
+ root = state.root,
+ errs = state.errs,
+ }
+end)
+
return brave