summaryrefslogtreecommitdiff
path: root/server/test/implementation/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-11-29 09:56:54 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-11-29 09:56:54 +0800
commit79d073d7b3ae2f508f0d2e154ed59f87530740e7 (patch)
treedfc428c3ca49671435c2e2a99889c97a2f505950 /server/test/implementation/init.lua
parent9d2265692897472cb1efc3891ef89fe3a58126b0 (diff)
downloadlua-language-server-79d073d7b3ae2f508f0d2e154ed59f87530740e7.zip
换成新的parser
Diffstat (limited to 'server/test/implementation/init.lua')
-rw-r--r--server/test/implementation/init.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/test/implementation/init.lua b/server/test/implementation/init.lua
index de8d9d63..94db86fc 100644
--- a/server/test/implementation/init.lua
+++ b/server/test/implementation/init.lua
@@ -1,4 +1,5 @@
local matcher = require 'matcher'
+local parser = require 'parser'
rawset(_G, 'TEST', true)
@@ -42,8 +43,9 @@ function TEST(script)
local target = catch_target(script)
local pos = script:find('<?', 1, true) + 2
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
-
- local suc, result = matcher.implementation(new_script, pos)
+ local ast, err = parser:ast(new_script)
+ assert(ast)
+ local suc, result = matcher.implementation(ast, pos)
assert(suc)
assert(founded(target, result))
end