Preserve the current class across protocol defs.

It seems that protocol defs are allowed in class implementations, so don't
let the protocol def kill the current class for the class implementation.
This commit is contained in:
Bill Currie 2011-03-24 11:55:17 +09:00
parent 2be07fd652
commit a7cfe3b215

View file

@ -1502,10 +1502,15 @@ classdef
;
protocoldef
: PROTOCOL protocol_name
protocolrefs { protocol_add_protocols ($2, $3); $<class>$ = 0; }
methodprotolist { protocol_add_methods ($2, $5); }
END { current_class = 0; (void) ($<class>4); }
: PROTOCOL { $<class_type>$ = current_class; }
protocol_name
protocolrefs { protocol_add_protocols ($3, $4); $<class>$ = 0; }
methodprotolist { protocol_add_methods ($3, $6); }
END
{
current_class = $<class_type>2;
(void) ($<class>5);
}
;
protocolrefs