@@ -794,6 +794,8 @@ NONLopt [^\n]*
794794 yyextra->current ->section = EntryType::makeFunction ();
795795 yyextra->language = yyextra->current ->lang = SrcLangExt::ObjC;
796796 yyextra->insideObjC = TRUE ;
797+ yyextra->yyBegColNr = yyextra->yyColNr ;
798+ yyextra->yyBegLineNr = yyextra->yyLineNr ;
797799 yyextra->current ->virt = Specifier::Virtual;
798800
799801 yyextra->current ->isStatic =yytext[0 ]==' +' ;
@@ -803,11 +805,13 @@ NONLopt [^\n]*
803805 }
804806<ObjCMethod>" (" { // start of method's return type
805807 BEGIN ( ObjCReturnType );
808+ yyextra->current ->type .clear ();
809+ yyextra->roundCount =0 ;
806810 }
807811<ObjCMethod>{ID} { // found method name
808812 if (yyextra->current ->type .isEmpty ())
809813 {
810- yyextra->current ->type = " id" ;
814+ yyextra->current ->type + = " id" ;
811815 }
812816 yyextra->current ->name = yytext;
813817 storeClangId (yyscanner,yytext);
@@ -818,11 +822,27 @@ NONLopt [^\n]*
818822 yyextra->current ->argList .push_back (a);
819823 BEGIN ( ObjCParams );
820824 }
821- <ObjCReturnType>[^)]* { // TODO: check if nested branches are possible.
822- yyextra->current ->type = yytext;
825+ <ObjCReturnType>[^()]* {
826+ yyextra->current ->type += yytext;
827+ }
828+ <ObjCReturnType>" (^)(" { // Block return type
829+ yyextra->current ->type += yytext;
830+ yyextra->roundCount ++;
831+ }
832+ <ObjCReturnType>" (" {
833+ yyextra->current ->type += yytext;
834+ yyextra->roundCount ++;
823835 }
824836<ObjCReturnType>" )" {
825- BEGIN ( ObjCMethod );
837+ if (yyextra->roundCount <=0 )
838+ {
839+ BEGIN ( ObjCMethod );
840+ }
841+ else
842+ {
843+ yyextra->current ->type += yytext;
844+ yyextra->roundCount --;
845+ }
826846 }
827847<ObjCParams>({ID})?{BN}*" :" { // Keyword of parameter
828848 QCString keyw = yytext;
0 commit comments