summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2020-07-17 16:02:19 +0800
committerGitHub <[email protected]>2020-07-17 16:02:19 +0800
commitf9a4493f60eeb9078c00a112734d8caa7e29604e (patch)
tree9fd76a4b3ee0fea7eaa28dbf0df3976c3db36b34 /xmake
parentc3dd85b98492c012fc4eb1b46fac824051a1b92a (diff)
parent6b3cf4e5239f3f041501d0d8ee32471f33010708 (diff)
Merge pull request #894 from xmake-io/json
Add Json Support
Diffstat (limited to 'xmake')
-rw-r--r--xmake/core/base/dlist.lua4
-rw-r--r--xmake/core/base/json.lua29
-rw-r--r--xmake/core/sandbox/modules/import/core/base/json.lua24
-rw-r--r--xmake/core/ui/panel.lua2
4 files changed, 56 insertions, 3 deletions
diff --git a/xmake/core/base/dlist.lua b/xmake/core/base/dlist.lua
index 0657538e7..5d616c6c8 100644
--- a/xmake/core/base/dlist.lua
+++ b/xmake/core/base/dlist.lua
@@ -206,8 +206,8 @@ function dlist:ritems()
end
-- new dlist
-function dlist:new()
- return self()
+function dlist.new()
+ return dlist()
end
-- return module: dlist
diff --git a/xmake/core/base/json.lua b/xmake/core/base/json.lua
new file mode 100644
index 000000000..26dbce173
--- /dev/null
+++ b/xmake/core/base/json.lua
@@ -0,0 +1,29 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-2020, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file json.lua
+--
+
+-- define module: json
+local json = json or {}
+
+-- hide some cjson members
+json._VERSION = nil
+json._NAME = nil
+
+-- return module: json
+return json
diff --git a/xmake/core/sandbox/modules/import/core/base/json.lua b/xmake/core/sandbox/modules/import/core/base/json.lua
new file mode 100644
index 000000000..c8f428298
--- /dev/null
+++ b/xmake/core/sandbox/modules/import/core/base/json.lua
@@ -0,0 +1,24 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-2020, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file json.lua
+--
+
+-- load modules
+return require("base/json")
+
+
diff --git a/xmake/core/ui/panel.lua b/xmake/core/ui/panel.lua
index 7cff86eff..c876aa412 100644
--- a/xmake/core/ui/panel.lua
+++ b/xmake/core/ui/panel.lua
@@ -43,7 +43,7 @@ function panel:init(name, bounds)
self:option_set("selectable", true)
-- init child views
- self._VIEWS = dlist:new()
+ self._VIEWS = dlist.new()
-- init views cache
self._VIEWS_CACHE = {}