diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-01-23 21:04:07 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-01-23 21:04:07 -0200 |
commit | d19f1da6effe07a48b64b226f9b193348da24801 (patch) | |
tree | 8be931f9ce1fe1eb64e289ed19591e42fb822dfd /lstring.h | |
parent | f88806a1fbf333b9495ffb9049c67ba27a3a6d49 (diff) | |
download | lua-d19f1da6effe07a48b64b226f9b193348da24801.tar.gz lua-d19f1da6effe07a48b64b226f9b193348da24801.tar.bz2 lua-d19f1da6effe07a48b64b226f9b193348da24801.zip |
new macro 'isreserved' + 'eqstr' -> 'luaS_eqstr' (may be a function)
Diffstat (limited to 'lstring.h')
-rw-r--r-- | lstring.h | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.h,v 1.45 2010/04/03 20:24:18 roberto Exp roberto $ | 2 | ** $Id: lstring.h,v 1.46 2010/04/05 16:26:37 roberto Exp roberto $ |
3 | ** String table (keep all strings handled by Lua) | 3 | ** String table (keep all strings handled by Lua) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -23,10 +23,16 @@ | |||
23 | 23 | ||
24 | 24 | ||
25 | /* | 25 | /* |
26 | ** as all string are internalized, string equality becomes | 26 | ** test whether a string is a reserved word |
27 | ** pointer equality | ||
28 | */ | 27 | */ |
29 | #define eqstr(a,b) ((a) == (b)) | 28 | #define isreserved(s) ((s)->tsv.extra > 0) |
29 | |||
30 | |||
31 | /* | ||
32 | ** equality for strings, which are always internalized | ||
33 | */ | ||
34 | #define luaS_eqstr(a,b) ((a) == (b)) | ||
35 | |||
30 | 36 | ||
31 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); | 37 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); |
32 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); | 38 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); |