parse.y: allow arguments start with _ to appear multiple times; fix #5604

This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-12-24 07:41:37 +09:00
parent 3b59c95ead
commit 39191cd9fa
2 changed files with 1061 additions and 1053 deletions
+6 -2
View File
@@ -302,8 +302,12 @@ local_add_f(parser_state *p, mrb_sym sym)
node *n = p->locals->car;
while (n) {
if (sym(n->car) == sym) {
yyerror(p, "duplicated argument name");
return;
mrb_int len;
const char* name = mrb_sym_name_len(p->mrb, sym, &len);
if (len > 0 && name[0] != '_') {
yyerror(p, "duplicated argument name");
return;
}
}
n = n->cdr;
}
File diff suppressed because it is too large Load Diff