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 @@
1MANIFEST contents of Lua 5.1 distribution on Tue Feb 7 15:05:04 BRST 20061MANIFEST contents of Lua 5.1 distribution on Fri Feb 10 17:19:52 BRST 2006
2lua-5.12lua-5.1
3lua-5.1/COPYRIGHT3lua-5.1/COPYRIGHT
4lua-5.1/HISTORY
5lua-5.1/INSTALL
6lua-5.1/MANIFEST
7lua-5.1/Makefile
8lua-5.1/README
9lua-5.1/doc4lua-5.1/doc
10lua-5.1/doc/contents.html5lua-5.1/doc/contents.html
11lua-5.1/doc/logo.gif6lua-5.1/doc/logo.gif
12lua-5.1/doc/lua.17lua-5.1/doc/lua.1
13lua-5.1/doc/lua.css
14lua-5.1/doc/lua.html
15lua-5.1/doc/luac.18lua-5.1/doc/luac.1
16lua-5.1/doc/luac.html9lua-5.1/doc/luac.html
10lua-5.1/doc/lua.css
11lua-5.1/doc/lua.html
17lua-5.1/doc/manual.html12lua-5.1/doc/manual.html
18lua-5.1/doc/readme.html13lua-5.1/doc/readme.html
19lua-5.1/etc14lua-5.1/etc
20lua-5.1/etc/Makefile
21lua-5.1/etc/README
22lua-5.1/etc/all.c15lua-5.1/etc/all.c
23lua-5.1/etc/lua.hpp16lua-5.1/etc/lua.hpp
24lua-5.1/etc/lua.ico17lua-5.1/etc/lua.ico
25lua-5.1/etc/lua.pc18lua-5.1/etc/lua.pc
26lua-5.1/etc/luavs.bat19lua-5.1/etc/luavs.bat
20lua-5.1/etc/Makefile
27lua-5.1/etc/min.c21lua-5.1/etc/min.c
28lua-5.1/etc/noparser.c22lua-5.1/etc/noparser.c
23lua-5.1/etc/README
29lua-5.1/etc/strict.lua24lua-5.1/etc/strict.lua
25lua-5.1/HISTORY
26lua-5.1/INSTALL
27lua-5.1/Makefile
28lua-5.1/MANIFEST
29lua-5.1/README
30lua-5.1/src30lua-5.1/src
31lua-5.1/src/Makefile
32lua-5.1/src/lapi.c31lua-5.1/src/lapi.c
33lua-5.1/src/lapi.h32lua-5.1/src/lapi.h
34lua-5.1/src/lauxlib.c33lua-5.1/src/lauxlib.c
@@ -73,9 +72,9 @@ lua-5.1/src/ltablib.c · 38 unmodified lines
73lua-5.1/src/ltm.c72lua-5.1/src/ltm.c
74lua-5.1/src/ltm.h73lua-5.1/src/ltm.h
75lua-5.1/src/lua.c74lua-5.1/src/lua.c
76lua-5.1/src/lua.h
77lua-5.1/src/luac.c75lua-5.1/src/luac.c
78lua-5.1/src/luaconf.h76lua-5.1/src/luaconf.h
77lua-5.1/src/lua.h
79lua-5.1/src/lualib.h78lua-5.1/src/lualib.h
80lua-5.1/src/lundump.c79lua-5.1/src/lundump.c
81lua-5.1/src/lundump.h80lua-5.1/src/lundump.h
@@ -83,21 +82,22 @@ lua-5.1/src/lvm.c · 1 unmodified line
83lua-5.1/src/lvm.h82lua-5.1/src/lvm.h
84lua-5.1/src/lzio.c83lua-5.1/src/lzio.c
85lua-5.1/src/lzio.h84lua-5.1/src/lzio.h
85lua-5.1/src/Makefile
86lua-5.1/src/print.c86lua-5.1/src/print.c
87lua-5.1/test87lua-5.1/test
88lua-5.1/test/README
89lua-5.1/test/bisect.lua88lua-5.1/test/bisect.lua
90lua-5.1/test/cf.lua89lua-5.1/test/cf.lua
91lua-5.1/test/echo.lua90lua-5.1/test/echo.lua
92lua-5.1/test/env.lua91lua-5.1/test/env.lua
93lua-5.1/test/factorial.lua92lua-5.1/test/factorial.lua
94lua-5.1/test/fib.lua
95lua-5.1/test/fibfor.lua93lua-5.1/test/fibfor.lua
94lua-5.1/test/fib.lua
96lua-5.1/test/globals.lua95lua-5.1/test/globals.lua
97lua-5.1/test/hello.lua96lua-5.1/test/hello.lua
98lua-5.1/test/life.lua97lua-5.1/test/life.lua
99lua-5.1/test/luac.lua98lua-5.1/test/luac.lua
100lua-5.1/test/printf.lua99lua-5.1/test/printf.lua
100lua-5.1/test/README
101lua-5.1/test/readonly.lua101lua-5.1/test/readonly.lua
102lua-5.1/test/sieve.lua102lua-5.1/test/sieve.lua
103lua-5.1/test/sort.lua103lua-5.1/test/sort.lua
doc/contents.html+3−1
@@ -93,7 +93,9 @@ Lua 5.1 Reference Manual · 92 unmodified lines
93<LI><A HREF="manual.html#5.9">5.9 - The Debug Library</A>93<LI><A HREF="manual.html#5.9">5.9 - The Debug Library</A>
94</UL>94</UL>
95<LI><A HREF="manual.html#6">6 - Lua Stand-alone</A>95<LI><A HREF="manual.html#6">6 - Lua Stand-alone</A>
96<LI><A HREF="manual.html#incompat">Incompatibilities with the Previous Version</A>
96<LI><A HREF="manual.html#BNF">The Complete Syntax of Lua</A>97<LI><A HREF="manual.html#BNF">The Complete Syntax of Lua</A>
98
97</UL>99</UL>
98 100
99<H2><A NAME="quick">Quick index</A></H2>101<H2><A NAME="quick">Quick index</A></H2>
@@ -396,7 +398,7 @@ Lua 5.1 Reference Manual · 296 unmodified lines
396<HR>398<HR>
397<SMALL>399<SMALL>
398Last update:400Last update:
399Tue Feb 7 14:37:59 BRST 2006401Fri Feb 10 17:15:37 BRST 2006
400</SMALL>402</SMALL>
401 403
402</BODY>404</BODY>
doc/manual.html+5−1
@@ -6059,7 +6059,7 @@ is a more portable solution.) · 6058 unmodified lines
6059 6059
6060<p><hr></hr>6060<p><hr></hr>
6061 6061
6062<p><h1>Incompatibilities with the Previous Version</h1>6062<p><a name="incompat"></a><h1>Incompatibilities with the Previous Version</h1>
6063 6063
6064 6064
6065<p>Here we list the incompatibilities that may be found when moving a program6065<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
6118Function <code>math.mod</code> was renamed <a href="#pdf-math.fmod"><code>math.fmod</code></a>.6118Function <code>math.mod</code> was renamed <a href="#pdf-math.fmod"><code>math.fmod</code></a>.
6119(Option <code>LUA_COMPAT_MOD</code>)6119(Option <code>LUA_COMPAT_MOD</code>)
6120 6120
6121<p><li>
6122Functions <code>table.foreach</code> and <code>table.foreachi</code> are deprecated.
6123You can use a for loop with <code>pairs</code> or <code>ipairs</code> instead.
6124
6121<p><li>6125<p><li>
6122There were substantial changes in function <a href="#pdf-require"><code>require</code></a> due to6126There were substantial changes in function <a href="#pdf-require"><code>require</code></a> due to
6123the new module system.6127the new module system.
etc/Makefile+1−1
@@ -16,7 +16,7 @@ MYLIBS= -lm · 15 unmodified lines
16RM= rm -f16RM= rm -f
17 17
18default:18default:
19 @echo 'Please choose a target: min noparser one clean'19 @echo 'Please choose a target: min noparser one strict clean'
20 20
21min: min.c21min: min.c
22 $(CC) $(CFLAGS) $@.c -L$(LIB) -llua $(MYLIBS)22 $(CC) $(CFLAGS) $@.c -L$(LIB) -llua $(MYLIBS)
etc/min.c+4−13
@@ -5,6 +5,7 @@ · 4 unmodified lines
5*/5*/
6 6
7#include <stdio.h>7#include <stdio.h>
8
8#include "lua.h"9#include "lua.h"
9#include "lauxlib.h"10#include "lauxlib.h"
10 11
@@ -17,32 +18,22 @@ static int print(lua_State *L) · 6 unmodified lines
17 if (i>1) printf("\t");18 if (i>1) printf("\t");
18 if (lua_isstring(L,i))19 if (lua_isstring(L,i))
19 printf("%s",lua_tostring(L,i));20 printf("%s",lua_tostring(L,i));
20 else if (lua_isnil(L,i))21 else if (lua_isnil(L,i)==2)
21 printf("%s","nil");22 printf("%s","nil");
22 else if (lua_isboolean(L,i))23 else if (lua_isboolean(L,i))
23 printf("%s",lua_toboolean(L,i) ? "true" : "false");24 printf("%s",lua_toboolean(L,i) ? "true" : "false");
24 else25 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));
26 }27 }
27 printf("\n");28 printf("\n");
28 return 0;29 return 0;
29}30}
30 31
31static 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
40int main(void)32int main(void)
41{33{
42 lua_State *L=lua_open();34 lua_State *L=lua_open();
43 lua_register(L,"print",print);35 lua_register(L,"print",print);
44 if (lua_load(L,getF,stdin,"=stdin") || lua_pcall(L,0,0,0))36 if (luaL_dofile(L,NULL)!=0) fprintf(stderr,"%s\n",lua_tostring(L,-1));
45 fprintf(stderr,"%s\n",lua_tostring(L,-1));
46 lua_close(L);37 lua_close(L);
47 return 0;38 return 0;
48}39}
src/lobject.c+3−1
@@ -1,5 +1,5 @@
1/*1/*
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 $
3** Some generic functions over Lua objects3** Some generic functions over Lua objects
4** See Copyright Notice in lua.h4** See Copyright Notice in lua.h
5*/5*/
@@ -91,6 +91,8 @@ int luaO_str2d (const char *s, lua_Number *result) { · 85 unmodified lines
91 char *endptr;91 char *endptr;
92 *result = lua_str2number(s, &endptr);92 *result = lua_str2number(s, &endptr);
93 if (endptr == s) return 0; /* conversion failed */93 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));
94 if (*endptr == '\0') return 1; /* most common case */96 if (*endptr == '\0') return 1; /* most common case */
95 while (isspace(cast(unsigned char, *endptr))) endptr++;97 while (isspace(cast(unsigned char, *endptr))) endptr++;
96 if (*endptr != '\0') return 0; /* invalid trailing characters? */98 if (*endptr != '\0') return 0; /* invalid trailing characters? */
src/luaconf.h+4−4
@@ -1,5 +1,5 @@
1/*1/*
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 $
3** Configuration file for Lua3** Configuration file for Lua
4** See Copyright Notice in lua.h4** See Copyright Notice in lua.h
5*/5*/
@@ -650,9 +650,9 @@ union luai_Cast { double l_d; long l_l; }; · 644 unmodified lines
650 650
651#else651#else
652 652
653#define lua_popen(L,c,m) \653#define lua_popen(L,c,m) ((void)((void)c, m), \
654 ((void)c, (void)m, luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)654 luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0)
655#define lua_pclose(L,file) ((void)L, (void)file, 0)655#define lua_pclose(L,file) ((void)((void)L, file), 0)
656 656
657#endif657#endif
658 658