From b25fe0dcbf3b06534d170caa294a5245273ea076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 14 Dec 2018 18:14:23 +0800 Subject: =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/libs/lua53/basic.lni | 54 +++++++++++++++++++++++++++++++++++++++++++-- server/src/matcher/vm.lua | 2 -- 2 files changed, 52 insertions(+), 4 deletions(-) (limited to 'server') diff --git a/server/libs/lua53/basic.lni b/server/libs/lua53/basic.lni index 3cd943f3..09092026 100644 --- a/server/libs/lua53/basic.lni +++ b/server/libs/lua53/basic.lni @@ -125,8 +125,44 @@ name = 'mode' enum = 'bt' [loadfile] +[[.args]] +name = 'filename' +type = 'string' +optional = 'after' +[[.args]] +name = 'mode' +type = 'string' +optional = 'after' +[[.args]] +name = 'env' +type = 'table' +optional = 'self' +[[.returns]] +type = 'function' +[[.returns]] +name = 'error_message' +type = 'string' +[[.enums]] +name = 'mode' +enum = 'b' +[[.enums]] +name = 'mode' +enum = 't' +[[.enums]] +name = 'mode' +enum = 'bt' [next] +[[.args]] +name = 'table' +type = 'table' +[[.args]] +name = 'index' +optional = 'self' +[[.returns]] +name = 'key' +[[.returns]] +name = 'value' [pairs] [[.args]] @@ -140,17 +176,31 @@ returns = { name = 'key', }, 2 = { - name = 'object', + name = 'value', }, } [[.returns]] name = 't' type = 'table' [[.returns]] -name = 'nil' type = 'nil' [pcall] +[[.args]] +name = 'f' +type = 'function' +[[.args]] +name = 'arg1' +optional = 'after' +[[.args]] +type = '...' +[[.returns]] +name = 'success' +type = 'boolean' +[[.returns]] +name = 'result' +[[.returns]] +type = '...' [print] diff --git a/server/src/matcher/vm.lua b/server/src/matcher/vm.lua index 0700f640..b1d303a9 100644 --- a/server/src/matcher/vm.lua +++ b/server/src/matcher/vm.lua @@ -445,7 +445,6 @@ function mt:setFunctionReturn(func, index, value) if not func.returns then func.returns = { type = 'list', - [1] = self:createValue('any'), } end if value then @@ -465,7 +464,6 @@ function mt:getFunctionReturns(func, i) if not func.returns then func.returns = { type = 'list', - [1] = self:createValue('any'), } end if i then -- cgit v1.2.3