diff --git a/CMakeLists.txt b/CMakeLists.txt index afc7036..c97967e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(graphs VERSION 0.0.29) +project(graphs VERSION 0.0.30) option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF) option(ENABLE_UBSAN "Enable the ub sanitizer" OFF) diff --git a/lib/BLT-With-Graphics-Template b/lib/BLT-With-Graphics-Template index 7c61323..eaf1504 160000 --- a/lib/BLT-With-Graphics-Template +++ b/lib/BLT-With-Graphics-Template @@ -1 +1 @@ -Subproject commit 7c61323a05084e46ee8787750caa6f52aa9a099d +Subproject commit eaf15046b4cab4ef0c5a9ba96c2d4e2d81ae6e73 diff --git a/src/main.cpp b/src/main.cpp index bb2da0b..a8e087c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,9 +28,10 @@ #include #include #include - +#include #include #include +#include blt::gfx::matrix_state_manager global_matrices; blt::gfx::resource_manager resources; @@ -510,8 +511,47 @@ void update(const blt::gfx::window_data& data) fps = 1 / ft; } +void process_string(const std::string& str) +{ + BLT_DEBUG(str); + auto results = blt::template_engine_t::process_string(str); + if (results) + { + auto val = results.value(); + for (auto& v : val) + { + BLT_TRACE_STREAM << (blt::template_token_to_string(v.type)); + } + BLT_TRACE_STREAM << "\n"; + for (auto& v : val) + { + BLT_TRACE("{%s: %s}", blt::template_token_to_string(v.type).c_str(), std::string(v.token).c_str()); + } + } else + { + auto error = results.error(); + switch (error) + { + case blt::template_tokenizer_failure_t::MISMATCHED_CURLY: + BLT_ERROR("Tokenizer Failure: Mismatched curly"); + break; + case blt::template_tokenizer_failure_t::MISMATCHED_PAREN: + BLT_ERROR("Tokenizer Failure: Mismatched parenthesis"); + break; + case blt::template_tokenizer_failure_t::MISMATCHED_QUOTE: + BLT_ERROR("Tokenizer Failure: Mismatched Quotes"); + break; + } + + } + BLT_DEBUG("--------------------------"); +} + int main(int, const char**) { + blt::template_engine_t templateEngine; + + return 0; blt::gfx::init(blt::gfx::window_data{"Graphing Lovers United", init, update, 1440, 720}.setSyncInterval(1)); global_matrices.cleanup(); resources.cleanup();