// we really want to compile.
for(JCCompilationUnit parsedTree : parsedTrees){
if(parsedTree.sourcefile.equals(fileObject)
&& parsedTree instanceof CeylonCompilationUnit){
// same file! we already parsed it, let's return this one's module
PhasedUnit phasedUnit = ((CeylonCompilationUnit)parsedTree).phasedUnit;
// the module visitor does load the module but does not set the unit's package module
if(phasedUnit.getPackage().getModule() == null){
// so find the module it created
for(Module mod : ceylonContext.getModules().getListOfModules()){
// we recognise it with the unit
if(mod.getUnit() == phasedUnit.getUnit()){
// set the package's module
Package pkg = phasedUnit.getPackage();
pkg.setModule(mod);
mod.getPackages().add(pkg);
modulesLoadedFromSource.add(mod);
break;
}
}
}
// now return it
return phasedUnit.getPackage().getModule();
}
}
JCCompilationUnit javaCompilationUnit = parse(fileObject);
Module module;
if(javaCompilationUnit instanceof CeylonCompilationUnit){