diff options
Diffstat (limited to 'lparser.c')
-rw-r--r-- | lparser.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1030,10 +1030,11 @@ static int explist (LexState *ls, expdesc *v) { | |||
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | 1032 | ||
1033 | static void funcargs (LexState *ls, expdesc *f, int line) { | 1033 | static 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; |