Example #1
0
        IEntity ResolveMacroExtensionType(MacroStatement node, IMethod extension)
        {
            if (null == extension)
            {
                return(null);
            }
            IType extendedMacroType = GetExtendedMacroType(extension);

            if (null == extendedMacroType)
            {
                return(null);
            }

            //ok now check if extension is correctly nested under parent
            foreach (MacroStatement parent in node.GetAncestors <MacroStatement>())
            {
                if (ResolveMacroName(parent) == extendedMacroType)
                {
                    return(GetExtensionMacroType(extension));
                }
            }

            return(null);
        }
Example #2
0
 private static bool MacroDefinitionContainsMacroApplication(TypeDefinition definition, MacroStatement statement)
 {
     return(statement.GetAncestors <TypeDefinition>().Any(ancestor => ancestor == definition));
 }