aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-06-05 16:41:24 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-06-05 16:41:24 -0300
commit943b8f5b1801c72fee8bf1050919cf1acb600555 (patch)
tree6bef02079082422a78a933230619867bbb2e00e7 /lparser.c
parent762d059a13d83eb367238a6115bbb4f5f13fcb49 (diff)
downloadlua-943b8f5b1801c72fee8bf1050919cf1acb600555.tar.gz
lua-943b8f5b1801c72fee8bf1050919cf1acb600555.tar.bz2
lua-943b8f5b1801c72fee8bf1050919cf1acb600555.zip
details
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lparser.c b/lparser.c
index 2236d79d..90cec9c2 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 1.142 2001/04/06 18:25:00 roberto Exp roberto $ 2** $Id: lparser.c,v 1.143 2001/06/05 18:17:01 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*/
@@ -495,7 +495,6 @@ static void recfield (LexState *ls, expdesc *t) {
495static int recfields (LexState *ls, expdesc *t) { 495static int recfields (LexState *ls, expdesc *t) {
496 /* recfields -> recfield { `,' recfield } [`,'] */ 496 /* recfields -> recfield { `,' recfield } [`,'] */
497 int n = 1; /* at least one element */ 497 int n = 1; /* at least one element */
498 luaK_exp2nextreg(ls->fs, t);
499 recfield(ls, t); 498 recfield(ls, t);
500 while (ls->t.token == l_c(',')) { 499 while (ls->t.token == l_c(',')) {
501 next(ls); 500 next(ls);
@@ -513,7 +512,6 @@ static int listfields (LexState *ls, expdesc *t) {
513 FuncState *fs = ls->fs; 512 FuncState *fs = ls->fs;
514 int n = 1; /* at least one element */ 513 int n = 1; /* at least one element */
515 int reg; 514 int reg;
516 luaK_exp2nextreg(ls->fs, t);
517 reg = fs->freereg; 515 reg = fs->freereg;
518 expr(ls, &v); 516 expr(ls, &v);
519 while (ls->t.token == l_c(',') && 517 while (ls->t.token == l_c(',') &&
@@ -578,6 +576,7 @@ static void constructor (LexState *ls, expdesc *t) {
578 Constdesc cd; 576 Constdesc cd;
579 pc = luaK_codeABc(fs, OP_NEWTABLE, 0, 0); 577 pc = luaK_codeABc(fs, OP_NEWTABLE, 0, 0);
580 init_exp(t, VRELOCABLE, pc); 578 init_exp(t, VRELOCABLE, pc);
579 luaK_exp2nextreg(ls->fs, t); /* fix it at stack top (for gc) */
581 check(ls, l_c('{')); 580 check(ls, l_c('{'));
582 constructor_part(ls, t, &cd); 581 constructor_part(ls, t, &cd);
583 n = cd.n; 582 n = cd.n;