Add way to get string basetype.
This commit is contained in:
parent
441e69065e
commit
13aa227470
|
@ -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);
|
||||
|
|
|
@ -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<libab_table>(scope), name.c_str());
|
||||
if(entry) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user