aboutsummaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-01-26 16:03:19 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-01-26 16:03:19 -0200
commit0d50b87aa47d3cb64730bf5c8646e5e6ff02c268 (patch)
treeadfab90a2efad542f12d7d7b0219226deedcb7a5 /tree.c
parent19290a8e92a9b22f448b82c2bcb67ea635dee6ad (diff)
downloadlua-0d50b87aa47d3cb64730bf5c8646e5e6ff02c268.tar.gz
lua-0d50b87aa47d3cb64730bf5c8646e5e6ff02c268.tar.bz2
lua-0d50b87aa47d3cb64730bf5c8646e5e6ff02c268.zip
lua_table now has references to global variable names (TreeNode's).
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/tree.c b/tree.c
index 4710ac44..f511436a 100644
--- a/tree.c
+++ b/tree.c
@@ -3,7 +3,7 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_tree="$Id: tree.c,v 1.13 1995/01/12 14:19:04 roberto Exp roberto $"; 6char *rcs_tree="$Id: tree.c,v 1.14 1995/10/17 11:53:53 roberto Exp roberto $";
7 7
8 8
9#include <string.h> 9#include <string.h>
@@ -103,21 +103,3 @@ Long lua_strcollector (void)
103} 103}
104 104
105 105
106/*
107** Traverse the constant tree looking for a specific symbol number
108*/
109static TreeNode *nodebysymbol (TreeNode *root, Word symbol)
110{
111 TreeNode *t;
112 if (root == NULL) return NULL;
113 if (root->varindex == symbol) return root;
114 t = nodebysymbol(root->left, symbol);
115 if (t) return t;
116 return nodebysymbol(root->right, symbol);
117}
118
119TreeNode *luaI_nodebysymbol (Word symbol)
120{
121 return nodebysymbol(constant_root, symbol);
122}
123