mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 10:25:32 +02:00
Fix invocation of macro expansion tool.
This commit is contained in:
parent
dbbd26805c
commit
831dd9ee1f
1 changed files with 18 additions and 9 deletions
|
@ -108,6 +108,14 @@ public class CMacroExpansionInput {
|
||||||
fEnclosingNode= nodeSelector.findEnclosingNode(fTextRegion.getOffset(), fTextRegion.getLength());
|
fEnclosingNode= nodeSelector.findEnclosingNode(fTextRegion.getOffset(), fTextRegion.getLength());
|
||||||
if (fEnclosingNode != null) {
|
if (fEnclosingNode != null) {
|
||||||
boolean macroOccurrence= false;
|
boolean macroOccurrence= false;
|
||||||
|
if (fEnclosingNode.getParent() instanceof IASTPreprocessorMacroExpansion) {
|
||||||
|
fEnclosingNode= fEnclosingNode.getParent();
|
||||||
|
}
|
||||||
|
if (fEnclosingNode instanceof IASTPreprocessorMacroExpansion) {
|
||||||
|
addExpansionNode(fEnclosingNode);
|
||||||
|
macroOccurrence= true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
IASTNodeLocation[] locations= fEnclosingNode.getNodeLocations();
|
IASTNodeLocation[] locations= fEnclosingNode.getNodeLocations();
|
||||||
for (int i = 0; i < locations.length; i++) {
|
for (int i = 0; i < locations.length; i++) {
|
||||||
IASTNodeLocation location= locations[i];
|
IASTNodeLocation location= locations[i];
|
||||||
|
@ -121,6 +129,7 @@ public class CMacroExpansionInput {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (macroOccurrence) {
|
if (macroOccurrence) {
|
||||||
createMacroExpansionExplorer(ast);
|
createMacroExpansionExplorer(ast);
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
|
|
Loading…
Add table
Reference in a new issue