From 4ef3fe75731c28d3fbda886631628b56538b409b Mon Sep 17 00:00:00 2001 From: Brett Date: Fri, 10 May 2024 01:53:50 -0400 Subject: [PATCH] template broken --- CMakeLists.txt | 2 +- include/blt/parse/templating.h | 7 ++++++- libraries/parallel-hashmap | 2 +- src/blt/parse/templating.cpp | 2 ++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1f0219..5475b3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/include/blt/parse/templating.h b/include/blt/parse/templating.h index 9857811..64d28dd 100644 --- a/include/blt/parse/templating.h +++ b/include/blt/parse/templating.h @@ -27,6 +27,7 @@ #include #include #include +#include #include 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(); diff --git a/libraries/parallel-hashmap b/libraries/parallel-hashmap index 1036816..7ef2e73 160000 --- a/libraries/parallel-hashmap +++ b/libraries/parallel-hashmap @@ -1 +1 @@ -Subproject commit 10368163ab1f4367d2f0685b5928b1c973ebd1ec +Subproject commit 7ef2e733416953b222851f9a360d7fc72d068ee5 diff --git a/src/blt/parse/templating.cpp b/src/blt/parse/templating.cpp index 68af339..67c94b0 100644 --- a/src/blt/parse/templating.cpp +++ b/src/blt/parse/templating.cpp @@ -232,6 +232,8 @@ namespace blt } } + BLT_TRACE(return_str); + return return_str; } } \ No newline at end of file