mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Cosmetics.
This commit is contained in:
parent
6a8b930ea6
commit
2085f2d1fc
2 changed files with 9 additions and 7 deletions
|
@ -31,7 +31,6 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBinding;
|
|||
/**
|
||||
* Represents a function or method and adds some useful helper methods to
|
||||
* determine if methods are in the same class.
|
||||
*
|
||||
*/
|
||||
public class MethodContext {
|
||||
public enum ContextType{ NONE, FUNCTION, METHOD }
|
||||
|
@ -204,7 +203,8 @@ public class MethodContext {
|
|||
|
||||
private static ICPPClassType getClassBinding(IASTName declName1) {
|
||||
if (declName1.getParent().getParent().getParent() instanceof ICPPASTCompositeTypeSpecifier) {
|
||||
ICPPASTCompositeTypeSpecifier compTypeSpec = (ICPPASTCompositeTypeSpecifier) declName1.getParent().getParent().getParent();
|
||||
ICPPASTCompositeTypeSpecifier compTypeSpec =
|
||||
(ICPPASTCompositeTypeSpecifier) declName1.getParent().getParent().getParent();
|
||||
return (ICPPClassType) compTypeSpec.getName().resolveBinding();
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -160,7 +160,8 @@ public class NodeHelper {
|
|||
IASTName declName = DeclarationFinder.findDeclarationInTranslationUnit(locTu, tmpname);
|
||||
if (declName != null) {
|
||||
IASTNode methoddefinition = declName.getParent().getParent();
|
||||
if (methoddefinition instanceof IASTSimpleDeclaration || methoddefinition instanceof IASTFunctionDefinition) {
|
||||
if (methoddefinition instanceof IASTSimpleDeclaration ||
|
||||
methoddefinition instanceof IASTFunctionDefinition) {
|
||||
context.setMethodDeclarationName(declName);
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +207,8 @@ public class NodeHelper {
|
|||
if (simpleDeclaration == null) {
|
||||
return false;
|
||||
}
|
||||
return simpleDeclaration.getDeclarators().length == 1 && simpleDeclaration.getDeclarators()[0] instanceof ICPPASTFunctionDeclarator;
|
||||
return simpleDeclaration.getDeclarators().length == 1 &&
|
||||
simpleDeclaration.getDeclarators()[0] instanceof ICPPASTFunctionDeclarator;
|
||||
}
|
||||
|
||||
public static boolean isContainedInTemplateDeclaration(IASTNode node) {
|
||||
|
|
Loading…
Add table
Reference in a new issue