diff options
Diffstat (limited to 'lparser.c')
| -rw-r--r-- | lparser.c | 14 |
1 files changed, 7 insertions, 7 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lparser.c,v 1.100 2000/06/28 17:06:07 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.101 2000/06/28 20:20:36 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 | */ |
| @@ -67,7 +67,7 @@ static void next (LexState *ls) { | |||
| 67 | 67 | ||
| 68 | 68 | ||
| 69 | static void lookahead (LexState *ls) { | 69 | static void lookahead (LexState *ls) { |
| 70 | LUA_ASSERT(ls->L, ls->lookahead.token == TK_EOS, "two look-aheads"); | 70 | LUA_ASSERT(ls->lookahead.token == TK_EOS, "two look-aheads"); |
| 71 | ls->lookahead.token = luaX_lex(ls); | 71 | ls->lookahead.token = luaX_lex(ls); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| @@ -295,7 +295,7 @@ static void enterbreak (FuncState *fs, Breaklabel *bl) { | |||
| 295 | 295 | ||
| 296 | static void leavebreak (FuncState *fs, Breaklabel *bl) { | 296 | static void leavebreak (FuncState *fs, Breaklabel *bl) { |
| 297 | fs->bl = bl->previous; | 297 | fs->bl = bl->previous; |
| 298 | LUA_ASSERT(fs->L, bl->stacklevel == fs->stacklevel, "wrong levels"); | 298 | LUA_ASSERT(bl->stacklevel == fs->stacklevel, "wrong levels"); |
| 299 | luaK_patchlist(fs, bl->breaklist, luaK_getlabel(fs)); | 299 | luaK_patchlist(fs, bl->breaklist, luaK_getlabel(fs)); |
| 300 | } | 300 | } |
| 301 | 301 | ||
| @@ -349,7 +349,7 @@ static void close_func (LexState *ls) { | |||
| 349 | luaI_registerlocalvar(ls, NULL, -1); /* flag end of vector */ | 349 | luaI_registerlocalvar(ls, NULL, -1); /* flag end of vector */ |
| 350 | luaM_reallocvector(L, f->locvars, fs->nvars, LocVar); | 350 | luaM_reallocvector(L, f->locvars, fs->nvars, LocVar); |
| 351 | ls->fs = fs->prev; | 351 | ls->fs = fs->prev; |
| 352 | LUA_ASSERT(L, fs->bl == NULL, "wrong list end"); | 352 | LUA_ASSERT(fs->bl == NULL, "wrong list end"); |
| 353 | } | 353 | } |
| 354 | 354 | ||
| 355 | 355 | ||
| @@ -363,8 +363,8 @@ Proto *luaY_parser (lua_State *L, ZIO *z) { | |||
| 363 | chunk(&lexstate); | 363 | chunk(&lexstate); |
| 364 | check_condition(&lexstate, (lexstate.t.token == TK_EOS), "<eof> expected"); | 364 | check_condition(&lexstate, (lexstate.t.token == TK_EOS), "<eof> expected"); |
| 365 | close_func(&lexstate); | 365 | close_func(&lexstate); |
| 366 | LUA_ASSERT(L, funcstate.prev == NULL, "wrong list end"); | 366 | LUA_ASSERT(funcstate.prev == NULL, "wrong list end"); |
| 367 | LUA_ASSERT(L, funcstate.nupvalues == 0, "no upvalues in main"); | 367 | LUA_ASSERT(funcstate.nupvalues == 0, "no upvalues in main"); |
| 368 | return funcstate.f; | 368 | return funcstate.f; |
| 369 | } | 369 | } |
| 370 | 370 | ||
| @@ -1109,7 +1109,7 @@ static void chunk (LexState *ls) { | |||
| 1109 | while (!islast && !block_follow(ls->t.token)) { | 1109 | while (!islast && !block_follow(ls->t.token)) { |
| 1110 | islast = stat(ls); | 1110 | islast = stat(ls); |
| 1111 | optional(ls, ';'); | 1111 | optional(ls, ';'); |
| 1112 | LUA_ASSERT(ls->L, ls->fs->stacklevel == ls->fs->nlocalvar, | 1112 | LUA_ASSERT(ls->fs->stacklevel == ls->fs->nlocalvar, |
| 1113 | "stack size != # local vars"); | 1113 | "stack size != # local vars"); |
| 1114 | } | 1114 | } |
| 1115 | } | 1115 | } |
