diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-11-19 18:32:25 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-11-19 18:32:25 +0800 |
commit | a0d63aed83e365ebcbbb5306ef109b18854f7af8 (patch) | |
tree | 0760360cc2c680040feb0b19b18941cf47686193 /src/matcher | |
parent | bff91f1e802c56554a2b12fa8d89561610733391 (diff) | |
download | lua-language-server-a0d63aed83e365ebcbbb5306ef109b18854f7af8.zip |
显示语法错误
Diffstat (limited to 'src/matcher')
-rw-r--r-- | src/matcher/definition.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/matcher/definition.lua b/src/matcher/definition.lua index 9ac0e047..9da52e83 100644 --- a/src/matcher/definition.lua +++ b/src/matcher/definition.lua @@ -200,7 +200,10 @@ return function (buf, pos_) result = nil scopeInit() - parser.grammar(buf, 'Lua', defs) + local suc, err = parser.grammar(buf, 'Lua', defs) + if not suc then + return false, '语法错误', err + end if not result then return false, 'No word' |