diff options
author | William Wilgus <me.theuser@yahoo.com> | 2018-11-08 11:32:45 -0500 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2018-11-11 19:42:30 -0500 |
commit | b69faf0bcc5ddca1d88b1a7ab47bcbbc6dbb9af1 (patch) | |
tree | 191277cab3ef773238c1e91dafaaea04ddca1949 /apps/plugins/lua/lparser.c | |
parent | de6618a2713ef26f888762cbe6539cc65a393c7c (diff) | |
download | rockbox-b69faf0bcc5ddca1d88b1a7ab47bcbbc6dbb9af1.tar.gz rockbox-b69faf0bcc5ddca1d88b1a7ab47bcbbc6dbb9af1.zip |
lua update to 5.1.5
Modify Rocklua towards upstream 5.1.5
Clean up some of the Rocklua implementation
Change-Id: Iac722e827899cf84f5ca004ef7ae7ddce5f7fbbe
Diffstat (limited to 'apps/plugins/lua/lparser.c')
-rw-r--r-- | apps/plugins/lua/lparser.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/plugins/lua/lparser.c b/apps/plugins/lua/lparser.c index 800cdb1a3b..dda7488dca 100644 --- a/apps/plugins/lua/lparser.c +++ b/apps/plugins/lua/lparser.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 2.42.1.3 2007/12/28 15:32:23 roberto Exp $ | 2 | ** $Id: lparser.c,v 2.42.1.4 2011/10/21 19:31:42 roberto Exp $ |
3 | ** Lua Parser | 3 | ** Lua Parser |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -325,7 +325,7 @@ static void pushclosure (LexState *ls, FuncState *func, expdesc *v) { | |||
325 | } | 325 | } |
326 | 326 | ||
327 | 327 | ||
328 | static void lparser_open_func (LexState *ls, FuncState *fs) { | 328 | static void open_func (LexState *ls, FuncState *fs) { |
329 | lua_State *L = ls->L; | 329 | lua_State *L = ls->L; |
330 | Proto *f = luaF_newproto(L); | 330 | Proto *f = luaF_newproto(L); |
331 | fs->f = f; | 331 | fs->f = f; |
@@ -374,9 +374,9 @@ static void close_func (LexState *ls) { | |||
374 | lua_assert(luaG_checkcode(f)); | 374 | lua_assert(luaG_checkcode(f)); |
375 | lua_assert(fs->bl == NULL); | 375 | lua_assert(fs->bl == NULL); |
376 | ls->fs = fs->prev; | 376 | ls->fs = fs->prev; |
377 | L->top -= 2; /* remove table and prototype from the stack */ | ||
378 | /* last token read was anchored in defunct function; must reanchor it */ | 377 | /* last token read was anchored in defunct function; must reanchor it */ |
379 | if (fs) anchor_token(ls); | 378 | if (fs) anchor_token(ls); |
379 | L->top -= 2; /* remove table and prototype from the stack */ | ||
380 | } | 380 | } |
381 | 381 | ||
382 | 382 | ||
@@ -385,7 +385,7 @@ Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) { | |||
385 | struct FuncState funcstate; | 385 | struct FuncState funcstate; |
386 | lexstate.buff = buff; | 386 | lexstate.buff = buff; |
387 | luaX_setinput(L, &lexstate, z, luaS_new(L, name)); | 387 | luaX_setinput(L, &lexstate, z, luaS_new(L, name)); |
388 | lparser_open_func(&lexstate, &funcstate); | 388 | open_func(&lexstate, &funcstate); |
389 | funcstate.f->is_vararg = VARARG_ISVARARG; /* main func. is always vararg */ | 389 | funcstate.f->is_vararg = VARARG_ISVARARG; /* main func. is always vararg */ |
390 | luaX_next(&lexstate); /* read first token */ | 390 | luaX_next(&lexstate); /* read first token */ |
391 | chunk(&lexstate); | 391 | chunk(&lexstate); |
@@ -576,7 +576,7 @@ static void parlist (LexState *ls) { | |||
576 | static void body (LexState *ls, expdesc *e, int needself, int line) { | 576 | static void body (LexState *ls, expdesc *e, int needself, int line) { |
577 | /* body -> `(' parlist `)' chunk END */ | 577 | /* body -> `(' parlist `)' chunk END */ |
578 | FuncState new_fs; | 578 | FuncState new_fs; |
579 | lparser_open_func(ls, &new_fs); | 579 | open_func(ls, &new_fs); |
580 | new_fs.f->linedefined = line; | 580 | new_fs.f->linedefined = line; |
581 | checknext(ls, '('); | 581 | checknext(ls, '('); |
582 | if (needself) { | 582 | if (needself) { |