From 4c79cf6808e5317bb46f055e986f42c1eb955d7a Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Sat, 23 Dec 2023 02:51:44 -0500 Subject: [PATCH] push --- src/load_file.cpp | 30 +++++++----------------------- src/load_file.h | 2 +- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/load_file.cpp b/src/load_file.cpp index b6e3db0..f6ac040 100644 --- a/src/load_file.cpp +++ b/src/load_file.cpp @@ -17,7 +17,7 @@ */ #include "load_file.h" #include -#include +#include namespace blt { @@ -155,29 +155,13 @@ namespace blt std::cout << std::string(func_name) << std::endl; } - std::string_view parser::strip_func(std::string_view func) + std::string parser::strip_func(std::string_view func) { - auto pos = func.find("Matrix"); - if (pos == std::string_view::npos) - { - for (size_t i = 0; i < func.size(); i++) - { - char c = func[i]; - switch (c) - { - case 'i': - case 'f': - case 'u': - pos = i - 1; - break; - default: - break; - } - if (pos != std::string_view ::npos) - break; - } - } - return std::string_view(); + std::string f (func); + + std::regex matrx(R"(((Matrix)(\d|\w)+)|(\d|I|L)+(i|u|f|d|v|s|N|b|I)+)"); + + return f; } } \ No newline at end of file diff --git a/src/load_file.h b/src/load_file.h index a905374..ff78a23 100644 --- a/src/load_file.h +++ b/src/load_file.h @@ -73,7 +73,7 @@ namespace blt return std::isalnum(c) || c == '_'; } - std::string_view strip_func(std::string_view func); + std::string strip_func(std::string_view func); void process_gl_func(std::string_view func_name); public: