summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-07-26 22:34:30 +0800
committerruki <[email protected]>2019-07-26 09:27:02 +0800
commit19755499217acfae7b4ba88a38442d565d3a0bad (patch)
treeb3eb3dddace912abaf2c7be41df4c669484ad066
parenta77e8ad6db511c7adbb6b982cd5958febcb989cf (diff)
fix some code styles
-rw-r--r--xmake/core/base/math.lua3
-rw-r--r--xmake/core/base/serialize.lua9
2 files changed, 6 insertions, 6 deletions
diff --git a/xmake/core/base/math.lua b/xmake/core/base/math.lua
index d49e8a8b9..7e3c69ca4 100644
--- a/xmake/core/base/math.lua
+++ b/xmake/core/base/math.lua
@@ -28,6 +28,7 @@ math.e = math.exp(1)
-- check a number is int
--
-- @returns true for int, otherwise false
+--
function math:isint()
-- check
@@ -39,6 +40,7 @@ end
-- check a number is inf or -inf
--
-- @returns 1 for inf, -1 for -inf, otherwise false
+--
function math:isinf()
-- check
@@ -56,6 +58,7 @@ end
-- check a number is nan
--
-- @returns true for nan, otherwise false
+--
function math:isnan()
-- check
diff --git a/xmake/core/base/serialize.lua b/xmake/core/base/serialize.lua
index e9b435387..61e8c3adf 100644
--- a/xmake/core/base/serialize.lua
+++ b/xmake/core/base/serialize.lua
@@ -51,9 +51,8 @@ end
function serialize._maketable(object, opt, level)
- local childlevel = level + 1
-
-- serialize child items
+ local childlevel = level + 1
local serialized = {}
local numidxcount = 0
local isarr = true
@@ -142,10 +141,12 @@ function serialize._maketable(object, opt, level)
end
function serialize._makefunction(func, opt, level)
+
local ok, funccode = pcall(serialize._dump, func, opt.strip)
if not ok then
return nil, string.format("%s: <%s>", funccode, func)
end
+
local chunkname = nil
local sep = ","
if opt.strip then
@@ -253,9 +254,7 @@ function serialize._load(str)
-- load table as script
local result = nil
-
local binary = str:startswith("\27LJ")
-
if not binary then
str = "return " .. str
end
@@ -300,8 +299,6 @@ function serialize.load(str)
-- load string
local result, errors = serialize._load(str)
-
- -- ok?
if errors ~= nil then
return nil, errors
end