aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-19 11:20:30 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-01-19 11:20:30 -0200
commit4ac58853dc820127a11a14ed8bde1fae9458369e (patch)
treee8179692c97e935ba921c8ebd17abf9c8510d89e /lparser.c
parentf2c451d7455aad3496f32dfa2bfca7f7e8b5376d (diff)
downloadlua-4ac58853dc820127a11a14ed8bde1fae9458369e.tar.gz
lua-4ac58853dc820127a11a14ed8bde1fae9458369e.tar.bz2
lua-4ac58853dc820127a11a14ed8bde1fae9458369e.zip
thead-specific state separated from "global" state
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/lparser.c b/lparser.c
index 96395b38..d796fabd 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 1.123 2001/01/10 17:41:50 roberto Exp roberto $ 2** $Id: lparser.c,v 1.124 2001/01/15 16:13:24 roberto Exp roberto $
3** LL(1) Parser and code generator for Lua 3** LL(1) Parser and code generator for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -65,7 +65,7 @@ static void next (LexState *ls) {
65 65
66 66
67static void lookahead (LexState *ls) { 67static void lookahead (LexState *ls) {
68 LUA_ASSERT(ls->lookahead.token == TK_EOS, "two look-aheads"); 68 lua_assert(ls->lookahead.token == TK_EOS);
69 ls->lookahead.token = luaX_lex(ls, &ls->lookahead.seminfo); 69 ls->lookahead.token = luaX_lex(ls, &ls->lookahead.seminfo);
70} 70}
71 71
@@ -285,7 +285,7 @@ static void enterbreak (FuncState *fs, Breaklabel *bl) {
285 285
286static void leavebreak (FuncState *fs, Breaklabel *bl) { 286static void leavebreak (FuncState *fs, Breaklabel *bl) {
287 fs->bl = bl->previous; 287 fs->bl = bl->previous;
288 LUA_ASSERT(bl->stacklevel == fs->stacklevel, "wrong levels"); 288 lua_assert(bl->stacklevel == fs->stacklevel);
289 luaK_patchlist(fs, bl->breaklist, luaK_getlabel(fs)); 289 luaK_patchlist(fs, bl->breaklist, luaK_getlabel(fs));
290} 290}
291 291
@@ -352,7 +352,7 @@ static void close_func (LexState *ls) {
352 f->lineinfo[fs->nlineinfo++] = MAX_INT; /* end flag */ 352 f->lineinfo[fs->nlineinfo++] = MAX_INT; /* end flag */
353 f->sizelineinfo = fs->nlineinfo; 353 f->sizelineinfo = fs->nlineinfo;
354 ls->fs = fs->prev; 354 ls->fs = fs->prev;
355 LUA_ASSERT(fs->bl == NULL, "wrong list end"); 355 lua_assert(fs->bl == NULL);
356} 356}
357 357
358 358
@@ -365,8 +365,8 @@ Proto *luaY_parser (lua_State *L, ZIO *z) {
365 chunk(&lexstate); 365 chunk(&lexstate);
366 check_condition(&lexstate, (lexstate.t.token == TK_EOS), "<eof> expected"); 366 check_condition(&lexstate, (lexstate.t.token == TK_EOS), "<eof> expected");
367 close_func(&lexstate); 367 close_func(&lexstate);
368 LUA_ASSERT(funcstate.prev == NULL, "wrong list end"); 368 lua_assert(funcstate.prev == NULL);
369 LUA_ASSERT(funcstate.nupvalues == 0, "no upvalues in main"); 369 lua_assert(funcstate.nupvalues == 0);
370 return funcstate.f; 370 return funcstate.f;
371} 371}
372 372
@@ -1130,8 +1130,7 @@ static void chunk (LexState *ls) {
1130 while (!islast && !block_follow(ls->t.token)) { 1130 while (!islast && !block_follow(ls->t.token)) {
1131 islast = stat(ls); 1131 islast = stat(ls);
1132 optional(ls, ';'); 1132 optional(ls, ';');
1133 LUA_ASSERT(ls->fs->stacklevel == ls->fs->nactloc, 1133 lua_assert(ls->fs->stacklevel == ls->fs->nactloc);
1134 "stack size != # local vars");
1135 } 1134 }
1136} 1135}
1137 1136