[qfcc] Clean up some redundancy in methodproto

I don't know why I didn't apply the same ideas as in methoddef, maybe I
just forgot. I'm pretty sure I did methodproto first, or maybe cleaned
up methoddef much later then didn't think of methodproto. Still, the
grammar is much nicer to read now.
This commit is contained in:
Bill Currie 2024-08-21 08:26:31 +09:00
parent a00b17bf71
commit 43f83fc0eb

View file

@ -2559,20 +2559,13 @@ methodprotolist2
;
methodproto
: '+' methoddecl ';'
: ci methoddecl ';'
{
$2->instance = 0;
$2->instance = $1;
$$ = $2;
}
| '-' error ';'
| ci error ';'
{ $$ = new_method (&type_id, make_selector ("", 0, 0), 0); }
| '+' error ';'
{ $$ = new_method (&type_id, make_selector ("", 0, 0), 0); }
| '-' methoddecl ';'
{
$2->instance = 1;
$$ = $2;
}
;
methoddecl