Exemplo n.º 1
0
        private void ResolveMacros([NotNull] IT4File file)
        {
            var context           = Context.MostSuitableProjectFile.NotNull();
            var logicalSourceFile = LogicalSourceFile.NotNull();
            var macros            = new List <string>();

            foreach (var directive in file.BlocksEnumerable.OfType <IT4DirectiveWithPath>())
            {
                macros.AddRange(directive.RawMacros);
            }

            IReadOnlyDictionary <string, string> resolvedMacros;

            if (macros.IsEmpty())
            {
                resolvedMacros = EmptyDictionary <string, string> .Instance;
            }
            else
            {
                resolvedMacros = MacroResolver.NotNull().ResolveHeavyMacros(macros, context);
            }
            foreach (var directive in file.BlocksEnumerable.OfType <IT4DirectiveWithPath>())
            {
                directive.InitializeResolvedPath(resolvedMacros, logicalSourceFile, context);
            }
        }