mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
0bef556cd0
commit
411edba679
2 changed files with 11 additions and 10 deletions
|
@ -92,7 +92,6 @@ import org.eclipse.core.runtime.OperationCanceledException;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class CModelBuilder2 implements IContributedModelBuilder {
|
public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
|
|
||||||
private final static boolean DEBUG= Util.isActive(DebugLogConstants.MODEL);
|
private final static boolean DEBUG= Util.isActive(DebugLogConstants.MODEL);
|
||||||
|
|
||||||
private final TranslationUnit fTranslationUnit;
|
private final TranslationUnit fTranslationUnit;
|
||||||
|
@ -145,11 +144,13 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
final IASTTranslationUnit ast;
|
final IASTTranslationUnit ast;
|
||||||
try {
|
try {
|
||||||
ast= fTranslationUnit.getAST(index, parseFlags, fProgressMonitor);
|
ast= fTranslationUnit.getAST(index, parseFlags, fProgressMonitor);
|
||||||
if (DEBUG) Util.debugLog("CModelBuilder2: parsing " //$NON-NLS-1$
|
if (DEBUG) {
|
||||||
+ fTranslationUnit.getElementName()
|
Util.debugLog("CModelBuilder2: parsing " //$NON-NLS-1$
|
||||||
+ " mode="+ (quickParseMode ? "skip all " : "skip indexed ") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
+ fTranslationUnit.getElementName()
|
||||||
+ " time="+ ( System.currentTimeMillis() - startTime ) + "ms", //$NON-NLS-1$ //$NON-NLS-2$
|
+ " mode="+ (quickParseMode ? "skip all " : "skip indexed ") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
DebugLogConstants.MODEL, false);
|
+ " time="+ ( System.currentTimeMillis() - startTime ) + "ms", //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
DebugLogConstants.MODEL, false);
|
||||||
|
}
|
||||||
} catch (ParseError e) {
|
} catch (ParseError e) {
|
||||||
checkCanceled();
|
checkCanceled();
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -315,7 +316,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
createSimpleDeclarations(parent, (IASTSimpleDeclaration)declaration, false);
|
createSimpleDeclarations(parent, (IASTSimpleDeclaration)declaration, false);
|
||||||
} else if (declaration instanceof ICPPASTVisibilityLabel) {
|
} else if (declaration instanceof ICPPASTVisibilityLabel) {
|
||||||
handleVisibilityLabel((ICPPASTVisibilityLabel)declaration);
|
handleVisibilityLabel((ICPPASTVisibilityLabel)declaration);
|
||||||
} else if(declaration instanceof ICPPASTNamespaceDefinition) {
|
} else if (declaration instanceof ICPPASTNamespaceDefinition) {
|
||||||
createNamespace(parent, (ICPPASTNamespaceDefinition) declaration);
|
createNamespace(parent, (ICPPASTNamespaceDefinition) declaration);
|
||||||
} else if (declaration instanceof ICPPASTNamespaceAlias) {
|
} else if (declaration instanceof ICPPASTNamespaceAlias) {
|
||||||
// TODO [cmodel] namespace alias?
|
// TODO [cmodel] namespace alias?
|
||||||
|
@ -612,7 +613,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
element.setActive(enumDef.isActive());
|
element.setActive(enumDef.isActive());
|
||||||
|
|
||||||
IASTExpression initialValue= enumDef.getValue();
|
IASTExpression initialValue= enumDef.getValue();
|
||||||
if(initialValue != null){
|
if (initialValue != null){
|
||||||
element.setConstantExpression(ASTSignatureUtil.getExpressionString(initialValue));
|
element.setConstantExpression(ASTSignatureUtil.getExpressionString(initialValue));
|
||||||
}
|
}
|
||||||
// add to parent
|
// add to parent
|
||||||
|
@ -695,7 +696,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
||||||
// add to parent
|
// add to parent
|
||||||
parent.addChild(element);
|
parent.addChild(element);
|
||||||
// set positions
|
// set positions
|
||||||
if(!isTemplate){
|
if (!isTemplate){
|
||||||
setBodyPosition(info, compositeTypeSpecifier);
|
setBodyPosition(info, compositeTypeSpecifier);
|
||||||
}
|
}
|
||||||
if (className.length() > 0) {
|
if (className.length() > 0) {
|
||||||
|
|
|
@ -603,7 +603,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
|
||||||
* Parse the buffer contents of this element.
|
* Parse the buffer contents of this element.
|
||||||
*/
|
*/
|
||||||
private void parse(Map<ICElement, CElementInfo> newElements, IProgressMonitor monitor) {
|
private void parse(Map<ICElement, CElementInfo> newElements, IProgressMonitor monitor) {
|
||||||
boolean quickParseMode = ! (CCorePlugin.getDefault().useStructuralParseMode());
|
boolean quickParseMode = !(CCorePlugin.getDefault().useStructuralParseMode());
|
||||||
IContributedModelBuilder mb = LanguageManager.getInstance().getContributedModelBuilderFor((ITranslationUnit) this);
|
IContributedModelBuilder mb = LanguageManager.getInstance().getContributedModelBuilderFor((ITranslationUnit) this);
|
||||||
if (mb == null) {
|
if (mb == null) {
|
||||||
parseUsingCModelBuilder(newElements, quickParseMode, monitor);
|
parseUsingCModelBuilder(newElements, quickParseMode, monitor);
|
||||||
|
|
Loading…
Add table
Reference in a new issue