diff options
author | Lua Team <team@lua.org> | 1995-02-07 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 1995-02-07 12:00:00 +0000 |
commit | a8b6ba0954edb9e0e669e1f451b9a8f145ce5166 (patch) | |
tree | 35e9e9999968c4f13a25a5f647203456f044274a /test/save.lua | |
parent | 944fc7d7d95575f2b8023c1f3d4ac19e1369fc76 (diff) | |
download | lua-github-2.1.tar.gz |
Lua 2.12.1
Diffstat (limited to 'test/save.lua')
-rw-r--r-- | test/save.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/save.lua b/test/save.lua index 3eb91086..8c64c568 100644 --- a/test/save.lua +++ b/test/save.lua @@ -1,10 +1,10 @@ function savevar (n,v) - if v = nil then return end; - if type(v) = "number" then print(n.."="..v) return end - if type(v) = "string" then print(n.."='"..v.."'") return end - if type(v) = "table" then + if v == nil then return end; + if type(v) == "number" then print(n.."="..v) return end + if type(v) == "string" then print(n.."='"..v.."'") return end + if type(v) == "table" then if v.__visited__ ~= nil then print(n .. "=" .. v.__visited__); else @@ -14,7 +14,7 @@ function savevar (n,v) r,f = next(v,nil); while r ~= nil do if r ~= "__visited__" then - if type(r) = 'string' then + if type(r) == 'string' then savevar(n.."['"..r.."']",f) else savevar(n.."["..r.."]",f) @@ -36,9 +36,9 @@ local n,v end a = 3 -x = @{a = 4, b = "name", l=@[4,5,67]} +x = {a = 4, b = "name", l={4,5,67}} -b = @{t=5} +b = {t=5} x.next = b |