Preprocessor: Fix #if0 #elif todo test case. Ticket: #2619
This commit is contained in:
parent
aa65eed02b
commit
fc0f75fe6a
|
@ -660,7 +660,7 @@ std::string Preprocessor::removeIf0(const std::string &code)
|
||||||
++level;
|
++level;
|
||||||
else if (line == "#endif")
|
else if (line == "#endif")
|
||||||
--level;
|
--level;
|
||||||
else if (line == "#else")
|
else if ((line == "#else") || (line.compare(0, 5, "#elif") == 0))
|
||||||
{
|
{
|
||||||
if (level == 1)
|
if (level == 1)
|
||||||
in = true;
|
in = true;
|
||||||
|
|
|
@ -723,8 +723,7 @@ private:
|
||||||
"B\n"
|
"B\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"C\n");
|
"C\n");
|
||||||
TODO_ASSERT_EQUALS("#if 0\n\n#elif 1\nB\n#endif\nC\n",
|
ASSERT_EQUALS("#if 0\n\n#elif 1\nB\n#endif\nC\n", preprocessor.read(code,"",NULL));
|
||||||
"#if 0\n\n\n\n#endif\nC\n", preprocessor.read(code,"",NULL));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void if0_include_1()
|
void if0_include_1()
|
||||||
|
|
Loading…
Reference in New Issue