first version of empty entries in tables

(so that, in the future, tables can contain regular nil entries)
This commit is contained in:
Roberto Ierusalimschy
2018-02-23 10:16:18 -03:00
parent 477ca2fe8c
commit 9243c414d9
11 changed files with 146 additions and 99 deletions

8
ltm.h
View File

@@ -1,5 +1,5 @@
/*
** $Id: ltm.h,v 2.31 2018/02/09 15:16:06 roberto Exp roberto $
** $Id: ltm.h,v 2.32 2018/02/17 19:20:00 roberto Exp roberto $
** Tag methods
** See Copyright Notice in lua.h
*/
@@ -45,6 +45,12 @@ typedef enum {
} TMS;
/*
** Test whether there is no tagmethod.
** (Because tagmethods use raw accesses, the result may be an "empty" nil.)
*/
#define notm(tm) ttisnilorempty(tm)
#define gfasttm(g,et,e) ((et) == NULL ? NULL : \
((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))