Пример #1
0
        public SourceSymbolCollection(PhpCompilation /*!*/ compilation)
        {
            Contract.ThrowIfNull(compilation);
            _compilation = compilation;

            _types     = new SymbolsCache <QualifiedName, SourceTypeSymbol>(this, f => f.ContainedTypes, t => t.MakeQualifiedName(), t => !t.IsConditional || t.IsAnonymousType);
            _functions = new SymbolsCache <QualifiedName, SourceFunctionSymbol>(this, f => f.Functions, f => f.QualifiedName, f => !f.IsConditional);
        }
Пример #2
0
        public SourceSymbolCollection(PhpCompilation /*!*/ compilation)
        {
            Contract.ThrowIfNull(compilation);
            _compilation = compilation;

            _types     = new SymbolsCache <QualifiedName, SourceTypeSymbol>(this, f => f.ContainedTypes, t => t.MakeQualifiedName(), t => !t.IsConditional || t.IsAnonymousType);
            _functions = new SymbolsCache <QualifiedName, SourceFunctionSymbol>(this, f => f.Functions, f => f.QualifiedName, f => !f.IsConditional);

            // class <constants> { ... }
            PopulateDefinedConstants(
                this.DefinedConstantsContainer = _compilation.AnonymousTypeManager.SynthesizeType("<constants>", Accessibility.Internal),
                _compilation.Options.Defines);
        }