Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/org/rascalmpl/interpreter/Evaluator.java
Original file line number Diff line number Diff line change
Expand Up @@ -1175,9 +1175,8 @@ private void reloadModules(IRascalMonitor monitor, Set<String> names, ISourceLoc
for (String mod : names) {
if (heap.existsModule(mod)) {
var uri = heap.getModuleURI(mod);
assert uri != null : "guaranteed by Import::loadModule";

if (resolverRegistry.exists(vf.sourceLocation(uri))) {

if (mod.equals(ModuleEnvironment.SHELL_MODULE) || resolverRegistry.exists(vf.sourceLocation(uri))) {
// otherwise the file has been renamed or deleted, and we do
// not add it to the todo list.
onHeap.add(mod);
Expand All @@ -1189,8 +1188,10 @@ private void reloadModules(IRascalMonitor monitor, Set<String> names, ISourceLoc
extendingModules.addAll(heap.getExtendingModules(mod));
}

// this module starts with a clean slate
heap.removeModule(heap.getModule(mod));
if (!mod.equals(ModuleEnvironment.SHELL_MODULE)) {
// this module starts with a clean slate
heap.removeModule(heap.getModule(mod));
}
}
}

Expand Down Expand Up @@ -1324,7 +1325,7 @@ private Set<String> getExtendingModules(Set<String> names) {
found.addAll(dependingModules);
todo.addAll(dependingModules);
}

return found;
}

Expand Down
10 changes: 9 additions & 1 deletion src/org/rascalmpl/semantics/dynamic/Import.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,15 @@ public Extend(ISourceLocation src, IConstructor node, ImportedModule module) {
@Override
public Result<IValue> interpret(IEvaluator<Result<IValue>> eval) {
String name = Names.fullName(this.getModule().getName());
extendCurrentModule(this.getLocation(), name, eval);

if (!eval.getCurrentModuleEnvironment().getName().equals(ModuleEnvironment.SHELL_MODULE)) {
extendCurrentModule(this.getLocation(), name, eval);
}
else {
eval.warning("importing " + name + ", instead of extending.", URIUtil.rootLocation("prompt"));
importModule(name, this.getLocation(), eval);
}

return org.rascalmpl.interpreter.result.ResultFactory.nothing();
}
}
Expand Down
Loading