public Path.ID resolveAsModule(String name, Context context)
throws IOException, ResolveError {
for (WhileyFile.Import imp : context.imports()) {
Trie filter = imp.filter;
String last = filter.last();
if (last.equals("*")) {
// this is generic import, so narrow the filter.
filter = filter.parent().append(name);
} else if (!last.equals(name)) {
continue; // skip as not relevant