new function "luaI_findconstantbyname".

This commit is contained in:
Roberto Ierusalimschy
1995-10-13 12:16:25 -03:00
parent b074306267
commit b17c76817d
4 changed files with 16 additions and 10 deletions

13
table.c
View File

@@ -3,7 +3,7 @@
** Module to control static tables
*/
char *rcs_table="$Id: table.c,v 2.32 1995/09/15 20:47:53 roberto Exp $";
char *rcs_table="$Id: table.c,v 2.33 1995/10/04 14:20:26 roberto Exp roberto $";
#include <string.h>
@@ -119,9 +119,8 @@ Word luaI_findsymbolbyname (char *name)
/*
** Given a name, search it at constant table and return its index. If not
** found, allocate it.
** On error, return -1.
** Given a tree node, check it is has a correspondent constant index. If not,
** allocate it.
*/
Word luaI_findconstant (TreeNode *t)
{
@@ -146,6 +145,12 @@ Word luaI_findconstant (TreeNode *t)
}
Word luaI_findconstantbyname (char *name)
{
return luaI_findconstant(lua_constcreate(name));
}
/*
** Traverse symbol table objects
*/