aboutsummaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-18 10:36:14 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-18 10:36:14 -0300
commitca41b43f53562e64abe433d6346d174c92548603 (patch)
tree03f7a99f76359fc1e0bbc45fc13e579ff2aafabb /llex.c
parent3511e186cde4b78f268d17199d0f46fb3eaa9638 (diff)
downloadlua-ca41b43f53562e64abe433d6346d174c92548603.tar.gz
lua-ca41b43f53562e64abe433d6346d174c92548603.tar.bz2
lua-ca41b43f53562e64abe433d6346d174c92548603.zip
type 'TString' refers directly to the structure inside the union
(union used only for size purposes)
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/llex.c b/llex.c
index 6b5dd7d5..4f8756a6 100644
--- a/llex.c
+++ b/llex.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.c,v 2.78 2014/05/21 15:22:02 roberto Exp roberto $ 2** $Id: llex.c,v 2.79 2014/07/18 12:17:54 roberto Exp roberto $
3** Lexical Analyzer 3** Lexical Analyzer
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -67,11 +67,11 @@ static void save (LexState *ls, int c) {
67void luaX_init (lua_State *L) { 67void luaX_init (lua_State *L) {
68 int i; 68 int i;
69 TString *e = luaS_new(L, LUA_ENV); /* create env name */ 69 TString *e = luaS_new(L, LUA_ENV); /* create env name */
70 luaC_fix(L, ts2gco(e)); /* never collect this name */ 70 luaC_fix(L, obj2gco(e)); /* never collect this name */
71 for (i=0; i<NUM_RESERVED; i++) { 71 for (i=0; i<NUM_RESERVED; i++) {
72 TString *ts = luaS_new(L, luaX_tokens[i]); 72 TString *ts = luaS_new(L, luaX_tokens[i]);
73 luaC_fix(L, ts2gco(ts)); /* reserved words are never collected */ 73 luaC_fix(L, obj2gco(ts)); /* reserved words are never collected */
74 ts->tsv.extra = cast_byte(i+1); /* reserved word */ 74 ts->extra = cast_byte(i+1); /* reserved word */
75 } 75 }
76} 76}
77 77
@@ -137,7 +137,7 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
137 luaC_checkGC(L); 137 luaC_checkGC(L);
138 } 138 }
139 else { /* string already present */ 139 else { /* string already present */
140 ts = rawtsvalue(keyfromval(o)); /* re-use value previously stored */ 140 ts = tsvalue(keyfromval(o)); /* re-use value previously stored */
141 } 141 }
142 L->top--; /* remove string from stack */ 142 L->top--; /* remove string from stack */
143 return ts; 143 return ts;
@@ -565,7 +565,7 @@ static int llex (LexState *ls, SemInfo *seminfo) {
565 luaZ_bufflen(ls->buff)); 565 luaZ_bufflen(ls->buff));
566 seminfo->ts = ts; 566 seminfo->ts = ts;
567 if (isreserved(ts)) /* reserved word? */ 567 if (isreserved(ts)) /* reserved word? */
568 return ts->tsv.extra - 1 + FIRST_RESERVED; 568 return ts->extra - 1 + FIRST_RESERVED;
569 else { 569 else {
570 return TK_NAME; 570 return TK_NAME;
571 } 571 }