diff --git a/raw/iw4/techniques/technique_test.technique.template b/raw/iw4/techniques/technique_test.technique.template index 20ba92e0..8024755c 100644 --- a/raw/iw4/techniques/technique_test.technique.template +++ b/raw/iw4/techniques/technique_test.technique.template @@ -1,12 +1,10 @@ #pragma options TEST(asdf, bla) #pragma switch TEST_SWITCH - #ifdef TEST_SWITCH #define SVAL "1" #else #define SVAL "0" #endif - #pragma filename "lemao_" + TEST + SVAL + ".txt" HAHA TEST #ifdef TEST_SWITCH diff --git a/src/Parser/Parsing/Impl/DefinesStreamProxy.cpp b/src/Parser/Parsing/Impl/DefinesStreamProxy.cpp index 87875911..0356f7b0 100644 --- a/src/Parser/Parsing/Impl/DefinesStreamProxy.cpp +++ b/src/Parser/Parsing/Impl/DefinesStreamProxy.cpp @@ -351,7 +351,7 @@ bool DefinesStreamProxy::MatchElIfDirective(const ParserLine& line, const unsign if (m_modes.top() == BlockMode::BLOCK_BLOCKED) return true; - if(m_modes.top() == BlockMode::IN_BLOCK) + if (m_modes.top() == BlockMode::IN_BLOCK) { m_modes.top() = BlockMode::BLOCK_BLOCKED; return true; @@ -528,7 +528,7 @@ void DefinesStreamProxy::ExtractParametersFromDefineUsage(const ParserLine& line valueHasStarted = false; } } - else if(c == '(') + else if (c == '(') { valueHasStarted = true; parenthesisDepth++; @@ -536,7 +536,7 @@ void DefinesStreamProxy::ExtractParametersFromDefineUsage(const ParserLine& line } else if (c == ')') { - if(parenthesisDepth > 0) + if (parenthesisDepth > 0) { valueHasStarted = true; parenthesisDepth--; @@ -663,21 +663,23 @@ ParserLine DefinesStreamProxy::NextLine() { auto line = m_stream->NextLine(); - if (m_in_define) + while (true) { - ContinueDefine(line); - line.m_line.clear(); + if (m_in_define) + { + ContinueDefine(line); + line = m_stream->NextLine(); + } + else if (MatchDirectives(line) || !m_modes.empty() && m_modes.top() != BlockMode::IN_BLOCK) + { + line = m_stream->NextLine(); + } + else + { + ExpandDefines(line); + return line; + } } - else if (MatchDirectives(line) || !m_modes.empty() && m_modes.top() != BlockMode::IN_BLOCK) - { - line.m_line.clear(); - } - else - { - ExpandDefines(line); - } - - return line; } bool DefinesStreamProxy::IncludeFile(const std::string& filename)