From a580480b07cdf7201306b246deeb2fe84f2c25a9 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 26 Sep 1997 12:02:26 -0300 Subject: new implementation for globals: Global value is stored in TaggedString --- llex.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'llex.c') diff --git a/llex.c b/llex.c index 0cbce7eb..3d843224 100644 --- a/llex.c +++ b/llex.c @@ -1,5 +1,5 @@ /* -** $Id: $ +** $Id: llex.c,v 1.1 1997/09/16 19:25:59 roberto Exp roberto $ ** Lexical Analizer ** See Copyright Notice in lua.h */ @@ -8,7 +8,6 @@ #include #include -#include "lglobal.h" #include "llex.h" #include "lmem.h" #include "lobject.h" @@ -48,7 +47,7 @@ static void addReserved (void) firsttime = 0; for (i=0; i<(sizeof(reserved)/sizeof(reserved[0])); i++) { TaggedString *ts = luaS_new(reserved[i].name); - ts->marked = reserved[i].token; /* reserved word (always > 255) */ + ts->head.marked = reserved[i].token; /* reserved word (always > 255) */ } } } @@ -120,7 +119,7 @@ static int checkcond (char *buff) int i = luaO_findstring(buff, opts); if (i >= 0) return i; else if (isalpha((unsigned char)buff[0]) || buff[0] == '_') - return luaG_globaldefined(buff); + return luaS_globaldefined(buff); else { luaY_syntaxerror("invalid $if condition", buff); return 0; /* to avoid warnings */ @@ -451,8 +450,8 @@ int luaY_lex (void) } while (isalnum(current) || current == '_'); save(0); ts = luaS_new(textbuff.text); - if (ts->marked > 255) - return ts->marked; /* reserved word */ + if (ts->head.marked > 255) + return ts->head.marked; /* reserved word */ luaY_lval.pTStr = ts; return NAME; } -- cgit v1.2.3-55-g6feb