Skip to content

Commit

Permalink
Add alternative template syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
psiberx committed Aug 8, 2023
1 parent 98cbf85 commit 1fbec8b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/App/Project.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ constexpr auto Author = "psiberx";
constexpr auto NameW = L"TweakXL";
constexpr auto AuthorW = L"psiberx";

constexpr auto Version = semver::from_string_noexcept("1.2.0").value();
constexpr auto Version = semver::from_string_noexcept("1.2.1").value();
}
17 changes: 13 additions & 4 deletions src/App/Tweaks/Declarative/Yaml/YamlReader.Template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace
constexpr auto InstanceAttrKey = "$instances";

constexpr auto AttrMark = '$';
constexpr auto AttrOpen = '{';
constexpr auto AttrClose = '}';
constexpr auto AttrOpen = "({";
constexpr auto AttrClose = ")}";

struct InstanceValue
{
Expand Down Expand Up @@ -55,15 +55,24 @@ std::string FormatString(const std::string& aInput, const InstanceData& aData)
break;
}

if (*(attrOpen + 1) != AttrOpen)
int attCloseChr;
if (*(attrOpen + 1) == AttrOpen[0])
{
attCloseChr = AttrClose[0];
}
else if (*(attrOpen + 1) == AttrOpen[1])
{
attCloseChr = AttrClose[1];
}
else
{
*out = *str;
++out;
++str;
continue;
}

auto* attrClose = strchr(str, AttrClose);
auto* attrClose = strchr(str, attCloseChr);

if (!attrClose)
{
Expand Down
8 changes: 4 additions & 4 deletions src/App/Version.rc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#define VER_PRODUCTVERSION 1,2,0,0
#define VER_FILEVERSION 1,2,0,2308081605
#define VER_PRODUCTVERSION 1,2,1,0
#define VER_FILEVERSION 1,2,1,2308081607

#define VER_PRODUCTNAME_STR "TweakXL\0"
#define VER_PRODUCTVERSION_STR "1.2.0\0"
#define VER_FILEVERSION_STR "1.2.0.2308081605\0"
#define VER_PRODUCTVERSION_STR "1.2.1\0"
#define VER_FILEVERSION_STR "1.2.1.2308081607\0"

1 VERSIONINFO
FILEVERSION VER_FILEVERSION
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.2.0", {build = "%y%m%d%H%M"})
set_version("1.2.1", {build = "%y%m%d%H%M"})

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

0 comments on commit 1fbec8b

Please sign in to comment.