more precise detection of function/type declaration/definition