diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-29 16:38:07 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-29 16:38:07 +0800 |
commit | 155ee2059dd18d805140b87901d01ff79257ed60 (patch) | |
tree | 26b80a361a112170970cffcb84c3594330461db1 /script-beta/vm/getValue.lua | |
parent | a64957132d5c9ecf6c66003ff028d68772d1aa1f (diff) | |
download | lua-language-server-155ee2059dd18d805140b87901d01ff79257ed60.zip |
支持部分library
Diffstat (limited to 'script-beta/vm/getValue.lua')
-rw-r--r-- | script-beta/vm/getValue.lua | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/script-beta/vm/getValue.lua b/script-beta/vm/getValue.lua index 30fd00aa..9ad9e86b 100644 --- a/script-beta/vm/getValue.lua +++ b/script-beta/vm/getValue.lua @@ -97,6 +97,11 @@ local function checkLiteral(source) source = source, } end + elseif source.type == 'integer' then + return alloc { + type = 'integer', + source = source, + } elseif source.type == 'table' then return alloc { type = 'table', @@ -107,6 +112,11 @@ local function checkLiteral(source) type = 'function', source = source, } + elseif source.type == '...' then + return alloc { + type = '...', + source = source, + } end end @@ -536,7 +546,7 @@ local function checkLibrary(source) return alloc { type = lib.type, value = lib.value, - source = vm.librarySource(lib), + source = lib, } end @@ -573,7 +583,7 @@ local function checkLibraryReturn(source) return alloc { type = rtn.type, value = rtn.value, - source = vm.librarySource(rtn), + source = rtn, } end @@ -614,7 +624,7 @@ local function checkLibraryArg(source) return alloc { type = arg.type, value = arg.value, - source = vm.librarySource(arg), + source = arg, } end @@ -630,21 +640,21 @@ local function inferByUnary(results, source) if op.type == '#' then insert(results, { type = 'string', - source = vm.librarySource(source) + source = source }) insert(results, { type = 'table', - source = vm.librarySource(source) + source = source }) elseif op.type == '~' then insert(results, { type = 'integer', - source = vm.librarySource(source) + source = source }) elseif op.type == '-' then insert(results, { type = 'number', - source = vm.librarySource(source) + source = source }) end end @@ -670,7 +680,7 @@ local function inferByBinary(results, source) or op.type == '%' then insert(results, { type = 'number', - source = vm.librarySource(source) + source = source }) elseif op.type == '|' or op.type == '~' @@ -681,12 +691,12 @@ local function inferByBinary(results, source) or op.type == '//' then insert(results, { type = 'integer', - source = vm.librarySource(source) + source = source }) elseif op.type == '..' then insert(results, { type = 'string', - source = vm.librarySource(source) + source = source }) end end |