if (moduleEnvName.equals(ModuleEnvironment.SHELL_MODULE)) {
ur = URIUtil.rootScheme("rascal");
} else {
ur = eval.getRascalResolver().getRootForModule((URIUtil.createRascalModule(moduleEnvName)));
}
Result<?> loc = new SourceLocationResult(TF.sourceLocationType(), VF.sourceLocation(ur), eval);
String modulePath = moduleName.replaceAll("::", "/");
loc = loc.add(ResultFactory.makeResult(TF.stringType(), VF.string(modulePath), eval));
loc = loc.fieldUpdate("extension", ResultFactory.makeResult(TF.stringType(), VF.string(".rsc"), eval), eval.getCurrentEnvt().getStore());
OutputStream outputStream;
try {
outputStream = reg.getOutputStream(((ISourceLocation) loc.getValue()).getURI(), false);
}
catch (IOException e) {
outputStream = reg.getOutputStream(URIUtil.rootScheme("cwd"), false);
}