mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
parse.y: endless_method_name should allow ==.
e.g. `def ==(v) = true`. The issue is reported by @shuujii
This commit is contained in:
@@ -1212,6 +1212,9 @@ endless_method_name(parser_state *p, node *defn)
|
||||
const char *name = mrb_sym_name_len(p->mrb, sym, &len);
|
||||
|
||||
if (len > 1 && name[len-1] == '=') {
|
||||
for (int i=0; i<len-1; i++) {
|
||||
if (!identchar(name[i])) return;
|
||||
}
|
||||
yyerror(p, "setter method cannot be defined by endless method definition");
|
||||
}
|
||||
}
|
||||
|
||||
+985
-982
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user