mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Code formatting.
This commit is contained in:
parent
65b3044dca
commit
8f45aeca2f
2 changed files with 103 additions and 109 deletions
|
@ -86,7 +86,6 @@ import org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor;
|
|||
* @author aniefer
|
||||
*/
|
||||
public class AST2BaseTest extends BaseTestCase {
|
||||
|
||||
protected static final IParserLogService NULL_LOG = new NullLogService();
|
||||
|
||||
public AST2BaseTest() {
|
||||
|
@ -104,31 +103,31 @@ public class AST2BaseTest extends BaseTestCase {
|
|||
protected IASTTranslationUnit parse(String code, ParserLanguage lang, boolean useGNUExtensions) throws ParserException {
|
||||
return parse(code, lang, useGNUExtensions, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string
|
||||
* @param c
|
||||
* @return
|
||||
* @throws ParserException
|
||||
*/
|
||||
protected IASTTranslationUnit parse( String code, ParserLanguage lang, boolean useGNUExtensions, boolean expectNoProblems ) throws ParserException{
|
||||
protected IASTTranslationUnit parse(String code, ParserLanguage lang, boolean useGNUExtensions,
|
||||
boolean expectNoProblems) throws ParserException {
|
||||
return parse(code, lang, useGNUExtensions, expectNoProblems, false);
|
||||
}
|
||||
|
||||
protected IASTTranslationUnit parse( String code, ParserLanguage lang, boolean useGNUExtensions, boolean expectNoProblems , boolean parseComments) throws ParserException {
|
||||
protected IASTTranslationUnit parse(String code, ParserLanguage lang, boolean useGNUExtensions,
|
||||
boolean expectNoProblems, boolean parseComments) throws ParserException {
|
||||
IScanner scanner = createScanner(new CodeReader(code.toCharArray()), lang, ParserMode.COMPLETE_PARSE,
|
||||
new ScannerInfo(), parseComments);
|
||||
ISourceCodeParser parser2 = null;
|
||||
if( lang == ParserLanguage.CPP )
|
||||
{
|
||||
if (lang == ParserLanguage.CPP) {
|
||||
ICPPParserExtensionConfiguration config = null;
|
||||
if (useGNUExtensions)
|
||||
config = new GPPParserExtensionConfiguration();
|
||||
else
|
||||
config = new ANSICPPParserExtensionConfiguration();
|
||||
parser2 = new GNUCPPSourceParser(scanner, ParserMode.COMPLETE_PARSE, NULL_LOG,config, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ICParserExtensionConfiguration config = null;
|
||||
|
||||
if (useGNUExtensions)
|
||||
|
@ -144,20 +143,16 @@ public class AST2BaseTest extends BaseTestCase {
|
|||
if (parser2.encounteredError() && expectNoProblems)
|
||||
throw new ParserException("FAILURE"); //$NON-NLS-1$
|
||||
|
||||
if( lang == ParserLanguage.C && expectNoProblems )
|
||||
{
|
||||
if (lang == ParserLanguage.C && expectNoProblems) {
|
||||
assertEquals(CVisitor.getProblems(tu).length, 0);
|
||||
assertEquals(tu.getPreprocessorProblems().length, 0);
|
||||
}
|
||||
else if ( lang == ParserLanguage.CPP && expectNoProblems )
|
||||
{
|
||||
} else if (lang == ParserLanguage.CPP && expectNoProblems) {
|
||||
assertEquals(CPPVisitor.getProblems(tu).length, 0);
|
||||
assertEquals(0, tu.getPreprocessorProblems().length);
|
||||
}
|
||||
if (expectNoProblems)
|
||||
assertEquals(0, tu.getPreprocessorProblems().length);
|
||||
|
||||
|
||||
return tu;
|
||||
}
|
||||
|
||||
|
@ -286,9 +281,10 @@ public class AST2BaseTest extends BaseTestCase {
|
|||
|
||||
if (binding == null) assertTrue(false);
|
||||
|
||||
for( int i = 0; i < collector.size(); i++ )
|
||||
for (int i = 0; i < collector.size(); i++) {
|
||||
if (collector.getName(i).resolveBinding() == binding)
|
||||
count++;
|
||||
}
|
||||
|
||||
assertEquals(count, num);
|
||||
}
|
||||
|
@ -328,7 +324,6 @@ public class AST2BaseTest extends BaseTestCase {
|
|||
assertEquals(num, count);
|
||||
}
|
||||
|
||||
|
||||
protected void isExpressionStringEqual(IASTExpression exp, String str) {
|
||||
String expressionString = ASTSignatureUtil.getExpressionString(exp);
|
||||
assertEquals(str, expressionString);
|
||||
|
|
|
@ -546,7 +546,6 @@ public class CPPSemantics {
|
|||
if (n instanceof ICPPASTQualifiedName) {
|
||||
n = ((ICPPASTQualifiedName) n).getLastName();
|
||||
}
|
||||
|
||||
scope = CPPVisitor.getContainingScope(n);
|
||||
} else if (parent instanceof ICPPASTConstructorChainInitializer) {
|
||||
ICPPASTConstructorChainInitializer initializer = (ICPPASTConstructorChainInitializer) parent;
|
||||
|
|
Loading…
Add table
Reference in a new issue