From dfce55a48eb5f7f69bd64eba2b523b4e15e7e342 Mon Sep 17 00:00:00 2001 From: sumneko Date: Wed, 17 Apr 2019 13:50:38 +0800 Subject: =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86pairs=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E5=85=B6=E8=BF=94=E5=9B=9E=E7=9C=9F=E6=AD=A3=E7=9A=84?= =?UTF-8?q?next?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/vm/library.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'server/src/vm/library.lua') diff --git a/server/src/vm/library.lua b/server/src/vm/library.lua index 6f038554..e1bd335e 100644 --- a/server/src/vm/library.lua +++ b/server/src/vm/library.lua @@ -5,6 +5,7 @@ local functionMgr local CHILD_CACHE = {} local VALUE_CACHE = {} +local Special = {} local buildLibValue local buildLibChild @@ -39,6 +40,9 @@ function buildLibValue(lib) func:setReturn(i, buildLibValue(rtn)) end end + if lib.special == 'pairs' then + func:setReturn(1, Special['next']) + end end elseif tp == 'string' then value = valueMgr.create('string', sourceMgr.dummy()) @@ -64,6 +68,10 @@ function buildLibValue(lib) end end + if lib.special == 'next' then + Special['next'] = value + end + return value end -- cgit v1.2.3