History

Lua 5.1.3-rc2

Lua Team committed 18 years ago

Commit aeb9dbd1 parent ea97e799 files · +32 −23Browse files

Unified · Split

9 files
  1. COPYRIGHT +1 −1
  2. doc/contents.html +5 −3
  3. doc/manual.html +8 −6
  4. etc/min.c +1 −1
  5. etc/strict.lua +3 −1
  6. src/ldblib.c +7 −5
  7. src/loslib.c +1 −2
  8. src/luaconf.h +2 −2
  9. src/lundump.c +4 −2
COPYRIGHT+1−1
@@ -9,7 +9,7 @@ For details and rationale, see http://www.lua.org/license.html . · 8 unmodified lines
99
1010 ===============================================================================
1111
12−Copyright (C) 1994-2007 Lua.org, PUC-Rio.
12+Copyright (C) 1994-2008 Lua.org, PUC-Rio.
1313
1414 Permission is hereby granted, free of charge, to any person obtaining a copy
1515 of this software and associated documentation files (the "Software"), to deal
doc/contents.html+5−3
@@ -1,7 +1,9 @@
1+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
12 <HTML>
23 <HEAD>
34 <TITLE>Lua 5.1 Reference Manual - contents</TITLE>
45 <LINK REL="stylesheet" TYPE="text/css" HREF="lua.css">
6+<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
57 <STYLE TYPE="text/css">
68 ul {
79 list-style-type: none ;
@@ -49,9 +51,9 @@ For a complete introduction to Lua programming, see the book · 41 unmodified lines
4951 &middot;
5052 <A HREF="#index">index</A>
5153 &middot;
52−<A HREF="http://www.lua.org/manual/5.1/pt/">portugu&ecirc;s</A>
54+<A HREF="http://www.lua.org/manual/5.1/pt/">portugu�s</A>
5355 &middot;
54−<A HREF="http://www.lua.org/manual/5.1/es/">espa&ntilde;ol</A>
56+<A HREF="http://www.lua.org/manual/5.1/es/">espa�ol</A>
5557 <HR>
5658 <SMALL>
5759 Copyright &copy; 2006-2008 Lua.org, PUC-Rio.
@@ -486,7 +488,7 @@ Freely available under the terms of the · 428 unmodified lines
486488 <HR>
487489 <SMALL>
488490 Last update:
489−Thu Jan 17 14:50:23 BRST 2008
491+Fri Jan 18 10:36:25 BRST 2008
490492 </SMALL>
491493 <!--
492494 Last change: revised for Lua 5.1.3
doc/manual.html+8−6
@@ -1,10 +1,11 @@
1−<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
1+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
22 <html>
33
44 <head>
55 <title>Lua 5.1 Reference Manual</title>
66 <link rel="stylesheet" href="lua.css">
77 <link rel="stylesheet" href="manual.css">
8+<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
89 </head>
910
1011 <body>
@@ -32,7 +33,7 @@ Freely available under the terms of the · 21 unmodified lines
3233 <!-- ====================================================================== -->
3334 <p>
3435
35−<!-- $Id: manual.of,v 1.43 2008/01/17 16:19:44 roberto Exp $ -->
36+<!-- $Id: manual.of,v 1.44 2008/01/18 16:41:50 roberto Exp $ -->
3637
3738
3839
@@ -179,6 +180,7 @@ which can be specified as '<code>\0</code>'. · 140 unmodified lines
179180
180181 <p>
181182 To put a double (single) quote, a newline, a backslash,
183+a carriage return,
182184 or an embedded zero
183185 inside a literal string enclosed by double (single) quotes
184186 you must use an escape sequence.
@@ -2665,7 +2667,7 @@ of numerical arguments and returns their average and sum: · 2480 unmodified lines
26652667
26662668
26672669 <hr><h3><a name="lua_checkstack"><code>lua_checkstack</code></a></h3><p>
2668−<span class="apii">[-0, +0, <em>-</em>]</span>
2670+<span class="apii">[-0, +0, <em>m</em>]</span>
26692671 <pre>int lua_checkstack (lua_State *L, int extra);</pre>
26702672
26712673 <p>
@@ -3767,7 +3769,7 @@ The reader function may return pieces of any size greater than zero. · 1095 unmodified lines
37673769
37683770
37693771 <hr><h3><a name="lua_register"><code>lua_register</code></a></h3><p>
3770−<span class="apii">[-0, +0, <em>m</em>]</span>
3772+<span class="apii">[-0, +0, <em>e</em>]</span>
37713773 <pre>void lua_register (lua_State *L,
37723774 const char *name,
37733775 lua_CFunction f);</pre>
@@ -4395,7 +4397,7 @@ Returns the current hook mask. · 621 unmodified lines
43954397
43964398
43974399 <hr><h3><a name="lua_getinfo"><code>lua_getinfo</code></a></h3><p>
4398−<span class="apii">[-(0|1), +(0|1|2), <em>-</em>]</span>
4400+<span class="apii">[-(0|1), +(0|1|2), <em>m</em>]</span>
43994401 <pre>int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);</pre>
44004402
44014403 <p>
@@ -8739,7 +8741,7 @@ Here is the complete syntax of Lua in extended BNF. · 4337 unmodified lines
87398741 <HR>
87408742 <SMALL>
87418743 Last update:
8742−Thu Jan 17 15:06:18 BRST 2008
8744+Fri Jan 18 14:50:20 BRST 2008
87438745 </SMALL>
87448746 <!--
87458747 Last change: revised for Lua 5.1.3
etc/min.c+1−1
@@ -18,7 +18,7 @@ static int print(lua_State *L) · 17 unmodified lines
1818 if (i>1) printf("\t");
1919 if (lua_isstring(L,i))
2020 printf("%s",lua_tostring(L,i));
21− else if (lua_isnil(L,i)==2)
21+ else if (lua_isnil(L,i))
2222 printf("%s","nil");
2323 else if (lua_isboolean(L,i))
2424 printf("%s",lua_toboolean(L,i) ? "true" : "false");
etc/strict.lua+3−1
@@ -6,6 +6,8 @@ · 5 unmodified lines
66 -- anywhere or assigned to inside a function.
77 --
88
9+local getinfo, error, rawset, rawget = debug.getinfo, error, rawset, rawget
10+
911 local mt = getmetatable(_G)
1012 if mt == nil then
1113 mt = {}
@@ -15,7 +17,7 @@ end · 3 unmodified lines
1517 mt.__declared = {}
1618
1719 local function what ()
18− local d = debug.getinfo(3, "S")
20+ local d = getinfo(3, "S")
1921 return d and d.what or "C"
2022 end
2123
src/ldblib.c+7−5
@@ -1,5 +1,5 @@
11 /*
2−** $Id: ldblib.c,v 1.104.1.1 2007/12/27 13:02:25 roberto Exp $
2+** $Id: ldblib.c,v 1.104.1.2 2008/01/18 16:39:45 roberto Exp $
33 ** Interface from Lua to its debug API
44 ** See Copyright Notice in lua.h
55 */
@@ -255,17 +255,18 @@ static void gethooktable (lua_State *L) { · 249 unmodified lines
255255
256256
257257 static int db_sethook (lua_State *L) {
258− int arg;
258+ int arg, mask, count;
259+ lua_Hook func;
259260 lua_State *L1 = getthread(L, &arg);
260261 if (lua_isnoneornil(L, arg+1)) {
261262 lua_settop(L, arg+1);
262− lua_sethook(L1, NULL, 0, 0); /* turn off hooks */
263+ func = NULL; mask = 0; count = 0; /* turn off hooks */
263264 }
264265 else {
265266 const char *smask = luaL_checkstring(L, arg+2);
266− int count = luaL_optint(L, arg+3, 0);
267267 luaL_checktype(L, arg+1, LUA_TFUNCTION);
268− lua_sethook(L1, hookf, makemask(smask, count), count);
268+ count = luaL_optint(L, arg+3, 0);
269+ func = hookf; mask = makemask(smask, count);
269270 }
270271 gethooktable(L1);
271272 lua_pushlightuserdata(L1, L1);
@@ -273,6 +274,7 @@ static int db_sethook (lua_State *L) { · 1 unmodified line
273274 lua_xmove(L, L1, 1);
274275 lua_rawset(L1, -3); /* set new hook */
275276 lua_pop(L1, 1); /* remove hook table */
277+ lua_sethook(L1, func, mask, count); /* set hooks */
276278 return 0;
277279 }
278280
src/loslib.c+1−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: loslib.c,v 1.19.1.2 2007/12/28 14:58:43 roberto Exp $
2+** $Id: loslib.c,v 1.19.1.3 2008/01/18 16:38:18 roberto Exp $
33 ** Standard Operating System library
44 ** See Copyright Notice in lua.h
55 */
@@ -215,7 +215,6 @@ static int os_setlocale (lua_State *L) { · 209 unmodified lines
215215
216216 static int os_exit (lua_State *L) {
217217 exit(luaL_optint(L, 1, EXIT_SUCCESS));
218− return 0; /* to avoid warnings */
219218 }
220219
221220 static const luaL_Reg syslib[] = {
src/luaconf.h+2−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: luaconf.h,v 1.82.1.5 2008/01/17 14:04:20 roberto Exp $
2+** $Id: luaconf.h,v 1.82.1.6 2008/01/18 17:07:48 roberto Exp $
33 ** Configuration file for Lua
44 ** See Copyright Notice in lua.h
55 */
@@ -667,7 +667,7 @@ union luai_Cast { double l_d; long l_l; }; · 661 unmodified lines
667667 */
668668 #if defined(LUA_USE_POPEN)
669669
670−#define lua_popen(L,c,m) ((void)L, popen(c,m))
670+#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m))
671671 #define lua_pclose(L,file) ((void)L, (pclose(file) != -1))
672672
673673 #elif defined(LUA_WIN)
src/lundump.c+4−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lundump.c,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $
2+** $Id: lundump.c,v 2.7.1.2 2008/01/18 16:39:11 roberto Exp $
33 ** load precompiled Lua chunks
44 ** See Copyright Notice in lua.h
55 */
@@ -29,6 +29,7 @@ typedef struct { · 23 unmodified lines
2929
3030 #ifdef LUAC_TRUST_BINARIES
3131 #define IF(c,s)
32+#define error(S,s)
3233 #else
3334 #define IF(c,s) if (c) error(S,s)
3435
@@ -47,6 +48,7 @@ static void error(LoadState* S, const char* why) · 12 unmodified lines
4748 static void LoadBlock(LoadState* S, void* b, size_t size)
4849 {
4950 size_t r=luaZ_read(S->Z,b,size);
51+ UNUSED(r);
5052 IF (r!=0, "unexpected end");
5153 }
5254
@@ -122,7 +124,7 @@ static void LoadConstants(LoadState* S, Proto* f) · 69 unmodified lines
122124 setsvalue2n(S->L,o,LoadString(S));
123125 break;
124126 default:
125− IF (1, "bad constant");
127+ error(S,"bad constant");
126128 break;
127129 }
128130 }