1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 09:16:02 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2009-10-06 05:58:08 +00:00
parent dbec91987b
commit 1c2270f0cb
5 changed files with 34 additions and 42 deletions

View file

@ -26,20 +26,18 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
/**
* @author jcamelon
*/
public class CASTFunctionDefinition extends ASTNode implements
IASTFunctionDefinition, IASTAmbiguityParent {
public class CASTFunctionDefinition extends ASTNode implements IASTFunctionDefinition, IASTAmbiguityParent {
private IASTDeclSpecifier declSpecifier;
private IASTFunctionDeclarator declarator;
private IASTStatement bodyStatement;
private ICFunctionScope scope;
public CASTFunctionDefinition() {
}
public CASTFunctionDefinition(IASTDeclSpecifier declSpecifier,
IASTFunctionDeclarator declarator, IASTStatement bodyStatement) {
public CASTFunctionDefinition(IASTDeclSpecifier declSpecifier, IASTFunctionDeclarator declarator,
IASTStatement bodyStatement) {
setDeclSpecifier(declSpecifier);
setDeclarator(declarator);
setBody(bodyStatement);
@ -116,10 +114,10 @@ public class CASTFunctionDefinition extends ASTNode implements
}
}
if( declSpecifier != null ) if( !declSpecifier.accept( action ) ) return false;
if (declSpecifier != null && !declSpecifier.accept(action)) return false;
final IASTDeclarator outerDtor= CVisitor.findOutermostDeclarator(declarator);
if( outerDtor != null ) if( !outerDtor.accept( action ) ) return false;
if( bodyStatement != null ) if( !bodyStatement.accept( action ) ) return false;
if (outerDtor != null && !outerDtor.accept(action)) return false;
if (bodyStatement != null && !bodyStatement.accept(action)) return false;
if (action.shouldVisitDeclarations) {
switch (action.leave(this)) {
@ -132,8 +130,7 @@ public class CASTFunctionDefinition extends ASTNode implements
}
public void replace(IASTNode child, IASTNode other) {
if( bodyStatement == child )
{
if (bodyStatement == child) {
other.setPropertyInParent(bodyStatement.getPropertyInParent());
other.setParent(bodyStatement.getParent());
bodyStatement = (IASTStatement) other;

View file

@ -208,14 +208,14 @@ public class CPPASTFieldReference extends ASTNode implements
IBinding[] bindings = CPPSemantics.findBindingsForContentAssist(n, isPrefix);
List<IBinding> filtered = new ArrayList<IBinding>();
for (int i = 0; i < bindings.length; i++) {
if (bindings[i] instanceof ICPPMethod) {
ICPPMethod method = (ICPPMethod) bindings[i];
for (IBinding binding : bindings) {
if (binding instanceof ICPPMethod) {
ICPPMethod method = (ICPPMethod) binding;
if (method.isImplicit()) {
continue;
}
}
filtered.add(bindings[i]);
filtered.add(binding);
}
return filtered.toArray(new IBinding[filtered.size()]);

View file

@ -217,8 +217,7 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
final IBinding binding= name.resolveBinding();
if (binding instanceof IParameter) {
result[i]= (IParameter) binding;
}
else {
} else {
result[i] = new CPPParameter.CPPParameterProblem(p, IProblemBinding.SEMANTIC_INVALID_TYPE,
name.toCharArray());
}

View file

@ -278,12 +278,8 @@ public class DOMCompletionProposalComputer extends ParsingBasedProposalComputer
}
}
protected void handleBinding(IBinding binding,
CContentAssistInvocationContext cContext,
String prefix,
IASTCompletionContext astContext,
List<ICompletionProposal> proposals) {
protected void handleBinding(IBinding binding, CContentAssistInvocationContext cContext, String prefix,
IASTCompletionContext astContext, List<ICompletionProposal> proposals) {
if ((binding instanceof CPPImplicitFunction
|| binding instanceof CPPImplicitFunctionTemplate
|| binding instanceof CPPImplicitTypedef