public static IEnumerable <ScriptSymbol> GetImportedScripts(this ScriptSymbol symbol) { #if FALLOUT4 var importedScriptIdentifiers = symbol?.File.CompilerType.pImportedTypes.Keys; #elif SKYRIM var importedScriptIdentifiers = symbol?.Definition.Definitions.OfType <ImportNode>().Select(n => ObjectIdentifier.Parse(n.Identifier.Text)); #endif return(importedScriptIdentifiers?. Select(name => ObjectIdentifier.Parse(name)). Where(name => name != symbol.Id). Except(symbol.GetExtendedScriptChain().Select(extended => extended.Id)). Select(name => symbol.File.Program.ScriptFiles[name].Symbol)); }