template broken
parent
da82a40699
commit
4ef3fe7573
|
@ -1,7 +1,7 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
include(cmake/color.cmake)
|
||||
|
||||
set(BLT_VERSION 0.16.25)
|
||||
set(BLT_VERSION 0.16.26)
|
||||
set(BLT_TEST_VERSION 0.0.1)
|
||||
|
||||
set(BLT_TARGET BLT)
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <blt/std/hashmap.h>
|
||||
#include <blt/std/types.h>
|
||||
#include <blt/std/expected.h>
|
||||
#include <blt/std/logging.h>
|
||||
#include <variant>
|
||||
|
||||
namespace blt
|
||||
|
@ -320,13 +321,17 @@ namespace blt
|
|||
auto next = consumer.consume();
|
||||
if (next.type == template_token_t::STRING)
|
||||
{
|
||||
BLT_TRACE(next.token);
|
||||
while (consumer.hasNext())
|
||||
BLT_TRACE(consumer.consume().token);
|
||||
if (!substitutions.contains(next.token))
|
||||
return blt::unexpected(template_parser_failure_t::SUBSTITUTION_NOT_FOUND);
|
||||
if (consumer.next().type == template_token_t::SEMI)
|
||||
if (consumer.next().type == template_token_t::SEMI || consumer.next().type == template_token_t::ELSE)
|
||||
{
|
||||
consumer.advance();
|
||||
return substitutions[next.token];
|
||||
}
|
||||
|
||||
if (consumer.next().type != template_token_t::ADD)
|
||||
return blt::unexpected(template_parser_failure_t::STRING_EXPECTED_CONCAT);
|
||||
consumer.advance();
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 10368163ab1f4367d2f0685b5928b1c973ebd1ec
|
||||
Subproject commit 7ef2e733416953b222851f9a360d7fc72d068ee5
|
|
@ -232,6 +232,8 @@ namespace blt
|
|||
}
|
||||
}
|
||||
|
||||
BLT_TRACE(return_str);
|
||||
|
||||
return return_str;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue