mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
Fix defines proxy not being able to process parameters with underscores
This commit is contained in:
parent
17e7926442
commit
f5ed7880b0
@ -70,7 +70,7 @@ void DefinesStreamProxy::Define::IdentifyParameters(const std::vector<std::strin
|
||||
for (auto i = 0u; i < m_value.size(); i++)
|
||||
{
|
||||
const auto c = m_value[i];
|
||||
if (!isalnum(c))
|
||||
if (!isalnum(c) && c != '_')
|
||||
{
|
||||
if (inWord)
|
||||
{
|
||||
|
@ -471,6 +471,23 @@ namespace test::parsing::impl::defines_stream_proxy
|
||||
REQUIRE(proxy.Eof());
|
||||
}
|
||||
|
||||
TEST_CASE("DefinesStreamProxy: Ensure can define parameters with underscore", "[parsing][parsingstream]")
|
||||
{
|
||||
const std::vector<std::string> lines
|
||||
{
|
||||
"#define test(test_parameter) this is test_parameter",
|
||||
"Apparently test(a very cool text);"
|
||||
};
|
||||
|
||||
MockParserLineStream mockStream(lines);
|
||||
DefinesStreamProxy proxy(&mockStream);
|
||||
|
||||
ExpectLine(&proxy, 1, "");
|
||||
ExpectLine(&proxy, 2, "Apparently this is a very cool text;");
|
||||
|
||||
REQUIRE(proxy.Eof());
|
||||
}
|
||||
|
||||
TEST_CASE("DefinesStreamProxy: Ensure simple if is working with truthy value", "[parsing][parsingstream]")
|
||||
{
|
||||
const std::vector<std::string> lines
|
||||
|
Loading…
x
Reference in New Issue
Block a user