summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler/core/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-compiler/core/parse.y')
-rw-r--r--mrbgems/mruby-compiler/core/parse.y8
1 files changed, 8 insertions, 0 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y
index 92d44c681..2a1017f24 100644
--- a/mrbgems/mruby-compiler/core/parse.y
+++ b/mrbgems/mruby-compiler/core/parse.y
@@ -299,6 +299,14 @@ static void
local_add_f(parser_state *p, mrb_sym sym)
{
if (p->locals) {
+ node *n = p->locals->car;
+ while (n) {
+ if (sym(n->car) == sym) {
+ yyerror(p, "duplicated argument name");
+ return;
+ }
+ n = n->cdr;
+ }
p->locals->car = push(p->locals->car, nsym(sym));
}
}