return cu.addSource(textSource.getId(), textSource.getText());
} else if (source instanceof FileSource) {
FileSource fileSource = (FileSource)source;
return cu.addSource(fileSource.getFile());
} else if (source instanceof UrlSource) {
UrlSource urlSource = (UrlSource)source;
return cu.addSource(urlSource.getUrl());
} else {
throw new CompileException("Don't know how to compile source " + source + ".", sources);
}
}