diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-01-26 16:03:19 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-01-26 16:03:19 -0200 |
| commit | 0d50b87aa47d3cb64730bf5c8646e5e6ff02c268 (patch) | |
| tree | adfab90a2efad542f12d7d7b0219226deedcb7a5 /tree.c | |
| parent | 19290a8e92a9b22f448b82c2bcb67ea635dee6ad (diff) | |
| download | lua-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.c | 20 |
1 files changed, 1 insertions, 19 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_tree="$Id: tree.c,v 1.13 1995/01/12 14:19:04 roberto Exp roberto $"; | 6 | char *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 | */ | ||
| 109 | static 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 | |||
| 119 | TreeNode *luaI_nodebysymbol (Word symbol) | ||
| 120 | { | ||
| 121 | return nodebysymbol(constant_root, symbol); | ||
| 122 | } | ||
| 123 | |||
