MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / pythonAPI_

Method pythonAPI_

src/SourceCompile/CompileSourceFile.cpp:171–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171bool CompileSourceFile::pythonAPI_() {
172#ifdef SURELOG_WITH_PYTHON
173 if (getCommandLineParser()->pythonListener()) {
174 m_pythonListener = new PythonListen(m_parser, this);
175 if (!m_pythonListener->listen()) {
176 return false;
177 }
178 bool fatalErrors = m_errors->hasFatalErrors();
179 if (fatalErrors) {
180 return false;
181 }
182 }
183
184 if (getCommandLineParser()->pythonEvalScriptPerFile()) {
185 PythonAPI::evalScriptPerFile(
186 FileSystem::getInstance()->toPath(
187 getCommandLineParser()->pythonEvalScriptPerFileId()),
188 m_errors, m_parser->getFileContent(), m_interpState);
189 }
190 return true;
191#else
192 return false;
193#endif
194}
195
196bool CompileSourceFile::initParser() {
197 if (m_parser == nullptr)

Callers

nothing calls this directly

Calls 7

pythonListenerMethod · 0.80
hasFatalErrorsMethod · 0.80
toPathMethod · 0.80
listenMethod · 0.45
getFileContentMethod · 0.45

Tested by

no test coverage detected