Fix param splitting for rebuild overrides

This commit is contained in:
NuoDaJia02
2026-02-04 18:09:23 +08:00
parent aa74fc2397
commit 32e15a7d9a

View File

@@ -1226,6 +1226,7 @@ std::vector<std::string> CerebrumNode::SplitQuotedString(const std::string & raw
std::string token;
bool in_quote_single = false;
bool in_quote_double = false;
int bracket_depth = 0;
auto trim_and_push = [&](std::string t) {
// 1. Trim surrounding whitespace
@@ -1251,7 +1252,15 @@ std::vector<std::string> CerebrumNode::SplitQuotedString(const std::string & raw
} else if (c == '"' && !in_quote_single) {
in_quote_double = !in_quote_double;
token.push_back(c);
} else if (c == ',' && !in_quote_single && !in_quote_double) {
} else if (!in_quote_single && !in_quote_double && (c == '[' || c == '{')) {
++bracket_depth;
token.push_back(c);
} else if (!in_quote_single && !in_quote_double && (c == ']' || c == '}')) {
if (bracket_depth > 0) {
--bracket_depth;
}
token.push_back(c);
} else if (c == ',' && !in_quote_single && !in_quote_double && bracket_depth == 0) {
trim_and_push(token);
token.clear();
} else {