Skip to content

Commit

Permalink
Support flat value instances in YAML sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
psiberx committed Jul 9, 2024
1 parent fcbe56d commit 5da81cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/App/Tweaks/Declarative/Yaml/YamlReader.Template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace
{
constexpr auto InstanceAttrKey = "$instances";
constexpr auto ValueAttrKey = "$value";

constexpr auto AttrMark = '$';
constexpr auto AttrOpen = "({";
Expand Down Expand Up @@ -212,7 +213,15 @@ void ProcessNode(const YAML::Node& aNode, const InstanceData& aInstanceData)
instanceNode.SetTag(subNode.Tag());
ProcessNode(instanceNode, instanceData);

expandedNode.push_back(instanceNode);
const auto& valueNode = instanceNode[ValueAttrKey];
if (valueNode.IsDefined() && valueNode.IsScalar())
{
expandedNode.push_back(valueNode);
}
else
{
expandedNode.push_back(instanceNode);
}
}

continue;
Expand Down
2 changes: 1 addition & 1 deletion xmake.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set_xmakever("2.5.9")

set_project("TweakXL")
set_version("1.10.1", {build = "%y%m%d%H%M"})
set_version("1.10.2", {build = "%y%m%d%H%M"})

set_arch("x64")
set_languages("cxx2a")
Expand Down

0 comments on commit 5da81cb

Please sign in to comment.