示例#1
0
 public Import(ExportScopeRef exportScope, bool importAll, IImportable[] imports, string importAs, string leadingTrivia)
 {
     this.exportScope   = exportScope;
     this.importAll     = importAll;
     this.imports       = imports;
     this.importAs      = importAs;
     this.leadingTrivia = leadingTrivia;
     if (importAs != null && !importAll)
     {
         throw new Error("importAs only supported with importAll!");
     }
 }
示例#2
0
        public SourceFile(Import[] imports, Interface[] interfaces, Class[] classes, Enum_[] enums, GlobalFunction[] funcs, Block mainBlock, SourcePath sourcePath, ExportScopeRef exportScope)
        {
            this.imports          = imports;
            this.interfaces       = interfaces;
            this.classes          = classes;
            this.enums            = enums;
            this.funcs            = funcs;
            this.mainBlock        = mainBlock;
            this.sourcePath       = sourcePath;
            this.exportScope      = exportScope;
            this.availableSymbols = new Map <string, IImportable>();
            this.arrayTypes       = new ClassType[0];
            var fileScope = Package.collectExportsFromFile(this, true);

            this.addAvailableSymbols(fileScope.getAllExports());
        }