if (that.getVersion()==null) {
that.addError("missing module version");
}
String version = getVersionString(that.getVersion());
List<String> name;
Node node;
if (that.getImportPath()!=null) {
name = getNameAsList(that.getImportPath());
node = that.getImportPath();
}
else if (that.getQuotedLiteral()!=null) {
String nameString = getNameString(that.getQuotedLiteral());
name = asList(nameString.split("\\."));
node = that.getQuotedLiteral();
}
else {
name = Collections.emptyList();
node = null;
}
if (name.isEmpty()) {
that.addError("missing module name");
}
else if (name.get(0).equals(Module.DEFAULT_MODULE_NAME)) {
if (that.getImportPath()!=null) {
node.addError("reserved module name: 'default'");
}
}
else if (name.size()==1 && name.get(0).equals("ceylon")) {
if (that.getImportPath()!=null) {
node.addError("reserved module name: 'ceylon'");
}
}
else if (name.size()>1 && name.get(0).equals("ceylon")
&& name.get(1).equals("language")) {
if (that.getImportPath()!=null) {
node.addError("the language module is imported implicitly");
}
}
else {
Module importedModule = moduleManager.getOrCreateModule(name,version);
if (that.getImportPath()!=null) {