From a7cfe3b2155568dbcfe61ea9db46a61ca36a88b5 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 24 Mar 2011 11:55:17 +0900 Subject: [PATCH] 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. --- tools/qfcc/source/qc-parse.y | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index a6dabeedc..3c04d0029 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -1502,10 +1502,15 @@ classdef ; protocoldef - : PROTOCOL protocol_name - protocolrefs { protocol_add_protocols ($2, $3); $$ = 0; } - methodprotolist { protocol_add_methods ($2, $5); } - END { current_class = 0; (void) ($4); } + : PROTOCOL { $$ = current_class; } + protocol_name + protocolrefs { protocol_add_protocols ($3, $4); $$ = 0; } + methodprotolist { protocol_add_methods ($3, $6); } + END + { + current_class = $2; + (void) ($5); + } ; protocolrefs