From c542e1a45346fa35fafb343d14438b7c79925aa7 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 4 Feb 2011 21:19:52 +0900 Subject: [PATCH] Possibly fix normal methods. --- tools/qfcc/source/qc-parse.y | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index 53791fbf4..1434b0e99 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -1407,8 +1407,29 @@ ivars ; methoddef - : ci methoddecl optional_state_expr compound_statement {} - | ci methoddecl '=' '#' const ';' {} + : ci methoddecl optional_state_expr + { + method_t *method = $2; + + method->instance = $1; + $2 = method = class_find_method (current_class, method); + $$ = method_symbol (current_class, method); + } + { + method_t *method = $2; + const char *nicename = method_name (method); + symbol_t *sym = $4; + $$ = current_symtab; + current_func = begin_function (sym, nicename, current_symtab); + method->def = sym->s.func->def; + current_symtab = current_func->symtab; + } + compound_statement + { + build_code_function ($4, $3, $6); + current_symtab = $5; + } + | ci methoddecl '=' '#' const ';' { symbol_t *sym; method_t *method = $2;