Showing the changes to src (4 of 7 files). Show all
Unified · Split
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | −** $Id: lbitlib.c,v 1.11 2010/11/08 16:31:22 roberto Exp $ | |
| 2 | +** $Id: lbitlib.c,v 1.13 2010/11/22 18:06:33 roberto Exp $ | |
| 3 | 3 | ** Standard library for bitwise operations |
| 4 | 4 | ** See Copyright Notice in lua.h |
| 5 | 5 | */ |
| @@ -130,27 +130,27 @@ static int b_rot (lua_State *L, int i) { · 124 unmodified lines | ||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| 133 | −static int b_rol (lua_State *L) { | |
| 133 | +static int b_lrot (lua_State *L) { | |
| 134 | 134 | return b_rot(L, luaL_checkint(L, 2)); |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
| 138 | −static int b_ror (lua_State *L) { | |
| 138 | +static int b_rrot (lua_State *L) { | |
| 139 | 139 | return b_rot(L, -luaL_checkint(L, 2)); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | |
| 143 | 143 | static const luaL_Reg bitlib[] = { |
| 144 | − {"AND", b_and}, | |
| 145 | − {"TEST", b_test}, | |
| 146 | − {"OR", b_or}, | |
| 147 | − {"XOR", b_xor}, | |
| 148 | − {"NOT", b_not}, | |
| 149 | − {"SHL", b_lshift}, | |
| 150 | − {"SAR", b_arshift}, | |
| 151 | − {"SHR", b_rshift}, | |
| 152 | − {"ROL", b_rol}, | |
| 153 | − {"ROR", b_ror}, | |
| 144 | + {"arshift", b_arshift}, | |
| 145 | + {"band", b_and}, | |
| 146 | + {"bnot", b_not}, | |
| 147 | + {"bor", b_or}, | |
| 148 | + {"bxor", b_xor}, | |
| 149 | + {"lrotate", b_lrot}, | |
| 150 | + {"lshift", b_lshift}, | |
| 151 | + {"rrotate", b_rrot}, | |
| 152 | + {"rshift", b_rshift}, | |
| 153 | + {"btest", b_test}, | |
| 154 | 154 | {NULL, NULL} |
| 155 | 155 | }; |
| 156 | 156 | |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | −** $Id: llex.c,v 2.40 2010/10/25 12:24:36 roberto Exp $ | |
| 2 | +** $Id: llex.c,v 2.41 2010/11/18 18:38:44 roberto Exp $ | |
| 3 | 3 | ** Lexical Analyzer |
| 4 | 4 | ** See Copyright Notice in lua.h |
| 5 | 5 | */ |
| @@ -471,10 +471,10 @@ static int llex (LexState *ls, SemInfo *seminfo) { · 465 unmodified lines | ||
| 471 | 471 | } while (lislalnum(ls->current)); |
| 472 | 472 | ts = luaX_newstring(ls, luaZ_buffer(ls->buff), |
| 473 | 473 | luaZ_bufflen(ls->buff)); |
| 474 | + seminfo->ts = ts; | |
| 474 | 475 | if (ts->tsv.reserved > 0) /* reserved word? */ |
| 475 | 476 | return ts->tsv.reserved - 1 + FIRST_RESERVED; |
| 476 | 477 | else { |
| 477 | − seminfo->ts = ts; | |
| 478 | 478 | return TK_NAME; |
| 479 | 479 | } |
| 480 | 480 | } |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | −** $Id: lmathlib.c,v 1.78 2010/11/12 15:47:34 roberto Exp $ | |
| 2 | +** $Id: lmathlib.c,v 1.79 2010/11/18 18:38:27 roberto Exp $ | |
| 3 | 3 | ** Standard mathematical library |
| 4 | 4 | ** See Copyright Notice in lua.h |
| 5 | 5 | */ |
| @@ -136,11 +136,12 @@ static int math_log (lua_State *L) { · 130 unmodified lines | ||
| 136 | 136 | |
| 137 | 137 | static int math_log10 (lua_State *L) { |
| 138 | 138 | #if !defined(LUA_COMPAT_LOG10) |
| 139 | − luaL_error(L, "function " LUA_QL("log10") | |
| 140 | − " is deprecated; use log(x, 10) instead"); | |
| 141 | −#endif | |
| 139 | + return luaL_error(L, "function " LUA_QL("log10") | |
| 140 | + " is deprecated; use log(x, 10) instead"); | |
| 141 | +#else | |
| 142 | 142 | lua_pushnumber(L, l_tg(log10)(luaL_checknumber(L, 1))); |
| 143 | 143 | return 1; |
| 144 | +#endif | |
| 144 | 145 | } |
| 145 | 146 | |
| 146 | 147 | static int math_exp (lua_State *L) { |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | −** $Id: lstrlib.c,v 1.158 2010/11/16 20:39:41 roberto Exp $ | |
| 2 | +** $Id: lstrlib.c,v 1.159 2010/11/19 16:25:51 roberto Exp $ | |
| 3 | 3 | ** Standard library for string operations and pattern-matching |
| 4 | 4 | ** See Copyright Notice in lua.h |
| 5 | 5 | */ |
| @@ -614,12 +614,6 @@ static int gmatch (lua_State *L) { · 608 unmodified lines | ||
| 614 | 614 | } |
| 615 | 615 | |
| 616 | 616 | |
| 617 | −static int gfind_nodef (lua_State *L) { | |
| 618 | − return luaL_error(L, LUA_QL("string.gfind") " was renamed to " | |
| 619 | − LUA_QL("string.gmatch")); | |
| 620 | −} | |
| 621 | − | |
| 622 | − | |
| 623 | 617 | static void add_s (MatchState *ms, luaL_Buffer *b, const char *s, |
| 624 | 618 | const char *e) { |
| 625 | 619 | size_t l, i; |
| @@ -912,7 +906,6 @@ static const luaL_Reg strlib[] = { · 286 unmodified lines | ||
| 912 | 906 | {"dump", str_dump}, |
| 913 | 907 | {"find", str_find}, |
| 914 | 908 | {"format", str_format}, |
| 915 | − {"gfind", gfind_nodef}, | |
| 916 | 909 | {"gmatch", gmatch}, |
| 917 | 910 | {"gsub", str_gsub}, |
| 918 | 911 | {"len", str_len}, |