From 13aa2274701e08d3f32e7f8e9be9253d2dced622 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sun, 2 Sep 2018 16:21:16 -0700 Subject: [PATCH] Add way to get string basetype. --- include/abacus.hpp | 1 + src/abacus.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/abacus.hpp b/include/abacus.hpp index 91a4536..6db55a1 100644 --- a/include/abacus.hpp +++ b/include/abacus.hpp @@ -19,6 +19,7 @@ class abacus { libab_basetype basetype_string = { [](void* s) { delete ((string*) s); }, NULL, 0 }; public: abacus(); + const libab_basetype* get_basetype_string(); void add_variable(const std::string& name, ref val); void add_function(const std::string& name, libab_function_ptr ptr, const std::string& type); void add_operator_infix(const std::string& op, const std::string& func, int assoc, int prec); diff --git a/src/abacus.cpp b/src/abacus.cpp index 5b64910..a7d4cfe 100644 --- a/src/abacus.cpp +++ b/src/abacus.cpp @@ -13,6 +13,10 @@ abacus::abacus() { libab_create_table(&ab, scope, &ab.table); } +const libab_basetype* abacus::get_basetype_string() { + return &basetype_string; +} + void abacus::add_variable(const std::string& name, ref val) { libab_table_entry* entry = libab_table_search_entry_value(get(scope), name.c_str()); if(entry) {