mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 18:25:40 +02:00
This commit is contained in:
parent
8a44263910
commit
97dcd10e64
3 changed files with 25 additions and 5 deletions
|
@ -186,4 +186,25 @@ public class ASTElaboratedTypeSpecifier extends ASTSymbol implements IASTElabora
|
|||
public int getNameLineNumber() {
|
||||
return offsets.getNameLineNumber();
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if( obj == null ) return false;
|
||||
if( ! (obj instanceof IASTElaboratedTypeSpecifier )) return false;
|
||||
IASTElaboratedTypeSpecifier elab = (IASTElaboratedTypeSpecifier) obj;
|
||||
if( elab.getClassKind() != getClassKind() ) return false;
|
||||
if( elab.getName() != getName() ) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
public int hashCode() {
|
||||
String coded =getName().toString();
|
||||
return coded.hashCode();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3251,7 +3251,8 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
checkSymbol = ((ITemplateSymbol)checkSymbol).getTemplatedSymbol();
|
||||
}
|
||||
if (checkSymbol.getASTExtension().getPrimaryDeclaration() instanceof IASTClassSpecifier
|
||||
|| checkSymbol.getASTExtension().getPrimaryDeclaration() instanceof IASTEnumerationSpecifier) {
|
||||
|| checkSymbol.getASTExtension().getPrimaryDeclaration() instanceof IASTEnumerationSpecifier ||
|
||||
checkSymbol.getASTExtension().getPrimaryDeclaration() instanceof IASTElaboratedTypeSpecifier ) {
|
||||
ASTElaboratedTypeSpecifier elab = new ASTElaboratedTypeSpecifier(
|
||||
checkSymbol, kind, startingOffset, startingLine, name
|
||||
.getFirstToken().getOffset(), name
|
||||
|
@ -3261,9 +3262,6 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
attachSymbolExtension(checkSymbol, elab, !isForewardDecl);
|
||||
return elab;
|
||||
}
|
||||
if (checkSymbol.getASTExtension().getPrimaryDeclaration() instanceof IASTElaboratedTypeSpecifier)
|
||||
return (IASTElaboratedTypeSpecifier) checkSymbol
|
||||
.getASTExtension().getPrimaryDeclaration();
|
||||
} else {
|
||||
handleProblem(IProblem.SEMANTIC_NAME_NOT_FOUND, newSymbolName,
|
||||
nameToken.getOffset(), nameToken.getEndOffset(), nameToken
|
||||
|
|
|
@ -58,7 +58,8 @@ public class TokenFactory {
|
|||
|
||||
public static ITokenDuple createTokenDuple( IToken first, IToken last, List templateArgLists )
|
||||
{
|
||||
if( (first == last) && ( templateArgLists == null ) && ( first instanceof ITokenDuple )) return (ITokenDuple) first;
|
||||
if( (first == last) && ( templateArgLists == null ) && ( first instanceof ITokenDuple ))
|
||||
return (ITokenDuple) first;
|
||||
if( templateArgLists != null && !templateArgLists.isEmpty())
|
||||
return new TemplateTokenDuple( first, last, templateArgLists );
|
||||
return new BasicTokenDuple( first, last );
|
||||
|
|
Loading…
Add table
Reference in a new issue