diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-08 16:01:38 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-08 16:01:38 -0300 |
| commit | cbc59592ff684b646b21766a66630df1f7974b25 (patch) | |
| tree | 1e28529cda3b8f6baa63285f6a2571767c3ed05e /lparser.c | |
| parent | 4905fdd1350bde68cd818b9198f28f5a47c208b0 (diff) | |
| download | lua-cbc59592ff684b646b21766a66630df1f7974b25.tar.gz lua-cbc59592ff684b646b21766a66630df1f7974b25.tar.bz2 lua-cbc59592ff684b646b21766a66630df1f7974b25.zip | |
new definition for `luaD_call' and `luaD_adjusttop'
Diffstat (limited to '')
| -rw-r--r-- | lparser.c | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lparser.c,v 1.145 2001/06/07 14:44:51 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.146 2001/06/08 12:29:27 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 | */ |
| @@ -424,7 +424,7 @@ static void funcargs (LexState *ls, expdesc *f) { | |||
| 424 | args.k = VVOID; | 424 | args.k = VVOID; |
| 425 | else { | 425 | else { |
| 426 | explist1(ls, &args); | 426 | explist1(ls, &args); |
| 427 | luaK_setcallreturns(fs, &args, NO_REG); | 427 | luaK_setcallreturns(fs, &args, LUA_MULTRET); |
| 428 | } | 428 | } |
| 429 | check_match(ls, l_c(')'), l_c('('), line); | 429 | check_match(ls, l_c(')'), l_c('('), line); |
| 430 | break; | 430 | break; |
| @@ -452,7 +452,7 @@ static void funcargs (LexState *ls, expdesc *f) { | |||
| 452 | luaK_exp2nextreg(fs, &args); /* close last argument */ | 452 | luaK_exp2nextreg(fs, &args); /* close last argument */ |
| 453 | top = fs->freereg; | 453 | top = fs->freereg; |
| 454 | } | 454 | } |
| 455 | init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, top, 1)); | 455 | init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, top, base+1)); |
| 456 | fs->freereg = base+1; /* call remove function and arguments and leaves | 456 | fs->freereg = base+1; /* call remove function and arguments and leaves |
| 457 | (unless changed) one result */ | 457 | (unless changed) one result */ |
| 458 | } | 458 | } |
| @@ -530,7 +530,7 @@ static int listfields (LexState *ls, expdesc *t) { | |||
| 530 | n++; | 530 | n++; |
| 531 | } | 531 | } |
| 532 | if (v.k == VCALL) { | 532 | if (v.k == VCALL) { |
| 533 | luaK_setcallreturns(fs, &v, NO_REG); | 533 | luaK_setcallreturns(fs, &v, LUA_MULTRET); |
| 534 | luaK_codeABc(fs, OP_SETLISTO, t->u.i.info, n-1); | 534 | luaK_codeABc(fs, OP_SETLISTO, t->u.i.info, n-1); |
| 535 | } | 535 | } |
| 536 | else { | 536 | else { |
| @@ -1098,7 +1098,7 @@ static void retstat (LexState *ls) { | |||
| 1098 | else { | 1098 | else { |
| 1099 | int n = explist1(ls, &e); /* optional return values */ | 1099 | int n = explist1(ls, &e); /* optional return values */ |
| 1100 | if (e.k == VCALL) { | 1100 | if (e.k == VCALL) { |
| 1101 | luaK_setcallreturns(fs, &e, NO_REG); | 1101 | luaK_setcallreturns(fs, &e, LUA_MULTRET); |
| 1102 | first = fs->nactloc; | 1102 | first = fs->nactloc; |
| 1103 | last1 = NO_REG; /* return all values */ | 1103 | last1 = NO_REG; /* return all values */ |
| 1104 | } | 1104 | } |
