Skip to content

Commit dbd6206

Browse files
committed
Updated Penlight to latest.
Updated SubLua to latest. Upreved for release.
1 parent b9483ad commit dbd6206

File tree

8 files changed

+292
-283
lines changed

8 files changed

+292
-283
lines changed

LuaForWindows.iss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2626

2727
; -- General Installer configuration
28-
#define MyAppVer "5.1.4.47"
29-
#define MyAppDisplayVer "5.1.4-47"
28+
#define MyAppVer "5.1.4.48"
29+
#define MyAppDisplayVer "5.1.4-48"
3030
#define MyAppName "Lua"
3131
#define MyAppDisplayName "Lua for Windows"
3232
#define MyAppPublisher "The Lua for Windows Project and Lua and Tecgraf, PUC-Rio"

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ C header files/libraries/etc. for building C module
7575
|[Oil](http://oil.luaforge.net)|0.4-beta| It is a simple, efficient and flexible object request broker written in the Lua language.|
7676
|[LuaJSON](http://github.com/harningt/luajson)|1.2.2| JSON parser/encoder for Lua Parses JSON using LPEG for speed and flexibility. Depending on parser/encoder options, various values are preserved as best as possible.|
7777
|[SubLua](https://sourceforge.net/projects/subcpp/)|1.8.10| Subversion binding.|
78+
|[30Log](https://github.com/Yonaba/30log)|1.0.0| 30 lines library for object orientation in Lua.|
7879

7980
## History ##
8081

@@ -279,3 +280,7 @@ C header files/libraries/etc. for building C module
279280
* Updated Penlight to 1.3.2.
280281
* Updated SubLua to 1.8.10.
281282
* **WARNING**: Moved all downloads and code hosting to GitHub. Older releases will not function when Google Code is shut down. Make sure to upgrade.
283+
284+
**5.1.4-48** 16/September/2015 - 34rd release
285+
* Added 30Log v1.0.0 - 30 lines library for object orientation in Lua
286+
* Updated SubLua to 1.8.11.

changes.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
=================== Lua For Windows ===================
2+
09/16/2015 Version 5.1.4-48
3+
+ Added 30Log v1.0.0 - 30 lines library for object orientation in Lua
4+
^ Updated SubLua to 1.8.11.
5+
26
03/18/2015 Version 5.1.4-47
37
^ Updated stdlib to release 28.
48
^ Updated Penlight to 1.3.2.

files/clibs/SubLua.dll

12 KB
Binary file not shown.

files/docs/SubLua/ldoc.lua

100644100755
File mode changed.

files/lua/pl/compat.lua

Lines changed: 137 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,137 @@
1-
----------------
2-
--- Lua 5.1/5.2 compatibility
3-
-- Ensures that `table.pack` and `package.searchpath` are available
4-
-- for Lua 5.1 and LuaJIT.
5-
-- The exported function `load` is Lua 5.2 compatible.
6-
-- `compat.setfenv` and `compat.getfenv` are available for Lua 5.2, although
7-
-- they are not always guaranteed to work.
8-
-- @module pl.compat
9-
10-
local compat = {}
11-
12-
compat.lua51 = _VERSION == 'Lua 5.1'
13-
14-
--- execute a shell command.
15-
-- This is a compatibility function that returns the same for Lua 5.1 and Lua 5.2
16-
-- @param cmd a shell command
17-
-- @return true if successful
18-
-- @return actual return code
19-
function compat.execute (cmd)
20-
local res1,res2,res2 = os.execute(cmd)
21-
if compat.lua51 then
22-
return res1==0,res1
23-
else
24-
return not not res1,res2
25-
end
26-
end
27-
28-
----------------
29-
-- Load Lua code as a text or binary chunk.
30-
-- @param ld code string or loader
31-
-- @param[opt] source name of chunk for errors
32-
-- @param[opt] mode 'b', 't' or 'bt'
33-
-- @param[opt] env environment to load the chunk in
34-
-- @function compat.load
35-
36-
---------------
37-
-- Get environment of a function.
38-
-- With Lua 5.2, may return nil for a function with no global references!
39-
-- Based on code by [Sergey Rozhenko](http://lua-users.org/lists/lua-l/2010-06/msg00313.html)
40-
-- @param f a function or a call stack reference
41-
-- @function compat.setfenv
42-
43-
---------------
44-
-- Set environment of a function
45-
-- @param f a function or a call stack reference
46-
-- @param env a table that becomes the new environment of `f`
47-
-- @function compat.setfenv
48-
49-
if compat.lua51 then -- define Lua 5.2 style load()
50-
if not tostring(assert):match 'builtin' then -- but LuaJIT's load _is_ compatible
51-
local lua51_load = load
52-
function compat.load(str,src,mode,env)
53-
local chunk,err
54-
if type(str) == 'string' then
55-
if str:byte(1) == 27 and not (mode or 'bt'):find 'b' then
56-
return nil,"attempt to load a binary chunk"
57-
end
58-
chunk,err = loadstring(str,src)
59-
else
60-
chunk,err = lua51_load(str,src)
61-
end
62-
if chunk and env then setfenv(chunk,env) end
63-
return chunk,err
64-
end
65-
else
66-
compat.load = load
67-
end
68-
compat.setfenv, compat.getfenv = setfenv, getfenv
69-
else
70-
compat.load = load
71-
-- setfenv/getfenv replacements for Lua 5.2
72-
-- by Sergey Rozhenko
73-
-- http://lua-users.org/lists/lua-l/2010-06/msg00313.html
74-
-- Roberto Ierusalimschy notes that it is possible for getfenv to return nil
75-
-- in the case of a function with no globals:
76-
-- http://lua-users.org/lists/lua-l/2010-06/msg00315.html
77-
function compat.setfenv(f, t)
78-
f = (type(f) == 'function' and f or debug.getinfo(f + 1, 'f').func)
79-
local name
80-
local up = 0
81-
repeat
82-
up = up + 1
83-
name = debug.getupvalue(f, up)
84-
until name == '_ENV' or name == nil
85-
if name then
86-
debug.upvaluejoin(f, up, function() return name end, 1) -- use unique upvalue
87-
debug.setupvalue(f, up, t)
88-
end
89-
if f ~= 0 then return f end
90-
end
91-
92-
function compat.getfenv(f)
93-
local f = f or 0
94-
f = (type(f) == 'function' and f or debug.getinfo(f + 1, 'f').func)
95-
local name, val
96-
local up = 0
97-
repeat
98-
up = up + 1
99-
name, val = debug.getupvalue(f, up)
100-
until name == '_ENV' or name == nil
101-
return val
102-
end
103-
end
104-
105-
--- Lua 5.2 Functions Available for 5.1
106-
-- @section lua52
107-
108-
--- pack an argument list into a table.
109-
-- @param ... any arguments
110-
-- @return a table with field n set to the length
111-
-- @return the length
112-
-- @function table.pack
113-
if not table.pack then
114-
function table.pack (...)
115-
return {n=select('#',...); ...}
116-
end
117-
end
118-
119-
------
120-
-- return the full path where a Lua module name would be matched.
121-
-- @param mod module name, possibly dotted
122-
-- @param path a path in the same form as package.path or package.cpath
123-
-- @see path.package_path
124-
-- @function package.searchpath
125-
if not package.searchpath then
126-
local sep = package.config:sub(1,1)
127-
function package.searchpath (mod,path)
128-
mod = mod:gsub('%.',sep)
129-
for m in path:gmatch('[^;]+') do
130-
local nm = m:gsub('?',mod)
131-
local f = io.open(nm,'r')
132-
if f then f:close(); return nm end
133-
end
134-
end
135-
end
136-
137-
return compat
1+
----------------
2+
--- Lua 5.1/5.2 compatibility
3+
-- Ensures that `table.pack` and `package.searchpath` are available
4+
-- for Lua 5.1 and LuaJIT.
5+
-- The exported function `load` is Lua 5.2 compatible.
6+
-- `compat.setfenv` and `compat.getfenv` are available for Lua 5.2, although
7+
-- they are not always guaranteed to work.
8+
-- @module pl.compat
9+
10+
local compat = {}
11+
12+
compat.lua51 = _VERSION == 'Lua 5.1'
13+
14+
--- execute a shell command.
15+
-- This is a compatibility function that returns the same for Lua 5.1 and Lua 5.2
16+
-- @param cmd a shell command
17+
-- @return true if successful
18+
-- @return actual return code
19+
function compat.execute (cmd)
20+
local res1,res2,res2 = os.execute(cmd)
21+
if compat.lua51 then
22+
return res1==0,res1
23+
else
24+
return not not res1,res2
25+
end
26+
end
27+
28+
----------------
29+
-- Load Lua code as a text or binary chunk.
30+
-- @param ld code string or loader
31+
-- @param[opt] source name of chunk for errors
32+
-- @param[opt] mode 'b', 't' or 'bt'
33+
-- @param[opt] env environment to load the chunk in
34+
-- @function compat.load
35+
36+
---------------
37+
-- Get environment of a function.
38+
-- With Lua 5.2, may return nil for a function with no global references!
39+
-- Based on code by [Sergey Rozhenko](http://lua-users.org/lists/lua-l/2010-06/msg00313.html)
40+
-- @param f a function or a call stack reference
41+
-- @function compat.setfenv
42+
43+
---------------
44+
-- Set environment of a function
45+
-- @param f a function or a call stack reference
46+
-- @param env a table that becomes the new environment of `f`
47+
-- @function compat.setfenv
48+
49+
if compat.lua51 then -- define Lua 5.2 style load()
50+
if not tostring(assert):match 'builtin' then -- but LuaJIT's load _is_ compatible
51+
local lua51_load = load
52+
function compat.load(str,src,mode,env)
53+
local chunk,err
54+
if type(str) == 'string' then
55+
if str:byte(1) == 27 and not (mode or 'bt'):find 'b' then
56+
return nil,"attempt to load a binary chunk"
57+
end
58+
chunk,err = loadstring(str,src)
59+
else
60+
chunk,err = lua51_load(str,src)
61+
end
62+
if chunk and env then setfenv(chunk,env) end
63+
return chunk,err
64+
end
65+
else
66+
compat.load = load
67+
end
68+
compat.setfenv, compat.getfenv = setfenv, getfenv
69+
else
70+
compat.load = load
71+
-- setfenv/getfenv replacements for Lua 5.2
72+
-- by Sergey Rozhenko
73+
-- http://lua-users.org/lists/lua-l/2010-06/msg00313.html
74+
-- Roberto Ierusalimschy notes that it is possible for getfenv to return nil
75+
-- in the case of a function with no globals:
76+
-- http://lua-users.org/lists/lua-l/2010-06/msg00315.html
77+
function compat.setfenv(f, t)
78+
f = (type(f) == 'function' and f or debug.getinfo(f + 1, 'f').func)
79+
local name
80+
local up = 0
81+
repeat
82+
up = up + 1
83+
name = debug.getupvalue(f, up)
84+
until name == '_ENV' or name == nil
85+
if name then
86+
debug.upvaluejoin(f, up, function() return name end, 1) -- use unique upvalue
87+
debug.setupvalue(f, up, t)
88+
end
89+
if f ~= 0 then return f end
90+
end
91+
92+
function compat.getfenv(f)
93+
local f = f or 0
94+
f = (type(f) == 'function' and f or debug.getinfo(f + 1, 'f').func)
95+
local name, val
96+
local up = 0
97+
repeat
98+
up = up + 1
99+
name, val = debug.getupvalue(f, up)
100+
until name == '_ENV' or name == nil
101+
return val
102+
end
103+
end
104+
105+
--- Lua 5.2 Functions Available for 5.1
106+
-- @section lua52
107+
108+
--- pack an argument list into a table.
109+
-- @param ... any arguments
110+
-- @return a table with field n set to the length
111+
-- @return the length
112+
-- @function table.pack
113+
if not table.pack then
114+
function table.pack (...)
115+
return {n=select('#',...); ...}
116+
end
117+
end
118+
119+
------
120+
-- return the full path where a Lua module name would be matched.
121+
-- @param mod module name, possibly dotted
122+
-- @param path a path in the same form as package.path or package.cpath
123+
-- @see path.package_path
124+
-- @function package.searchpath
125+
if not package.searchpath then
126+
local sep = package.config:sub(1,1)
127+
function package.searchpath (mod,path)
128+
mod = mod:gsub('%.',sep)
129+
for m in path:gmatch('[^;]+') do
130+
local nm = m:gsub('?',mod)
131+
local f = io.open(nm,'r')
132+
if f then f:close(); return nm end
133+
end
134+
end
135+
end
136+
137+
return compat

0 commit comments

Comments
 (0)