fix(parser): allow space before function macro arguments (#933)

This commit is contained in:
mo
2026-07-26 22:38:11 +02:00
committed by GitHub
parent 0c66d1838e
commit 8686b42120
2 changed files with 24 additions and 2 deletions
@@ -839,6 +839,24 @@ namespace test::parsing::impl::defines_stream_proxy
REQUIRE(proxy.Eof());
}
TEST_CASE("DefinesStreamProxy: Function macro call can have space before arguments", "[parsing][parsingstream]")
{
const std::vector<std::string> lines{
"#define CHOICE_X(itemIndex) itemIndex",
"CHOICE_X(2)",
"CHOICE_X (2)",
};
MockParserLineStream mockStream(lines);
DefinesStreamProxy proxy(&mockStream);
ExpectLine(&proxy, 1, "");
ExpectLine(&proxy, 2, "2");
ExpectLine(&proxy, 3, "2");
REQUIRE(proxy.Eof());
}
TEST_CASE("DefinesStreamProxy: Macro definition that has unclosed parameters throws an error", "[parsing][parsingstream]")
{
const std::vector<std::string> lines{