From 79d073d7b3ae2f508f0d2e154ed59f87530740e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 29 Nov 2018 09:56:54 +0800 Subject: =?UTF-8?q?=E6=8D=A2=E6=88=90=E6=96=B0=E7=9A=84parser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/test/definition/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server/test/definition') diff --git a/server/test/definition/init.lua b/server/test/definition/init.lua index b88cfeef..8bf2411d 100644 --- a/server/test/definition/init.lua +++ b/server/test/definition/init.lua @@ -1,4 +1,5 @@ local matcher = require 'matcher' +local parser = require 'parser' rawset(_G, 'TEST', true) @@ -7,8 +8,10 @@ function TEST(script) local finish = script:find('!>', 1, true) - 1 local pos = script:find('', ' ') + local ast, err = parser:ast(new_script) + assert(ast) - local suc, a, b = matcher.definition(new_script, pos) + local suc, a, b = matcher.definition(ast, pos) assert(suc) assert(a == start) assert(b == finish) -- cgit v1.2.3