aboutsummaryrefslogtreecommitdiff
path: root/llex.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-06-15 17:36:57 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-06-15 17:36:57 -0300
commit8e586c13fcf3066886a7edd69011304eaad57a2b (patch)
tree417c2102ba8c4d693c49a2df839612d371eded50 /llex.c
parenteadf2aaaffa7a35e7f67b150ce0d57f2c17b9231 (diff)
downloadlua-8e586c13fcf3066886a7edd69011304eaad57a2b.tar.gz
lua-8e586c13fcf3066886a7edd69011304eaad57a2b.tar.bz2
lua-8e586c13fcf3066886a7edd69011304eaad57a2b.zip
cleaner way to ensure alignment for strings and userdata
Diffstat (limited to 'llex.c')
-rw-r--r--llex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/llex.c b/llex.c
index bb50c276..c921b1b4 100644
--- a/llex.c
+++ b/llex.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: llex.c,v 1.85 2001/06/07 15:01:21 roberto Exp roberto $ 2** $Id: llex.c,v 1.86 2001/06/13 14:25:49 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*/
@@ -40,7 +40,7 @@ void luaX_init (lua_State *L) {
40 for (i=0; i<NUM_RESERVED; i++) { 40 for (i=0; i<NUM_RESERVED; i++) {
41 TString *ts = luaS_new(L, token2string[i]); 41 TString *ts = luaS_new(L, token2string[i]);
42 lua_assert(strlen(token2string[i])+1 <= TOKEN_LEN); 42 lua_assert(strlen(token2string[i])+1 <= TOKEN_LEN);
43 ts->marked = (unsigned short)(RESERVEDMARK+i); /* reserved word */ 43 ts->tsv.marked = (unsigned short)(RESERVEDMARK+i); /* reserved word */
44 } 44 }
45} 45}
46 46
@@ -370,8 +370,8 @@ int luaX_lex (LexState *LS, SemInfo *seminfo) {
370 /* identifier or reserved word */ 370 /* identifier or reserved word */
371 size_t l = readname(LS); 371 size_t l = readname(LS);
372 TString *ts = luaS_newlstr(LS->L, (l_char *)G(LS->L)->Mbuffer, l); 372 TString *ts = luaS_newlstr(LS->L, (l_char *)G(LS->L)->Mbuffer, l);
373 if (ts->marked >= RESERVEDMARK) /* reserved word? */ 373 if (ts->tsv.marked >= RESERVEDMARK) /* reserved word? */
374 return ts->marked-RESERVEDMARK+FIRST_RESERVED; 374 return ts->tsv.marked-RESERVEDMARK+FIRST_RESERVED;
375 seminfo->ts = ts; 375 seminfo->ts = ts;
376 return TK_NAME; 376 return TK_NAME;
377 } 377 }