Vertical bar removed from syntax of vararg table

The syntax 'function foo (a, b, ...arg)' is already used by JavaScript
for this same semantics, so it seems natural to use the same notation in
Lua.
This commit is contained in:
Roberto I
2025-10-30 11:07:01 -03:00
parent 0149b781d4
commit d342328e5b
5 changed files with 20 additions and 22 deletions

View File

@@ -1079,8 +1079,8 @@ static void parlist (LexState *ls) {
}
case TK_DOTS: {
varargk |= PF_ISVARARG;
luaX_next(ls);
if (testnext(ls, '|')) {
luaX_next(ls); /* skip '...' */
if (ls->t.token == TK_NAME) {
new_varkind(ls, str_checkname(ls), RDKVAVAR);
varargk |= PF_VAVAR;
}