diff options
author | Alexander Harkness <bearbin@gmail.com> | 2013-07-29 13:13:03 +0200 |
---|---|---|
committer | Alexander Harkness <bearbin@gmail.com> | 2013-07-29 13:13:03 +0200 |
commit | 53e22b11857fed62e2313d6d84d90f88ed412ffb (patch) | |
tree | c61e56725da7dff0154d566722651e2c39c9d6c6 /tolua++-1.0.93/src/bin/lua/compat-5.1.lua | |
parent | WebAdmin: Removed the duplicate memory usage querying (diff) | |
download | cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.tar cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.tar.gz cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.tar.bz2 cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.tar.lz cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.tar.xz cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.tar.zst cuberite-53e22b11857fed62e2313d6d84d90f88ed412ffb.zip |
Diffstat (limited to 'tolua++-1.0.93/src/bin/lua/compat-5.1.lua')
-rw-r--r-- | tolua++-1.0.93/src/bin/lua/compat-5.1.lua | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/tolua++-1.0.93/src/bin/lua/compat-5.1.lua b/tolua++-1.0.93/src/bin/lua/compat-5.1.lua index c2642d3a6..7a2c60b69 100644 --- a/tolua++-1.0.93/src/bin/lua/compat-5.1.lua +++ b/tolua++-1.0.93/src/bin/lua/compat-5.1.lua @@ -1,57 +1,57 @@ -if string.find(_VERSION, "5%.0") then
- return
-end
-
--- "loadfile"
-local function pp_dofile(path)
-
- local loaded = false
- local getfile = function()
-
- if loaded then
- return
- else
- local file,err = io.open(path)
- if not file then
- error("error loading file "..path..": "..err)
- end
- local ret = file:read("*a")
- file:close()
-
- ret = string.gsub(ret, "%.%.%.%s*%)", "...) local arg = {n=select('#', ...), ...};")
-
- loaded = true
- return ret
- end
- end
-
- local f = load(getfile, path)
- if not f then
-
- error("error loading file "..path)
- end
- return f()
-end
-
-old_dofile = dofile
-dofile = pp_dofile
-
-
--- string.gsub
---[[
-local ogsub = string.gsub
-local function compgsub(a,b,c,d)
- if type(c) == "function" then
- local oc = c
- c = function (...) return oc(...) or '' end
- end
- return ogsub(a,b,c,d)
-end
-string.repl = ogsub
---]]
-
---string.gsub = compgsub
-
-
-
-
+if string.find(_VERSION, "5%.0") then + return +end + +-- "loadfile" +local function pp_dofile(path) + + local loaded = false + local getfile = function() + + if loaded then + return + else + local file,err = io.open(path) + if not file then + error("error loading file "..path..": "..err) + end + local ret = file:read("*a") + file:close() + + ret = string.gsub(ret, "%.%.%.%s*%)", "...) local arg = {n=select('#', ...), ...};") + + loaded = true + return ret + end + end + + local f = load(getfile, path) + if not f then + + error("error loading file "..path) + end + return f() +end + +old_dofile = dofile +dofile = pp_dofile + + +-- string.gsub +--[[ +local ogsub = string.gsub +local function compgsub(a,b,c,d) + if type(c) == "function" then + local oc = c + c = function (...) return oc(...) or '' end + end + return ogsub(a,b,c,d) +end +string.repl = ogsub +--]] + +--string.gsub = compgsub + + + + |