From 696fae86c9175cfc1b210c964b8efda85ed6421f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 19 Oct 2019 15:18:43 +0800 Subject: =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/test/definition/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'server-beta/test/definition/init.lua') diff --git a/server-beta/test/definition/init.lua b/server-beta/test/definition/init.lua index cc8c584b..f5a663cf 100644 --- a/server-beta/test/definition/init.lua +++ b/server-beta/test/definition/init.lua @@ -1,4 +1,5 @@ local core = require 'core.definition' +local engineer = require 'core.engineer' local parser = require 'parser' rawset(_G, 'TEST', true) @@ -41,8 +42,12 @@ function TEST(script) local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ') local ast = parser:compile(new_script, 'lua', 'Lua 5.3') assert(ast) + local file = { + ast = ast, + searcher = engineer(ast), + } - local results = core(ast, new_script, pos) + local results = core(file, pos) if results then local positions = {} for i, result in ipairs(results) do -- cgit v1.2.3