scope tok_importedClassNames. // names that don't fit the uppercase-is-class mantra static Map #specialNames = litmap( "_MethodCache" := true, "DynamicObject_loading" := false ); static LS tok_importedClassNames(LS tok, IVF2 importFound default null) { new LS names; int n = l(tok); for (int i = 1; i < n; i += 2) if (eq(tok.get(i), "import") /*&& neq(get(tok, i+2), "static")*/) { // static may be OK, e.g. import static x30_pkg.x30_util.VF1; int j = findEndOfStatement(tok, i); // index of ;+1 S s = get(tok, j-3); // This is to distinguish from imported functions; // yes it's rough. if (or(specialNames.get(s), isIdentifier(s) && startsWithUpperCase(s))) names.add(s); if (importFound != null) { // We assume importFound can change the import statement and also reTok it importFound.get(tok, intRange(i, j)); n = l(tok); } else i = j-1; } ret names; } end scope