diff options
Diffstat (limited to 'table.c')
| -rw-r--r-- | table.c | 13 |
1 files changed, 9 insertions, 4 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** Module to control static tables | 3 | ** Module to control static tables |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_table="$Id: table.c,v 2.32 1995/09/15 20:47:53 roberto Exp $"; | 6 | char *rcs_table="$Id: table.c,v 2.33 1995/10/04 14:20:26 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <string.h> | 8 | #include <string.h> |
| 9 | 9 | ||
| @@ -119,9 +119,8 @@ Word luaI_findsymbolbyname (char *name) | |||
| 119 | 119 | ||
| 120 | 120 | ||
| 121 | /* | 121 | /* |
| 122 | ** Given a name, search it at constant table and return its index. If not | 122 | ** Given a tree node, check it is has a correspondent constant index. If not, |
| 123 | ** found, allocate it. | 123 | ** allocate it. |
| 124 | ** On error, return -1. | ||
| 125 | */ | 124 | */ |
| 126 | Word luaI_findconstant (TreeNode *t) | 125 | Word luaI_findconstant (TreeNode *t) |
| 127 | { | 126 | { |
| @@ -146,6 +145,12 @@ Word luaI_findconstant (TreeNode *t) | |||
| 146 | } | 145 | } |
| 147 | 146 | ||
| 148 | 147 | ||
| 148 | Word luaI_findconstantbyname (char *name) | ||
| 149 | { | ||
| 150 | return luaI_findconstant(lua_constcreate(name)); | ||
| 151 | } | ||
| 152 | |||
| 153 | |||
| 149 | /* | 154 | /* |
| 150 | ** Traverse symbol table objects | 155 | ** Traverse symbol table objects |
| 151 | */ | 156 | */ |
