aboutsummaryrefslogtreecommitdiff
path: root/lua.stx
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-09-26 12:02:26 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-09-26 12:02:26 -0300
commita580480b07cdf7201306b246deeb2fe84f2c25a9 (patch)
tree30e9d4798228156eea5be2589834f1ff2db4355e /lua.stx
parent0dd6d1080e7f58eb17cb8a2ad3fc5801ed7c0532 (diff)
downloadlua-a580480b07cdf7201306b246deeb2fe84f2c25a9.tar.gz
lua-a580480b07cdf7201306b246deeb2fe84f2c25a9.tar.bz2
lua-a580480b07cdf7201306b246deeb2fe84f2c25a9.zip
new implementation for globals: Global value is stored in TaggedString
Diffstat (limited to 'lua.stx')
-rw-r--r--lua.stx8
1 files changed, 4 insertions, 4 deletions
diff --git a/lua.stx b/lua.stx
index dfb80ce3..2f650f4e 100644
--- a/lua.stx
+++ b/lua.stx
@@ -1,6 +1,6 @@
1%{ 1%{
2/* 2/*
3** $Id: lua.stx,v 1.4 1997/09/22 20:53:20 roberto Exp roberto $ 3** $Id: lua.stx,v 1.5 1997/09/24 19:43:11 roberto Exp roberto $
4** Syntax analizer and code generator 4** Syntax analizer and code generator
5** See Copyright Notice in lua.h 5** See Copyright Notice in lua.h
6*/ 6*/
@@ -203,13 +203,13 @@ static int next_constant (State *cs)
203static int string_constant (TaggedString *s, State *cs) 203static int string_constant (TaggedString *s, State *cs)
204{ 204{
205 TProtoFunc *f = cs->f; 205 TProtoFunc *f = cs->f;
206 int c = s->u.s.constindex; 206 int c = s->constindex;
207 if (!(0 <= c && c < f->nconsts && 207 if (!(c < f->nconsts &&
208 ttype(&f->consts[c]) == LUA_T_STRING && tsvalue(&f->consts[c]) == s)) { 208 ttype(&f->consts[c]) == LUA_T_STRING && tsvalue(&f->consts[c]) == s)) {
209 c = next_constant(cs); 209 c = next_constant(cs);
210 ttype(&f->consts[c]) = LUA_T_STRING; 210 ttype(&f->consts[c]) = LUA_T_STRING;
211 tsvalue(&f->consts[c]) = s; 211 tsvalue(&f->consts[c]) = s;
212 s->u.s.constindex = c; /* hint for next time */ 212 s->constindex = c; /* hint for next time */
213 } 213 }
214 return c; 214 return c;
215} 215}