Add functions to separately register different types of operators.

This commit is contained in:
2018-02-17 14:00:37 -08:00
parent a3ce8fbd9c
commit 8cd1d23120
4 changed files with 45 additions and 8 deletions

View File

@@ -17,7 +17,7 @@ libab_table_entry* table_search(libab_table* table, const char* string) {
libab_operator* libab_table_search_operator(libab_table* table, const char* string) {
libab_table_entry* entry = table_search(table, string);
libab_operator* to_return = NULL;
if(entry && entry->variant == ENTRY_OPERATOR) {
if(entry && entry->variant == ENTRY_OP) {
to_return = &entry->data_u.op;
}
return to_return;
@@ -25,7 +25,7 @@ libab_operator* libab_table_search_operator(libab_table* table, const char* stri
libab_function* libab_table_search_function(libab_table* table, const char* string) {
libab_table_entry* entry = table_search(table, string);
libab_function* to_return = NULL;
if(entry && entry->variant == ENTRY_FUNCTION) {
if(entry && entry->variant == ENTRY_FUN) {
to_return = &entry->data_u.function;
}
return to_return;