diff -r lua-5.2.0-work1/Makefile lua-5.2.0-work2/Makefile 66c66 < cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) --- > #cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) 72c72 < cd doc && cd $(INSTALL_MAN) && $(RM) $(TO_MAN) --- > #cd doc && cd $(INSTALL_MAN) && $(RM) $(TO_MAN) diff -r lua-5.2.0-work1/README lua-5.2.0-work2/README 1c1 < This is Lua 5.2 (work1), released on 08 Jan 2010. --- > This is Lua 5.2 (work2), released on 13 Jan 2010. diff -r lua-5.2.0-work1/doc/contents.html lua-5.2.0-work2/doc/contents.html 35c35 < Copyright © 2006-2010 Lua.org, PUC-Rio. --- > Copyright © 2010 Lua.org, PUC-Rio. 61a62 >
  • 2.4.8 - Lexical Environments 95,96c96,98 <
  • 3.7 - Functions and Types <
  • 3.8 - The Debug Interface --- >
  • 3.7 - Handling Yields in C >
  • 3.8 - Functions and Types >
  • 3.9 - The Debug Interface 115,117c117,120 <
  • 5.7 - Input and Output Facilities <
  • 5.8 - Operating System Facilities <
  • 5.9 - The Debug Library --- >
  • 5.7 - Bitwise operations >
  • 5.8 - Input and Output Facilities >
  • 5.9 - Operating System Facilities >
  • 5.10 - The Debug Library 143d145 < getfenv
    146a149 > loadin
    159d161 < setfenv
    164d165 < unpack
    167a169,177 > bit.band
    > bit.bnot
    > bit.bor
    > bit.brotate
    > bit.bshift
    > bit.btest
    > bit.bxor
    >

    > 189a200,201 > debug.upvalueid
    > debug.upvaluejoin
    235d246 < math.log10
    263a275 > package.config
    269a282 > package.searchpath
    291c304 < table.maxn
    --- > table.pack
    293a307 > table.unpack
    310a325 > lua_callk
    312a328 > lua_compare
    314c330 < lua_cpcall
    --- > lua_copy
    317d332 < lua_equal
    320a336 > lua_getctx
    324d339 < lua_gethook
    325a341 > lua_gethook
    347c363 < lua_lessthan
    --- > lua_len
    354d369 < lua_objlen
    355a371 > lua_pcallk
    372d387 < lua_rawget
    374c389,390 < lua_rawset
    --- > lua_rawget
    > lua_rawlen
    375a392 > lua_rawset
    401a419 > lua_upvalueid
    402a421,422 > lua_upvaluejoin
    > lua_version
    404a425 > lua_yieldk
    432a454 > luaL_checkversion
    438a461 > luaL_len
    454a478,481 > luaL_testudata
    > luaL_tolstring
    > luaL_traceback
    > luaL_typeerror
    456d482 < luaL_typerror
    468c494 < Fri Jan 8 16:29:00 BRST 2010 --- > Wed Jan 13 15:31:47 BRST 2010 471c497 < Last change: fake for Lua 5.2.0-work1 --- > Last change: revised for Lua 5.2.0 (work2) diff -r lua-5.2.0-work1/doc/lua.css lua-5.2.0-work2/doc/lua.css 41a42,46 > :target { > background-color: #F8F8F8 ; > padding: 8px ; > border: solid #a0a0a0 2px ; > } Only in lua-5.2.0-work2/doc: manual.css diff -r lua-5.2.0-work1/doc/manual.html lua-5.2.0-work2/doc/manual.html 1c1 < --- > 6c6,8 < --- > > > 9c11 < --- > 13c15 < [Lua logo] --- > 20,21c22,24 < Copyright < © 2010 Lua.org, PUC-Rio. All rights reserved. --- > Copyright © 2010 Lua.org, PUC-Rio. > Freely available under the terms of the > Lua license. 23a27,31 >

    > > contents > · > index 28c36 < --- > 169,170c177,180 < A character in a string can also be specified by its numerical value < using the escape sequence \ddd, --- > A character in a string can also be specified by its numerical value. > This can be done with the escape sequence \xXX, > where XX is a sequence of exactly two hexadecimal digits, > and with the escape sequence \ddd, 172c182 < (Note that if a numerical escape is to be followed by a digit, --- > (Note that if a decimal escape is to be followed by a digit, 2056c2066,2067 < (such as 2^30), --- > (larger than 10% of the maximum number of > bytes that the program may use), 5106a5118,5126 >


    lua_upvaluejoin

    >
    void lua_upvaluejoin (lua_State *L, int fidx1, int n1,
    >                                               int fidx2, int n2);

    > TO BE DONE!! > > > > > 6002a6023,6045 >


    luaL_tolstring

    > [-0, +1, e] >

    const char *luaL_tolstring (lua_State *L, int idx, size_t *len);
    > >

    > Converts any Lua value at the given acceptable index to a C string > in a reasonable format. > The resulting string is pushed onto the stack and also > returned by the function. > If len is not NULL, > the function also sets *len with the string length. > > >

    > If the value has a metatable with a "__tostring" field, > then luaL_tolstring calls the corresponding metamethod > with the value as argument, > and uses the result of the call as its result. > > > > > 6005,6006c6048,6049 <

    luaL_traceback (lua_State *L, lua_State *L1,
    <                           const char *msg, int level);
    --- >
    void luaL_traceback (lua_State *L, lua_State *L1,
    >                                const char *msg, int level);
    7114c7157,7158 < mark in the template by name, --- > mark in the template by a copy of name > wherein all dots were replaced by the system's directory separator, 7121c7165 < the search for name foo --- > the search for the name foo.a 7123,7124c7167,7168 < ./foo.lua, ./foo.lc, and < /usr/local/foo/init.lua, in that order. --- > ./foo/a.lua, ./foo/a.lc, and > /usr/local/foo/a/init.lua, in that order. 7129c7173 < open in read mode (after closing it), --- > open in read mode (after closing the file), 7953c7997 < The default for base is $e$ --- > The default for base is e 9142a9187,9216 >

    >


    debug.upvalueid (function, n)

    > > >

    > Returns an unique identifier (as a light userdata) > for the upvalue numbered n > from the given function. > > >

    > These unique identifiers allow a program to check whether different > closures share upvalues. > Lua closures that share an upvalue > (that is, that access a same external local variable) > will return identical ids for those upvalue indices. > > > > >

    >


    debug.upvaluejoin ()

    > > >

    > TO BE DONE!! > > > > 9322c9396 < All threads share a sinle fixed environment. --- > All threads share a single fixed environment. 9370c9444 < Pseudoindex LUA_GLOBALSINDEX was deprecated. --- > Pseudoindex LUA_GLOBALSINDEX was removed. 9486a9561,9570 > >


    > > Last update: > Wed Jan 13 15:29:29 BRST 2010 > > > diff -r lua-5.2.0-work1/doc/readme.html lua-5.2.0-work2/doc/readme.html 23a24,30 > > tt, kbd { > font-size: 120% ; > xcolor: black ; > xpadding: 4px ; > xbackground-color: #E0E0E0 ; > } 83d89 <
    how much detail?

    103c109 < In most Unix-like platforms, simply do "make" with a suitable target. --- > In most Unix-like platforms, simply do "make" with a suitable target. 114c120 < Do "make" and see if your platform is listed. --- > Do "make" and see if your platform is listed. 120c126 < If your platform is listed, just do "make xxx", where xxx --- > If your platform is listed, just do "make xxx", where xxx 134c140 < If you want to check that Lua has been built correctly, do "make test" --- > If you want to check that Lua has been built correctly, do "make test" 143c149 < place in your system. In this case, do "make install". The official --- > place in your system. In this case, do "make install". The official 148c154 < If you want to build and install Lua in one step, do "make xxx install", --- > If you want to build and install Lua in one step, do "make xxx install", 152,155c158,161 < If you want to install Lua locally, then do "make local". This will < create directories bin, include, lib, man, and install Lua there as < follows: < review! --- > If you want to install Lua locally, then do "make local". > This will create a directory install with subdirectories > bin, include, lib, man, > and install Lua there as follows: 188c194 < "make install INSTALL_TOP=xxx", where xxx is your chosen directory. --- > "make install INSTALL_TOP=xxx", where xxx is your chosen directory. 194,196c200,202 <

  • Where and how to install Lua – edit Makefile. <
  • How to build Lua – edit src/Makefile. <
  • Lua features – edit src/luaconf.h. --- >
  • Where and how to install Lua — edit Makefile. >
  • How to build Lua — edit src/Makefile. >
  • Lua features — edit src/luaconf.h. 207a214 > (Further customization is possible by editing the Lua sources.) 226,230c233,237 < lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c < lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c < ltable.c ltm.c lundump.c lvm.c lzio.c < lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c loslib.c < ltablib.c lstrlib.c loadlib.c linit.c --- > lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c > lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c > ltm.c lundump.c lvm.c lzio.c > lauxlib.c lbaselib.c lbitlib.c ldblib.c liolib.c lmathlib.c loslib.c > ltablib.c lstrlib.c loadlib.c linit.c 241c248 < If you use Visual Studio .NET, you can use etc/luavs.bat in its --- > If you use Visual Studio .NET, you can use etc/luavs.bat in its 246c253 < in a single project, except for luac.c and print.c. Or just use etc/all.c. --- > in a single project, except for luac.c and print.c. Or just use etc/one.c. 257c264 < For Windows, we recommend that the Lua library be DLL. --- > For Windows, we recommend that the Lua library be a DLL. 265d271 <
    incomplete!

    268c274 < The --- > The 276a283,287 >

  • no more fenv for threads. >
  • ephemeron tables. >
  • yieldable pcall/metamethods. >
  • tables honor the __len metamethod. >
  • max constants per function raised to 2^26. 278c289,290 <
  • tables and strings honor the __len metamethod. --- >
  • no more verification of opcode consistency. > 283c295 <
  • new function package.searchpath. --- >
  • new library for bitwise operations. 285a298,308 >
  • optional argument to load (to control binary x text). >
  • loadlib may load libraries with global names (RTLD_GLOBAL). >
  • new function package.searchpath. >
  • optional base in math.log. >
  • file:write returns file. >
  • closing a pipe returns exit status. >
  • os.exit may close state. >
  • new option 'isrunning' for collectgarbage and lua_gc. >
  • frontier patterns. >
  • ipairs now goes until #t. > 294c317 <
  • handling of non-string error messages. --- >
  • handling of non-string error messages in the standalone interpreter. 296c319,322 < relevant? --- >
  • CallInfo stack now is a linked list. >
  • internal (immutable) version of ctypes. >
  • parser uses much less C-stack space (no more auto arrays). >
  • new hash for floats. 320c346 < Copyright © 1994-2010 Lua.org, PUC-Rio. --- > Copyright © 1994–2010 Lua.org, PUC-Rio. 349c375 < Fri Jan 8 16:41:16 BRST 2010 --- > Wed Jan 13 15:35:05 BRST 2010 350a377,379 > diff -r lua-5.2.0-work1/etc/Makefile lua-5.2.0-work2/etc/Makefile 12c12 < MYCFLAGS= --- > MYCFLAGS= 23a24,25 > ./a.out $(TST)/hello.lua > echo 'print("Hello world, from",_VERSION,"!")' | ./a.out 32c34 < $(CC) $(CFLAGS) all.c $(MYLIBS) --- > $(CC) $(CFLAGS) one.c $(MYLIBS) diff -r lua-5.2.0-work1/etc/README lua-5.2.0-work2/etc/README 4,5c4,5 < If any of the makes fail, you're probably not using the same libraries < used to build Lua. Set MYLIBS in Makefile or in the command line accordingly. --- > If any of the makes fail, you're probably not using the same libraries used > to build Lua. Set MYLIBS in Makefile or in the command line accordingly. 7c7 < all.c --- > one.c Only in lua-5.2.0-work1/etc: all.c diff -r lua-5.2.0-work1/etc/luavs.bat lua-5.2.0-work2/etc/luavs.bat 1c1 < @rem Script to build Lua under "Visual Studio .NET Command Prompt". --- > @rem Script to build Lua 5.2 under "Visual Studio .NET Command Prompt". 3c3 < @rem It creates lua51.dll, lua51.lib, lua.exe, and luac.exe in src. --- > @rem It creates lua52.dll, lua52.lib, lua.exe, and luac.exe in src. 14,16c14,16 < %MYLINK% /DLL /out:lua51.dll l*.obj < if exist lua51.dll.manifest^ < %MYMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2 --- > %MYLINK% /DLL /out:lua52.dll l*.obj > if exist lua52.dll.manifest^ > %MYMT% -manifest lua52.dll.manifest -outputresource:lua52.dll;2 18c18 < %MYLINK% /out:lua.exe lua.obj lua51.lib --- > %MYLINK% /out:lua.exe lua.obj lua52.lib diff -r lua-5.2.0-work1/etc/min.c lua-5.2.0-work2/etc/min.c 3c3 < * runs one file from the command line or stdin if none given. --- > * runs one file from the command line or stdin if no file given. 18d17 < const char *s=""; 20,23c19 < { < printf("%s%s",s,luaL_tolstring(L,i,NULL)); < s="\t"; < } --- > printf("%s ",luaL_tolstring(L,i,NULL)); 30,31c26 < lua_State *L=lua_open(); < lua_register(L,"print",print); --- > lua_State *L=luaL_newstate(); 33c28,30 < if (luaL_dofile(L,argv[1])!=0) fprintf(stderr,"%s\n",lua_tostring(L,-1)); --- > lua_register(L,"print",print); > if (luaL_dofile(L,argv[1])!=0) > fprintf(stderr,"%s: %s\n",argv[0],lua_tostring(L,-1)); diff -r lua-5.2.0-work1/etc/noparser.c lua-5.2.0-work2/etc/noparser.c 37c37 < lua_pushliteral(L,"parser not loaded"); --- > lua_pushliteral(L,"parser not available"); 52c52 < lua_pushliteral(L,"dumper not loaded"); --- > lua_pushliteral(L,"dumper not available"); 66c66 < lua_pushliteral(L,"cannot load binary chunks"); --- > lua_pushliteral(L,"binary loader not available"); Only in lua-5.2.0-work2/etc: one.c diff -r lua-5.2.0-work1/etc/strict.lua lua-5.2.0-work2/etc/strict.lua 8a9 > require"debug" diff -r lua-5.2.0-work1/src/lapi.c lua-5.2.0-work2/src/lapi.c 2c2 < ** $Id: lapi.c,v 2.109 2010/01/08 15:16:56 roberto Exp $ --- > ** $Id: lapi.c,v 2.111 2010/01/13 16:18:25 roberto Exp $ 258c258 < return (t == LUA_TNONE) ? "no value" : luaT_typenames[t]; --- > return typename(t); 303c303,304 < luaV_arith(L, L->top - 2, L->top - 2, L->top - 1, op - LUA_OPADD + TM_ADD); --- > luaV_arith(L, L->top - 2, L->top - 2, L->top - 1, > cast(TMS, op - LUA_OPADD + TM_ADD)); diff -r lua-5.2.0-work1/src/lauxlib.h lua-5.2.0-work2/src/lauxlib.h 2c2 < ** $Id: lauxlib.h,v 1.98 2010/01/06 15:14:15 roberto Exp $ --- > ** $Id: lauxlib.h,v 1.99 2010/01/11 16:00:45 roberto Exp $ 32,33d31 < LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname, < const luaL_Reg *l, int nup); diff -r lua-5.2.0-work1/src/lbitlib.c lua-5.2.0-work2/src/lbitlib.c 2c2 < ** $Id: lbitlib.c,v 1.2 2009/11/24 12:05:44 roberto Exp $ --- > ** $Id: lbitlib.c,v 1.3 2010/01/12 19:40:02 roberto Exp $ 6a7,9 > #define lbitlib_c > #define LUA_LIB > diff -r lua-5.2.0-work1/src/lcode.c lua-5.2.0-work2/src/lcode.c 2c2 < ** $Id: lcode.c,v 2.42 2009/09/23 20:33:05 roberto Exp $ --- > ** $Id: lcode.c,v 2.43 2010/01/11 17:38:30 roberto Exp $ 833c833 < codearith(fs, op - OPR_ADD + OP_ADD, e1, e2); --- > codearith(fs, cast(OpCode, op - OPR_ADD + OP_ADD), e1, e2); 837c837 < codecomp(fs, op - OPR_EQ + OP_EQ, 1, e1, e2); --- > codecomp(fs, cast(OpCode, op - OPR_EQ + OP_EQ), 1, e1, e2); 841c841 < codecomp(fs, op - OPR_NE + OP_EQ, 0, e1, e2); --- > codecomp(fs, cast(OpCode, op - OPR_NE + OP_EQ), 0, e1, e2); diff -r lua-5.2.0-work1/src/ldebug.c lua-5.2.0-work2/src/ldebug.c 2c2 < ** $Id: ldebug.c,v 2.61 2010/01/06 14:42:35 roberto Exp $ --- > ** $Id: ldebug.c,v 2.63 2010/01/13 16:18:25 roberto Exp $ 366c366 < TMS tm = 0; --- > TMS tm; 419c419 < const char *t = luaT_typenames[ttype(o)]; --- > const char *t = typename(ttype(o)); 447,449c447,449 < const char *t1 = luaT_typenames[ttype(p1)]; < const char *t2 = luaT_typenames[ttype(p2)]; < if (t1[2] == t2[2]) --- > const char *t1 = typename(ttype(p1)); > const char *t2 = typename(ttype(p2)); > if (t1 == t2) diff -r lua-5.2.0-work1/src/ldo.c lua-5.2.0-work2/src/ldo.c 2c2 < ** $Id: ldo.c,v 2.79 2009/12/22 15:32:50 roberto Exp $ --- > ** $Id: ldo.c,v 2.80 2010/01/13 16:17:32 roberto Exp $ 557,558c557,562 < if (L->nny > 0) < luaG_runerror(L, "attempt to yield across metamethod/C-call boundary"); --- > if (L->nny > 0) { > if (L != G(L)->mainthread) > luaG_runerror(L, "attempt to yield across metamethod/C-call boundary"); > else > luaG_runerror(L, "attempt to yield from outside a coroutine"); > } diff -r lua-5.2.0-work1/src/loadlib.c lua-5.2.0-work2/src/loadlib.c 2c2 < ** $Id: loadlib.c,v 1.73 2010/01/06 14:35:17 roberto Exp $ --- > ** $Id: loadlib.c,v 1.80 2010/01/13 16:30:27 roberto Exp $ 131a132 > #include 134a136,143 > /* > ** optional flags for LoadLibraryEx > */ > #if !defined(LUA_LLE_FLAGS) > #define LUA_LLE_FLAGS 0 > #endif > > 161c170 < FreeLibrary((HINSTANCE)lib); --- > FreeLibrary((HMODULE)lib); 166c175 < HINSTANCE lib = LoadLibrary(path); --- > HMODULE lib = LoadLibraryEx(path, NULL, LUA_LLE_FLAGS); 174c183 < lua_CFunction f = (lua_CFunction)GetProcAddress((HINSTANCE)lib, sym); --- > lua_CFunction f = (lua_CFunction)GetProcAddress((HMODULE)lib, sym); 347c356,358 < lua_pushcfunction(L, f); /* else return function */ --- > lua_pushcfunction(L, f); /* else create new function... */ > lua_pushglobaltable(L); /* ... and set the standard global table... */ > lua_setfenv(L, -2); /* ... as its environment */ 396a408 > name = luaL_gsub(L, name, ".", LUA_DIRSEP); 426d437 < name = luaL_gsub(L, name, ".", LUA_DIRSEP); 452c463 < static int loadfunc(lua_State *L, const char *filename, const char *modname) { --- > static int loadfunc (lua_State *L, const char *filename, const char *modname) { 454,458c465,476 < const char *mark = strchr(modname, *LUA_IGMARK); < if (mark) modname = mark + 1; < funcname = luaL_gsub(L, modname, ".", LUA_OFSEP); < funcname = lua_pushfstring(L, POF"%s", funcname); < lua_remove(L, -2); /* remove 'gsub' result */ --- > const char *mark; > modname = luaL_gsub(L, modname, ".", LUA_OFSEP); > mark = strchr(modname, *LUA_IGMARK); > if (mark) { > int stat; > funcname = lua_pushlstring(L, modname, mark - modname); > funcname = lua_pushfstring(L, POF"%s", funcname); > stat = ll_loadfunc(L, filename, funcname); > if (stat != ERRFUNC) return stat; > modname = mark + 1; /* else go ahead and try old-style name */ > } > funcname = lua_pushfstring(L, POF"%s", modname); diff -r lua-5.2.0-work1/src/ltablib.c lua-5.2.0-work2/src/ltablib.c 2c2 < ** $Id: ltablib.c,v 1.53 2009/12/28 16:30:31 roberto Exp $ --- > ** $Id: ltablib.c,v 1.54 2010/01/13 19:59:10 roberto Exp $ 180a181,182 > /* remove new table from environment to allow its later collection */ > lua_copy(L, LUA_REGISTRYINDEX, LUA_ENVIRONINDEX); diff -r lua-5.2.0-work1/src/ltm.c lua-5.2.0-work2/src/ltm.c 2c2 < ** $Id: ltm.c,v 2.10 2009/11/19 19:06:52 roberto Exp $ --- > ** $Id: ltm.c,v 2.11 2010/01/13 16:18:25 roberto Exp $ 21a22 > static const char udatatypename[] = "userdata"; 23,25c24,27 < LUAI_DDEF const char *const luaT_typenames[] = { < "nil", "boolean", "userdata", "number", < "string", "table", "function", "userdata", "thread", --- > LUAI_DDEF const char *const luaT_typenames_[] = { > "no value", > "nil", "boolean", udatatypename, "number", > "string", "table", "function", udatatypename, "thread", diff -r lua-5.2.0-work1/src/ltm.h lua-5.2.0-work2/src/ltm.h 2c2 < ** $Id: ltm.h,v 2.8 2009/11/19 19:06:52 roberto Exp $ --- > ** $Id: ltm.h,v 2.9 2010/01/13 16:18:25 roberto Exp $ 46c46,48 < LUAI_DDEC const char *const luaT_typenames[]; --- > #define typename(x) luaT_typenames_[(x) + 1] > > LUAI_DDEC const char *const luaT_typenames_[]; diff -r lua-5.2.0-work1/src/lua.h lua-5.2.0-work2/src/lua.h 2c2 < ** $Id: lua.h,v 1.260 2010/01/06 15:08:00 roberto Exp $ --- > ** $Id: lua.h,v 1.261 2010/01/11 17:15:11 roberto Exp $ 20c20 < #define LUA_RELEASE "Lua 5.2.0 (work1)" --- > #define LUA_RELEASE "Lua 5.2.0 (work2)" 22c22 < #define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2008 Lua.org, PUC-Rio" --- > #define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2010 Lua.org, PUC-Rio" 398c398 < * Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved. --- > * Copyright (C) 1994-2010 Lua.org, PUC-Rio. All rights reserved. diff -r lua-5.2.0-work1/src/luaconf.h lua-5.2.0-work2/src/luaconf.h 2c2 < ** $Id: luaconf.h,v 1.127 2010/01/06 15:15:04 roberto Exp $ --- > ** $Id: luaconf.h,v 1.130 2010/01/11 17:15:30 roberto Exp $ 37d36 < #include 95,96c94,95 < #define LUA_LDIR LUA_ROOT "share/lua/5.1/" < #define LUA_CDIR LUA_ROOT "lib/lua/5.1/" --- > #define LUA_LDIR LUA_ROOT "share/lua/5.2/" > #define LUA_CDIR LUA_ROOT "lib/lua/5.2/" 443c442 < #define lua_number2int(i,d) __asm fld d __asm fistp i --- > #define lua_number2int(i,d) {__asm fld d __asm fistp i} 444a444 > #define lua_number2uint(i,n) lua_number2int(i, n)