diff options
author | Lua Team <team@lua.org> | 2006-02-10 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 2006-02-10 12:00:00 +0000 |
commit | 69c6ee1f592c6588bc11a8e02811230e77e984cf (patch) | |
tree | ae575c9f18e9e50b14829ccffa1a85a3d165f08e | |
parent | 43fb64048e381a76d6cd363dedd9ccc8a85b9b31 (diff) | |
download | lua-github-69c6ee1f592c6588bc11a8e02811230e77e984cf.tar.gz |
Lua 5.1-rc45.1-rc4
-rw-r--r-- | MANIFEST | 28 | ||||
-rw-r--r-- | doc/contents.html | 4 | ||||
-rw-r--r-- | doc/manual.html | 6 | ||||
-rw-r--r-- | etc/Makefile | 2 | ||||
-rw-r--r-- | etc/min.c | 17 | ||||
-rw-r--r-- | src/lobject.c | 4 | ||||
-rw-r--r-- | src/luaconf.h | 8 |
7 files changed, 34 insertions, 35 deletions
@@ -1,34 +1,33 @@ -MANIFEST contents of Lua 5.1 distribution on Tue Feb 7 15:05:04 BRST 2006 +MANIFEST contents of Lua 5.1 distribution on Fri Feb 10 17:19:52 BRST 2006 lua-5.1 lua-5.1/COPYRIGHT -lua-5.1/HISTORY -lua-5.1/INSTALL -lua-5.1/MANIFEST -lua-5.1/Makefile -lua-5.1/README lua-5.1/doc lua-5.1/doc/contents.html lua-5.1/doc/logo.gif lua-5.1/doc/lua.1 -lua-5.1/doc/lua.css -lua-5.1/doc/lua.html lua-5.1/doc/luac.1 lua-5.1/doc/luac.html +lua-5.1/doc/lua.css +lua-5.1/doc/lua.html lua-5.1/doc/manual.html lua-5.1/doc/readme.html lua-5.1/etc -lua-5.1/etc/Makefile -lua-5.1/etc/README lua-5.1/etc/all.c lua-5.1/etc/lua.hpp lua-5.1/etc/lua.ico lua-5.1/etc/lua.pc lua-5.1/etc/luavs.bat +lua-5.1/etc/Makefile lua-5.1/etc/min.c lua-5.1/etc/noparser.c +lua-5.1/etc/README lua-5.1/etc/strict.lua +lua-5.1/HISTORY +lua-5.1/INSTALL +lua-5.1/Makefile +lua-5.1/MANIFEST +lua-5.1/README lua-5.1/src -lua-5.1/src/Makefile lua-5.1/src/lapi.c lua-5.1/src/lapi.h lua-5.1/src/lauxlib.c @@ -73,9 +72,9 @@ lua-5.1/src/ltablib.c lua-5.1/src/ltm.c lua-5.1/src/ltm.h lua-5.1/src/lua.c -lua-5.1/src/lua.h lua-5.1/src/luac.c lua-5.1/src/luaconf.h +lua-5.1/src/lua.h lua-5.1/src/lualib.h lua-5.1/src/lundump.c lua-5.1/src/lundump.h @@ -83,21 +82,22 @@ lua-5.1/src/lvm.c lua-5.1/src/lvm.h lua-5.1/src/lzio.c lua-5.1/src/lzio.h +lua-5.1/src/Makefile lua-5.1/src/print.c lua-5.1/test -lua-5.1/test/README lua-5.1/test/bisect.lua lua-5.1/test/cf.lua lua-5.1/test/echo.lua lua-5.1/test/env.lua lua-5.1/test/factorial.lua -lua-5.1/test/fib.lua lua-5.1/test/fibfor.lua +lua-5.1/test/fib.lua lua-5.1/test/globals.lua lua-5.1/test/hello.lua lua-5.1/test/life.lua lua-5.1/test/luac.lua lua-5.1/test/printf.lua +lua-5.1/test/README lua-5.1/test/readonly.lua lua-5.1/test/sieve.lua lua-5.1/test/sort.lua diff --git a/doc/contents.html b/doc/contents.html index 323bfaef..564377c9 100644 --- a/doc/contents.html +++ b/doc/contents.html @@ -93,7 +93,9 @@ Lua 5.1 Reference Manual <LI><A HREF="manual.html#5.9">5.9 - The Debug Library</A> </UL> <LI><A HREF="manual.html#6">6 - Lua Stand-alone</A> +<LI><A HREF="manual.html#incompat">Incompatibilities with the Previous Version</A> <LI><A HREF="manual.html#BNF">The Complete Syntax of Lua</A> + </UL> <H2><A NAME="quick">Quick index</A></H2> @@ -396,7 +398,7 @@ Lua 5.1 Reference Manual <HR> <SMALL> Last update: -Tue Feb 7 14:37:59 BRST 2006 +Fri Feb 10 17:15:37 BRST 2006 </SMALL> </BODY> diff --git a/doc/manual.html b/doc/manual.html index e7a3cfa4..3ec55870 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -6059,7 +6059,7 @@ is a more portable solution.) <p><hr></hr> -<p><h1>Incompatibilities with the Previous Version</h1> +<p><a name="incompat"></a><h1>Incompatibilities with the Previous Version</h1> <p>Here we list the incompatibilities that may be found when moving a program @@ -6119,6 +6119,10 @@ Function <code>math.mod</code> was renamed <a href="#pdf-math.fmod"><code>math.f (Option <code>LUA_COMPAT_MOD</code>) <p><li> +Functions <code>table.foreach</code> and <code>table.foreachi</code> are deprecated. +You can use a for loop with <code>pairs</code> or <code>ipairs</code> instead. + +<p><li> There were substantial changes in function <a href="#pdf-require"><code>require</code></a> due to the new module system. However, the new behavior is mostly compatible with the old, diff --git a/etc/Makefile b/etc/Makefile index 02f09423..6d00008d 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -16,7 +16,7 @@ MYLIBS= -lm RM= rm -f default: - @echo 'Please choose a target: min noparser one clean' + @echo 'Please choose a target: min noparser one strict clean' min: min.c $(CC) $(CFLAGS) $@.c -L$(LIB) -llua $(MYLIBS) @@ -5,6 +5,7 @@ */ #include <stdio.h> + #include "lua.h" #include "lauxlib.h" @@ -17,32 +18,22 @@ static int print(lua_State *L) if (i>1) printf("\t"); if (lua_isstring(L,i)) printf("%s",lua_tostring(L,i)); - else if (lua_isnil(L,i)) + else if (lua_isnil(L,i)==2) printf("%s","nil"); else if (lua_isboolean(L,i)) printf("%s",lua_toboolean(L,i) ? "true" : "false"); else - printf("%s:%p",lua_typename(L,lua_type(L,i)),lua_topointer(L,i)); + printf("%s:%p",luaL_typename(L,i),lua_topointer(L,i)); } printf("\n"); return 0; } -static const char *getF(lua_State *L, void *ud, size_t *size) -{ - FILE *f=(FILE *)ud; - static char buff[512]; - if (feof(f)) return NULL; - *size=fread(buff,1,sizeof(buff),f); - return (*size>0) ? buff : NULL; -} - int main(void) { lua_State *L=lua_open(); lua_register(L,"print",print); - if (lua_load(L,getF,stdin,"=stdin") || lua_pcall(L,0,0,0)) - fprintf(stderr,"%s\n",lua_tostring(L,-1)); + if (luaL_dofile(L,NULL)!=0) fprintf(stderr,"%s\n",lua_tostring(L,-1)); lua_close(L); return 0; } diff --git a/src/lobject.c b/src/lobject.c index e83b5240..acde82cc 100644 --- a/src/lobject.c +++ b/src/lobject.c @@ -1,5 +1,5 @@ /* -** $Id: lobject.c,v 2.21 2006/01/10 12:50:00 roberto Exp $ +** $Id: lobject.c,v 2.22 2006/02/10 17:43:52 roberto Exp $ ** Some generic functions over Lua objects ** See Copyright Notice in lua.h */ @@ -91,6 +91,8 @@ int luaO_str2d (const char *s, lua_Number *result) { char *endptr; *result = lua_str2number(s, &endptr); if (endptr == s) return 0; /* conversion failed */ + if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */ + *result = cast_num(strtoul(s, &endptr, 16)); if (*endptr == '\0') return 1; /* most common case */ while (isspace(cast(unsigned char, *endptr))) endptr++; if (*endptr != '\0') return 0; /* invalid trailing characters? */ diff --git a/src/luaconf.h b/src/luaconf.h index 3f3e2bbe..97a3e30c 100644 --- a/src/luaconf.h +++ b/src/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.80 2006/01/27 13:54:39 roberto Exp $ +** $Id: luaconf.h,v 1.81 2006/02/10 17:44:06 roberto Exp $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -650,9 +650,9 @@ union luai_Cast { double l_d; long l_l; }; #else -#define lua_popen(L,c,m) \ - ((void)c, (void)m, luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) -#define lua_pclose(L,file) ((void)L, (void)file, 0) +#define lua_popen(L,c,m) ((void)((void)c, m), \ + luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) +#define lua_pclose(L,file) ((void)((void)L, file), 0) #endif |