final Names names) {
for(Object treeHolder : treeHolders){
if (!(treeHolder instanceof CeylonCompilationUnit)) {
continue;
}
final CeylonCompilationUnit tree = (CeylonCompilationUnit)treeHolder;
CompilationUnit ceylonTree = tree.ceylonTree;
final String pkgName = tree.getPackageName() != null ? Util.quoteJavaKeywords(tree.getPackageName().toString()) : "";
ceylonTree.visit(new SourceDeclarationVisitor(){
@Override
public void loadFromSource(Declaration decl) {
if(isNative(decl))
return;
String fqn = Naming.toplevelClassName(pkgName, decl);
try{
reader.enterClass(names.fromString(fqn), tree.getSourceFile());
}catch(AssertionError error){
// this happens when we have already registered a source file for this decl, hopefully the typechecker
// will catch this and log an error
}
}
@Override
public void loadFromSource(ModuleDescriptor that) {
try{
reader.enterClass(names.fromString(pkgName + "." +Naming.MODULE_DESCRIPTOR_CLASS_NAME), tree.getSourceFile());
}catch(AssertionError error){
// this happens when we have already registered a source file for this decl, hopefully the typechecker
// will catch this and log an error
}
}
@Override
public void loadFromSource(PackageDescriptor that) {
try{
reader.enterClass(names.fromString(pkgName + "." +Naming.PACKAGE_DESCRIPTOR_CLASS_NAME), tree.getSourceFile());
}catch(AssertionError error){
// this happens when we have already registered a source file for this decl, hopefully the typechecker
// will catch this and log an error
}
}