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

parent 3b59c95e
......@@ -302,9 +302,13 @@ local_add_f(parser_state *p, mrb_sym sym)
node *n = p->locals->car;
while (n) {
if (sym(n->car) == sym) {
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;
}
p->locals->car = push(p->locals->car, nsym(sym));
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment