compiler/libec Improvements to conversion from AST->Type class, and to outputting...
[sdk] / compiler / libec / src / shortcuts.ec
index 537ac56..f95fc76 100644 (file)
@@ -149,9 +149,14 @@ char * QMkString(char * source)
 
 public Declarator GetFuncDecl(Declarator decl)
 {
-   while(decl && decl.type != functionDeclarator && decl.type != identifierDeclarator)
+   Declarator funcDecl = null;
+   while(decl && decl.type != identifierDeclarator)
+   {
+      if(decl.type == functionDeclarator)
+         funcDecl = decl;
       decl = decl.declarator;
-   return (decl && decl.type == functionDeclarator) ? decl : null;
+   }
+   return funcDecl;
 }
 
 bool parseTypeError;