From 4dddd5e97906202f772642486c6e55ae89d67f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 4 Mar 2019 15:46:07 +0800 Subject: =?UTF-8?q?=E7=AE=80=E5=8D=95=E7=B1=BB=E5=9E=8B=E8=85=BF=E7=9F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/vm/value.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'server/src/vm/value.lua') diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua index 66f15da2..18b92667 100644 --- a/server/src/vm/value.lua +++ b/server/src/vm/value.lua @@ -72,11 +72,13 @@ function mt:rawGet(index) end function mt:setChild(index, value) + self:setType('table', 0.5) self:rawSet(index, value) return value end function mt:getChild(index, mark) + self:setType('table', 0.5) local value = self:rawGet(index) if value then return value @@ -213,6 +215,7 @@ function mt:setFunction(func) end function mt:getFunction() + self:setType('function', 0.5) return self._func end @@ -224,13 +227,18 @@ function mt:getLib() return self._lib end -return function (tp, source) +function mt:getLiteral() + return self._literal +end + +return function (tp, source, literal) if tp == '...' then error('Value type cant be ...') end local self = setmetatable({ source = source or getDefaultSource(), _type = {}, + _literal = literal, }, mt) if type(tp) == 'table' then for i = 1, #tp do -- cgit v1.2.3