mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
parse.y: allow arguments start with _ to appear multiple times; fix #5604
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
+1055
-1051
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user