internal CPythonFunction(string name, string doc, bool isBuiltin, bool isStatic, IMemberContainer declaringType) { _name = name; _doc = doc; _isBuiltin = isBuiltin; _isStatic = isStatic; _declaringModule = CPythonModule.GetDeclaringModuleFromContainer(declaringType); _declaringType = declaringType as IPythonType; _overloads = new List <IPythonFunctionOverload>(); }
public CPythonFunction(ITypeDatabaseReader typeDb, string name, Dictionary <string, object> functionTable, IMemberContainer declaringType, bool isMethod = false) { _name = name; object doc; if (functionTable.TryGetValue("doc", out doc)) { _doc = doc as string; } object value; if (functionTable.TryGetValue("builtin", out value)) { _isBuiltin = Convert.ToBoolean(value); } else { _isBuiltin = true; } if (functionTable.TryGetValue("static", out value)) { _isStatic = Convert.ToBoolean(value); } else { _isStatic = true; } _hasLocation = false;//PythonTypeDatabase.TryGetLocation(functionTable, ref _line, ref _column); _declaringModule = CPythonModule.GetDeclaringModuleFromContainer(declaringType); _declaringType = declaringType as IPythonType; if (functionTable.TryGetValue("overloads", out value)) { _overloads = LoadOverloads(typeDb, value, isMethod); } }
public CPythonProperty(ITypeDatabaseReader typeDb, Dictionary <string, object> valueDict, IMemberContainer container) { _declaringModule = CPythonModule.GetDeclaringModuleFromContainer(container); object value; if (valueDict.TryGetValue("doc", out value)) { _doc = value as string; } object type; valueDict.TryGetValue("type", out type); #if FALSE _hasLocation = PythonTypeDatabase.TryGetLocation(valueDict, ref _line, ref _column); #endif _hasLocation = false; typeDb.LookupType(type, typeValue => _type = typeValue); }