diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1995-10-13 12:16:25 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1995-10-13 12:16:25 -0300 |
commit | b17c76817d008de0e0de460c5d0fac4741d0fe02 (patch) | |
tree | 02b5b942ab01853a5be4f385dceb8ec567c13008 /table.c | |
parent | b074306267b70015d770cb33c78dcf6cfe53fb45 (diff) | |
download | lua-b17c76817d008de0e0de460c5d0fac4741d0fe02.tar.gz lua-b17c76817d008de0e0de460c5d0fac4741d0fe02.tar.bz2 lua-b17c76817d008de0e0de460c5d0fac4741d0fe02.zip |
new function "luaI_findconstantbyname".
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 | */ |