moduleContaining function
The URI of the module in modules whose tree contains node, by identity.
Implementation
String? moduleContaining(SAstNode node, Map<String, SCompilationUnit> modules) {
for (final entry in modules.entries) {
final pending = <SAstNode>[entry.value];
while (pending.isNotEmpty) {
final current = pending.removeLast();
if (identical(current, node)) return entry.key;
final children = _Children();
current.visitChildren(children);
pending.addAll(children.nodes);
}
}
return null;
}