diff options
| author | Li Jin <dragon-fly@qq.com> | 2023-12-06 09:23:50 +0800 | 
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2023-12-06 09:23:59 +0800 | 
| commit | 6d3dc3c2623d2e012de75c2f9b81536aae5759eb (patch) | |
| tree | 81a1f1fefffd8049b2663a96a97686f94dbf8765 /src/3rdParty/lua/lparser.c | |
| parent | bd6ffb3089d20f0c140c39f88b38062cbb1b5ccb (diff) | |
| download | yuescript-6d3dc3c2623d2e012de75c2f9b81536aae5759eb.tar.gz yuescript-6d3dc3c2623d2e012de75c2f9b81536aae5759eb.tar.bz2 yuescript-6d3dc3c2623d2e012de75c2f9b81536aae5759eb.zip  | |
update Lua 5.4.
Diffstat (limited to '')
| -rw-r--r-- | src/3rdParty/lua/lparser.c | 12 | 
1 files changed, 6 insertions, 6 deletions
diff --git a/src/3rdParty/lua/lparser.c b/src/3rdParty/lua/lparser.c index b745f23..2b888c7 100644 --- a/src/3rdParty/lua/lparser.c +++ b/src/3rdParty/lua/lparser.c  | |||
| @@ -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; | 
