示例#1
0
        internal AstPythonModule(string moduleName, IPythonInterpreter interpreter, PythonAst ast, string filePath, IEnumerable <string> parseErrors)
        {
            Name           = moduleName;
            _documentation = ast.Documentation;
            FilePath       = filePath;
            DocumentUri    = ProjectEntry.MakeDocumentUri(FilePath);
            Locations      = new[] { new LocationInfo(filePath, DocumentUri, 1, 1) };
            _interpreter   = interpreter;

            _properties   = new Dictionary <object, object>();
            _childModules = new List <string>();
            _members      = new Dictionary <string, IMember>();

            // Do not allow children of named modules
            if (!ModulePath.IsInitPyFile(FilePath))
            {
                _foundChildModules = true;
            }

            var walker = new AstAnalysisWalker(interpreter, ast, this, filePath, DocumentUri, _members, true, true);

            ast.Walk(walker);
            walker.Complete();

            ParseErrors = parseErrors?.ToArray();
        }
示例#2
0
        internal AstPythonModule(string moduleName, IPythonInterpreter interpreter, string documentation, string filePath, IEnumerable <string> parseErrors) :
            base(moduleName)
        {
            _documentation = documentation;
            FilePath       = filePath;
            DocumentUri    = ProjectEntry.MakeDocumentUri(FilePath);
            Locations      = new[] { new LocationInfo(filePath, DocumentUri, 1, 1) };
            _interpreter   = interpreter;

            // Do not allow children of named modules
            _foundChildModules = !ModulePath.IsInitPyFile(FilePath);
            ParseErrors        = parseErrors?.ToArray();
        }