diff options
Diffstat (limited to 'lparser.c')
-rw-r--r-- | lparser.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1022,10 +1022,11 @@ static int explist (LexState *ls, expdesc *v) { | |||
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | 1024 | ||
1025 | static void funcargs (LexState *ls, expdesc *f, int line) { | 1025 | static void funcargs (LexState *ls, expdesc *f) { |
1026 | FuncState *fs = ls->fs; | 1026 | FuncState *fs = ls->fs; |
1027 | expdesc args; | 1027 | expdesc args; |
1028 | int base, nparams; | 1028 | int base, nparams; |
1029 | int line = ls->linenumber; | ||
1029 | switch (ls->t.token) { | 1030 | switch (ls->t.token) { |
1030 | case '(': { /* funcargs -> '(' [ explist ] ')' */ | 1031 | case '(': { /* funcargs -> '(' [ explist ] ')' */ |
1031 | luaX_next(ls); | 1032 | luaX_next(ls); |
@@ -1063,8 +1064,8 @@ static void funcargs (LexState *ls, expdesc *f, int line) { | |||
1063 | } | 1064 | } |
1064 | init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); | 1065 | init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); |
1065 | luaK_fixline(fs, line); | 1066 | luaK_fixline(fs, line); |
1066 | fs->freereg = base+1; /* call remove function and arguments and leaves | 1067 | fs->freereg = base+1; /* call removes function and arguments and leaves |
1067 | (unless changed) one result */ | 1068 | one result (unless changed later) */ |
1068 | } | 1069 | } |
1069 | 1070 | ||
1070 | 1071 | ||
@@ -1103,7 +1104,6 @@ static void suffixedexp (LexState *ls, expdesc *v) { | |||
1103 | /* suffixedexp -> | 1104 | /* suffixedexp -> |
1104 | primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs } */ | 1105 | primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs } */ |
1105 | FuncState *fs = ls->fs; | 1106 | FuncState *fs = ls->fs; |
1106 | int line = ls->linenumber; | ||
1107 | primaryexp(ls, v); | 1107 | primaryexp(ls, v); |
1108 | for (;;) { | 1108 | for (;;) { |
1109 | switch (ls->t.token) { | 1109 | switch (ls->t.token) { |
@@ -1123,12 +1123,12 @@ static void suffixedexp (LexState *ls, expdesc *v) { | |||
1123 | luaX_next(ls); | 1123 | luaX_next(ls); |
1124 | codename(ls, &key); | 1124 | codename(ls, &key); |
1125 | luaK_self(fs, v, &key); | 1125 | luaK_self(fs, v, &key); |
1126 | funcargs(ls, v, line); | 1126 | funcargs(ls, v); |
1127 | break; | 1127 | break; |
1128 | } | 1128 | } |
1129 | case '(': case TK_STRING: case '{': { /* funcargs */ | 1129 | case '(': case TK_STRING: case '{': { /* funcargs */ |
1130 | luaK_exp2nextreg(fs, v); | 1130 | luaK_exp2nextreg(fs, v); |
1131 | funcargs(ls, v, line); | 1131 | funcargs(ls, v); |
1132 | break; | 1132 | break; |
1133 | } | 1133 | } |
1134 | default: return; | 1134 | default: return; |