| 782 | } |
| 783 | |
| 784 | std::string PreprocessFile::evaluateMacroInstance( |
| 785 | std::string_view macro_instance, PreprocessFile* callingFile, |
| 786 | uint32_t callingLine, SpecialInstructions::CheckLoopInstr checkMacroLoop, |
| 787 | SpecialInstructions::AsIsUndefinedMacroInstr asisUndefMacro) { |
| 788 | std::string result; |
| 789 | // SymbolId macroArgs = registerSymbol (macro_instance); |
| 790 | SpecialInstructions instructions( |
| 791 | SpecialInstructions::Mute, SpecialInstructions::Mark, |
| 792 | SpecialInstructions::Filter, checkMacroLoop, asisUndefMacro); |
| 793 | PreprocessFile* pp = |
| 794 | new PreprocessFile(BadSymbolId, m_compileSourceFile, instructions, |
| 795 | m_includer ? m_includer->m_compilationUnit |
| 796 | : callingFile->m_compilationUnit, |
| 797 | callingFile->m_library, /* includer */ nullptr, |
| 798 | /* includerLine */ 0, macro_instance); |
| 799 | if (!pp->preprocess()) { |
| 800 | result = MacroNotDefined; |
| 801 | } else { |
| 802 | result = pp->getPreProcessedFileContent(); |
| 803 | } |
| 804 | forgetPreprocessor_(m_includer ? m_includer : callingFile, pp); |
| 805 | delete pp; |
| 806 | return result; |
| 807 | } |
| 808 | |
| 809 | static std::string_view getFirstNonEmptyToken( |
| 810 | const std::vector<std::string>& tokens) { |
no test coverage detected