History

Lua 5.1-rc4

Lua Team committed 20 years ago

Commit 4e079f61 parent 010ebd07 files · +34 −35Browse files

Unified · Split

7 files
  1. MANIFEST +14 −14
  2. doc/contents.html +3 −1
  3. doc/manual.html +5 −1
  4. etc/Makefile +1 −1
  5. etc/min.c +4 −13
  6. src/lobject.c +3 −1
  7. src/luaconf.h +4 −4
MANIFEST+14−14
@@ -1,34 +1,33 @@
1−MANIFEST contents of Lua 5.1 distribution on Tue Feb 7 15:05:04 BRST 2006
1+MANIFEST contents of Lua 5.1 distribution on Fri Feb 10 17:19:52 BRST 2006
22 lua-5.1
33 lua-5.1/COPYRIGHT
4−lua-5.1/HISTORY
5−lua-5.1/INSTALL
6−lua-5.1/MANIFEST
7−lua-5.1/Makefile
8−lua-5.1/README
94 lua-5.1/doc
105 lua-5.1/doc/contents.html
116 lua-5.1/doc/logo.gif
127 lua-5.1/doc/lua.1
13−lua-5.1/doc/lua.css
14−lua-5.1/doc/lua.html
158 lua-5.1/doc/luac.1
169 lua-5.1/doc/luac.html
10+lua-5.1/doc/lua.css
11+lua-5.1/doc/lua.html
1712 lua-5.1/doc/manual.html
1813 lua-5.1/doc/readme.html
1914 lua-5.1/etc
20−lua-5.1/etc/Makefile
21−lua-5.1/etc/README
2215 lua-5.1/etc/all.c
2316 lua-5.1/etc/lua.hpp
2417 lua-5.1/etc/lua.ico
2518 lua-5.1/etc/lua.pc
2619 lua-5.1/etc/luavs.bat
20+lua-5.1/etc/Makefile
2721 lua-5.1/etc/min.c
2822 lua-5.1/etc/noparser.c
23+lua-5.1/etc/README
2924 lua-5.1/etc/strict.lua
25+lua-5.1/HISTORY
26+lua-5.1/INSTALL
27+lua-5.1/Makefile
28+lua-5.1/MANIFEST
29+lua-5.1/README
3030 lua-5.1/src
31−lua-5.1/src/Makefile
3231 lua-5.1/src/lapi.c
3332 lua-5.1/src/lapi.h
3433 lua-5.1/src/lauxlib.c
@@ -73,9 +72,9 @@ lua-5.1/src/ltablib.c · 38 unmodified lines
7372 lua-5.1/src/ltm.c
7473 lua-5.1/src/ltm.h
7574 lua-5.1/src/lua.c
76−lua-5.1/src/lua.h
7775 lua-5.1/src/luac.c
7876 lua-5.1/src/luaconf.h
77+lua-5.1/src/lua.h
7978 lua-5.1/src/lualib.h
8079 lua-5.1/src/lundump.c
8180 lua-5.1/src/lundump.h
@@ -83,21 +82,22 @@ lua-5.1/src/lvm.c · 1 unmodified line
8382 lua-5.1/src/lvm.h
8483 lua-5.1/src/lzio.c
8584 lua-5.1/src/lzio.h
85+lua-5.1/src/Makefile
8686 lua-5.1/src/print.c
8787 lua-5.1/test
88−lua-5.1/test/README
8988 lua-5.1/test/bisect.lua
9089 lua-5.1/test/cf.lua
9190 lua-5.1/test/echo.lua
9291 lua-5.1/test/env.lua
9392 lua-5.1/test/factorial.lua
94−lua-5.1/test/fib.lua
9593 lua-5.1/test/fibfor.lua
94+lua-5.1/test/fib.lua
9695 lua-5.1/test/globals.lua
9796 lua-5.1/test/hello.lua
9897 lua-5.1/test/life.lua
9998 lua-5.1/test/luac.lua
10099 lua-5.1/test/printf.lua
100+lua-5.1/test/README
101101 lua-5.1/test/readonly.lua
102102 lua-5.1/test/sieve.lua
103103 lua-5.1/test/sort.lua
doc/contents.html+3−1
@@ -93,7 +93,9 @@ Lua 5.1 Reference Manual · 92 unmodified lines
9393 <LI><A HREF="manual.html#5.9">5.9 - The Debug Library</A>
9494 </UL>
9595 <LI><A HREF="manual.html#6">6 - Lua Stand-alone</A>
96+<LI><A HREF="manual.html#incompat">Incompatibilities with the Previous Version</A>
9697 <LI><A HREF="manual.html#BNF">The Complete Syntax of Lua</A>
98+
9799 </UL>
98100
99101 <H2><A NAME="quick">Quick index</A></H2>
@@ -396,7 +398,7 @@ Lua 5.1 Reference Manual · 296 unmodified lines
396398 <HR>
397399 <SMALL>
398400 Last update:
399−Tue Feb 7 14:37:59 BRST 2006
401+Fri Feb 10 17:15:37 BRST 2006
400402 </SMALL>
401403
402404 </BODY>
doc/manual.html+5−1
@@ -6059,7 +6059,7 @@ is a more portable solution.) · 6058 unmodified lines
60596059
60606060 <p><hr></hr>
60616061
6062−<p><h1>Incompatibilities with the Previous Version</h1>
6062+<p><a name="incompat"></a><h1>Incompatibilities with the Previous Version</h1>
60636063
60646064
60656065 <p>Here we list the incompatibilities that may be found when moving a program
@@ -6118,6 +6118,10 @@ Function <code>loadlib</code> was renamed <a href="#pdf-package.loadlib"><code>p · 52 unmodified lines
61186118 Function <code>math.mod</code> was renamed <a href="#pdf-math.fmod"><code>math.fmod</code></a>.
61196119 (Option <code>LUA_COMPAT_MOD</code>)
61206120
6121+<p><li>
6122+Functions <code>table.foreach</code> and <code>table.foreachi</code> are deprecated.
6123+You can use a for loop with <code>pairs</code> or <code>ipairs</code> instead.
6124+
61216125 <p><li>
61226126 There were substantial changes in function <a href="#pdf-require"><code>require</code></a> due to
61236127 the new module system.
etc/Makefile+1−1
@@ -16,7 +16,7 @@ MYLIBS= -lm · 15 unmodified lines
1616 RM= rm -f
1717
1818 default:
19− @echo 'Please choose a target: min noparser one clean'
19+ @echo 'Please choose a target: min noparser one strict clean'
2020
2121 min: min.c
2222 $(CC) $(CFLAGS) $@.c -L$(LIB) -llua $(MYLIBS)
etc/min.c+4−13
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 */
66
77 #include <stdio.h>
8+
89 #include "lua.h"
910 #include "lauxlib.h"
1011
@@ -17,32 +18,22 @@ static int print(lua_State *L) · 6 unmodified lines
1718 if (i>1) printf("\t");
1819 if (lua_isstring(L,i))
1920 printf("%s",lua_tostring(L,i));
20− else if (lua_isnil(L,i))
21+ else if (lua_isnil(L,i)==2)
2122 printf("%s","nil");
2223 else if (lua_isboolean(L,i))
2324 printf("%s",lua_toboolean(L,i) ? "true" : "false");
2425 else
25− printf("%s:%p",lua_typename(L,lua_type(L,i)),lua_topointer(L,i));
26+ printf("%s:%p",luaL_typename(L,i),lua_topointer(L,i));
2627 }
2728 printf("\n");
2829 return 0;
2930 }
3031
31−static const char *getF(lua_State *L, void *ud, size_t *size)
32−{
33− FILE *f=(FILE *)ud;
34− static char buff[512];
35− if (feof(f)) return NULL;
36− *size=fread(buff,1,sizeof(buff),f);
37− return (*size>0) ? buff : NULL;
38−}
39−
4032 int main(void)
4133 {
4234 lua_State *L=lua_open();
4335 lua_register(L,"print",print);
44− if (lua_load(L,getF,stdin,"=stdin") || lua_pcall(L,0,0,0))
45− fprintf(stderr,"%s\n",lua_tostring(L,-1));
36+ if (luaL_dofile(L,NULL)!=0) fprintf(stderr,"%s\n",lua_tostring(L,-1));
4637 lua_close(L);
4738 return 0;
4839 }
src/lobject.c+3−1
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lobject.c,v 2.21 2006/01/10 12:50:00 roberto Exp $
2+** $Id: lobject.c,v 2.22 2006/02/10 17:43:52 roberto Exp $
33 ** Some generic functions over Lua objects
44 ** See Copyright Notice in lua.h
55 */
@@ -91,6 +91,8 @@ int luaO_str2d (const char *s, lua_Number *result) { · 85 unmodified lines
9191 char *endptr;
9292 *result = lua_str2number(s, &endptr);
9393 if (endptr == s) return 0; /* conversion failed */
94+ if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */
95+ *result = cast_num(strtoul(s, &endptr, 16));
9496 if (*endptr == '\0') return 1; /* most common case */
9597 while (isspace(cast(unsigned char, *endptr))) endptr++;
9698 if (*endptr != '\0') return 0; /* invalid trailing characters? */
src/luaconf.h+4−4
@@ -1,5 +1,5 @@
11 /*
2−** $Id: luaconf.h,v 1.80 2006/01/27 13:54:39 roberto Exp $
2+** $Id: luaconf.h,v 1.81 2006/02/10 17:44:06 roberto Exp $
33 ** Configuration file for Lua
44 ** See Copyright Notice in lua.h
55 */
@@ -650,9 +650,9 @@ union luai_Cast { double l_d; long l_l; }; · 644 unmodified lines
650650
651651 #else
652652
653−#define lua_popen(L,c,m) \
654− ((void)c, (void)m, luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
655−#define lua_pclose(L,file) ((void)L, (void)file, 0)
653+#define lua_popen(L,c,m) ((void)((void)c, m), \
654+ luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
655+#define lua_pclose(L,file) ((void)((void)L, file), 0)
656656
657657 #endif
658658