aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-08-23 15:14:03 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-08-23 15:14:03 -0300
commitc815c2f0eb7a4ac01d4f664f3db44c199ee4e211 (patch)
tree63cdeea69af0df9ff82303d05c517068eb54e56e /lparser.c
parentab6a94952215b1f66436d8eeebded1dad9fa5409 (diff)
parent9363a8b9901a5643c9da061ea8dda8a86cdc7ef1 (diff)
downloadlua-c815c2f0eb7a4ac01d4f664f3db44c199ee4e211.tar.gz
lua-c815c2f0eb7a4ac01d4f664f3db44c199ee4e211.tar.bz2
lua-c815c2f0eb7a4ac01d4f664f3db44c199ee4e211.zip
Merge branch 'master' into nextversion
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lparser.c b/lparser.c
index 2ac04160..81c6df22 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1030,10 +1030,11 @@ static int explist (LexState *ls, expdesc *v) {
1030} 1030}
1031 1031
1032 1032
1033static void funcargs (LexState *ls, expdesc *f, int line) { 1033static void funcargs (LexState *ls, expdesc *f) {
1034 FuncState *fs = ls->fs; 1034 FuncState *fs = ls->fs;
1035 expdesc args; 1035 expdesc args;
1036 int base, nparams; 1036 int base, nparams;
1037 int line = ls->linenumber;
1037 switch (ls->t.token) { 1038 switch (ls->t.token) {
1038 case '(': { /* funcargs -> '(' [ explist ] ')' */ 1039 case '(': { /* funcargs -> '(' [ explist ] ')' */
1039 luaX_next(ls); 1040 luaX_next(ls);
@@ -1071,8 +1072,8 @@ static void funcargs (LexState *ls, expdesc *f, int line) {
1071 } 1072 }
1072 init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); 1073 init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2));
1073 luaK_fixline(fs, line); 1074 luaK_fixline(fs, line);
1074 fs->freereg = base+1; /* call remove function and arguments and leaves 1075 fs->freereg = base+1; /* call removes function and arguments and leaves
1075 (unless changed) one result */ 1076 one result (unless changed later) */
1076} 1077}
1077 1078
1078 1079
@@ -1111,7 +1112,6 @@ static void suffixedexp (LexState *ls, expdesc *v) {
1111 /* suffixedexp -> 1112 /* suffixedexp ->
1112 primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs } */ 1113 primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs } */
1113 FuncState *fs = ls->fs; 1114 FuncState *fs = ls->fs;
1114 int line = ls->linenumber;
1115 primaryexp(ls, v); 1115 primaryexp(ls, v);
1116 for (;;) { 1116 for (;;) {
1117 switch (ls->t.token) { 1117 switch (ls->t.token) {
@@ -1131,12 +1131,12 @@ static void suffixedexp (LexState *ls, expdesc *v) {
1131 luaX_next(ls); 1131 luaX_next(ls);
1132 codename(ls, &key); 1132 codename(ls, &key);
1133 luaK_self(fs, v, &key); 1133 luaK_self(fs, v, &key);
1134 funcargs(ls, v, line); 1134 funcargs(ls, v);
1135 break; 1135 break;
1136 } 1136 }
1137 case '(': case TK_STRING: case '{': { /* funcargs */ 1137 case '(': case TK_STRING: case '{': { /* funcargs */
1138 luaK_exp2nextreg(fs, v); 1138 luaK_exp2nextreg(fs, v);
1139 funcargs(ls, v, line); 1139 funcargs(ls, v);
1140 break; 1140 break;
1141 } 1141 }
1142 default: return; 1142 default: return;