core: allow ;-separated values in hl format

fixes #67
This commit is contained in:
Vaxry 2024-10-11 19:02:14 +01:00
parent 70fb494aa6
commit 0264e69814

View file

@ -71,13 +71,16 @@ static Hyprlang::CParseResult parseDefineSize(const char* C, const char* V) {
Hyprlang::CParseResult result; Hyprlang::CParseResult result;
const std::string VALUE = V; const std::string VALUE = V;
if (!VALUE.contains(",")) { CVarList sizes(VALUE, 0, ';');
for (const auto& sizeStr : sizes) {
if (!sizeStr.contains(",")) {
result.setError("Invalid define_size"); result.setError("Invalid define_size");
return result; return result;
} }
auto LHS = removeBeginEndSpacesTabs(VALUE.substr(0, VALUE.find_first_of(","))); auto LHS = removeBeginEndSpacesTabs(sizeStr.substr(0, sizeStr.find_first_of(",")));
auto RHS = removeBeginEndSpacesTabs(VALUE.substr(VALUE.find_first_of(",") + 1)); auto RHS = removeBeginEndSpacesTabs(sizeStr.substr(sizeStr.find_first_of(",") + 1));
auto DELAY = 0; auto DELAY = 0;
CMeta::SDefinedSize size; CMeta::SDefinedSize size;
@ -114,6 +117,7 @@ static Hyprlang::CParseResult parseDefineSize(const char* C, const char* V) {
size.size = 0; size.size = 0;
currentMeta->parsedData.definedSizes.push_back(size); currentMeta->parsedData.definedSizes.push_back(size);
}
return result; return result;
} }
@ -122,7 +126,11 @@ static Hyprlang::CParseResult parseOverride(const char* C, const char* V) {
Hyprlang::CParseResult result; Hyprlang::CParseResult result;
const std::string VALUE = V; const std::string VALUE = V;
CVarList overrides(VALUE, 0, ';');
for (const auto& o : overrides) {
currentMeta->parsedData.overrides.push_back(VALUE); currentMeta->parsedData.overrides.push_back(VALUE);
}
return result; return result;
} }