1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

updated C99 parser patch from Mike Kucera to provide preprocessor support (see Bugzilla 173110)

This commit is contained in:
Chris Recoskie 2007-03-14 19:15:45 +00:00
parent 609472bf8f
commit c7e0227b15
2 changed files with 12 additions and 3 deletions

View file

@ -191,7 +191,7 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
* @param length
* @param declarator
*/
private void assertSoleFileLocation(IASTNode n, String pathEndsWith,
protected void assertSoleFileLocation(IASTNode n, String pathEndsWith,
int offset, int length) {
IASTNodeLocation[] locations = n.getNodeLocations();
assertEquals(locations.length, 1);
@ -240,7 +240,7 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
}
}
private void checkInclude(IASTPreprocessorIncludeStatement inc, String file, String code, String name, boolean system) {
protected void checkInclude(IASTPreprocessorIncludeStatement inc, String file, String code, String name, boolean system) {
IASTName incName= inc.getName();
assertEquals(system, inc.isSystemInclude());

View file

@ -67,7 +67,16 @@ public class TestSourceReader {
fqn = fqn.indexOf("$")==-1 ? fqn : fqn.substring(0,fqn.indexOf("$"));
IPath filePath= new Path(srcRoot + '/' + fqn + ".java");
InputStream in= FileLocator.openStream(bundle, filePath, false);
InputStream in;
try {
in = FileLocator.openStream(bundle, filePath, false);
} catch(IOException e) {
if(clazz.getSuperclass()!=null && !clazz.equals(TestCase.class)) {
return getContentsForTest(bundle, srcRoot, clazz.getSuperclass(), testName, sections);
}
throw e;
}
BufferedReader br = new BufferedReader(new InputStreamReader(in));
List contents = new ArrayList();