| 1244 | } |
| 1245 | |
| 1246 | std::string PreprocessFile::getPreProcessedFileContent() { |
| 1247 | FileSystem* const fileSystem = FileSystem::getInstance(); |
| 1248 | // If File is empty (Only CR) return an empty string |
| 1249 | bool nonEmpty = false; |
| 1250 | uint32_t pp_result_size = m_result.size(); |
| 1251 | for (uint32_t i = 0; i < pp_result_size; i++) { |
| 1252 | if ((m_result[i] != '\n') && (m_result[i] != ' ')) { |
| 1253 | nonEmpty = true; |
| 1254 | break; |
| 1255 | } |
| 1256 | } |
| 1257 | if (!nonEmpty) m_result.clear(); |
| 1258 | if (m_debugPPResult) { |
| 1259 | std::string objName = |
| 1260 | m_macroBody.empty() |
| 1261 | ? std::string("file ").append(fileSystem->toPath(m_fileId)) |
| 1262 | : std::string("macro ").append(m_macroBody); |
| 1263 | std::cout << "PP RESULT for " << objName |
| 1264 | << " : \nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n" |
| 1265 | << m_result << "\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" |
| 1266 | << std::endl; |
| 1267 | } |
| 1268 | return m_result; |
| 1269 | } |
| 1270 | |
| 1271 | PreprocessFile::IfElseStack& PreprocessFile::getStack() { |
| 1272 | PreprocessFile* tmp = this; |
no test coverage detected