1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 13:25:45 +02:00

small cleanup re namespaceType in CVisitor

This commit is contained in:
Andrew Niefer 2005-01-31 21:16:13 +00:00
parent 2852b6fafd
commit 257d3d67f4

View file

@ -999,9 +999,10 @@ public class CVisitor {
scope = (ICScope) translation.getScope(); scope = (ICScope) translation.getScope();
} }
boolean typesOnly = (bits & TAGS) != 0;
if( scope != null ){ if( scope != null ){
int namespaceType = (bits & TAGS) != 0 ? ICScope.NAMESPACE_TYPE_TAG int namespaceType = typesOnly ? ICScope.NAMESPACE_TYPE_TAG : ICScope.NAMESPACE_TYPE_OTHER;
: ICScope.NAMESPACE_TYPE_OTHER;
try { try {
binding = scope.getBinding( namespaceType, name.toCharArray() ); binding = scope.getBinding( namespaceType, name.toCharArray() );
} catch ( DOMException e ) { } catch ( DOMException e ) {
@ -1010,7 +1011,7 @@ public class CVisitor {
if( binding != null ) if( binding != null )
return binding; return binding;
} }
boolean typesOnly = (bits & TAGS) != 0;
if( nodes != null ){ if( nodes != null ){
for( int i = 0; i < nodes.length; i++ ){ for( int i = 0; i < nodes.length; i++ ){
IASTNode node = nodes[i]; IASTNode node = nodes[i];
@ -1034,15 +1035,9 @@ public class CVisitor {
binding = checkForBinding( (IASTStatement) parent, name, typesOnly ); binding = checkForBinding( (IASTStatement) parent, name, typesOnly );
} }
if( binding != null ){ if( binding != null ){
if( (bits & TAGS) != 0 && !(binding instanceof ICompositeType) ||
(bits & TAGS) == 0 && (binding instanceof ICompositeType) )
{
binding = null;
} else {
return binding; return binding;
} }
} }
}
if( (bits & CURRENT_SCOPE) == 0 ) if( (bits & CURRENT_SCOPE) == 0 )
blockItem = parent; blockItem = parent;
else else