Add functions for getting special types.

This commit is contained in:
Danila Fedorin 2018-05-27 00:11:00 -07:00
parent 1f7294ce29
commit 1f8788dd32
2 changed files with 21 additions and 0 deletions

View File

@ -159,6 +159,19 @@ libab_basetype* libab_get_basetype_function(libab* ab);
*/ */
libab_basetype* libab_get_basetype_function_list(libab* ab); libab_basetype* libab_get_basetype_function_list(libab* ab);
/**
* Get the type of a number in this libabacus instance.
* @param ab the instance to get the type for.
* @param into the reference to store the type into.
*/
void libab_get_type_num(libab* ab, libab_ref* into);
/**
* Get the type of the function list in this libabacus instance.
* @param ab the instance to get the type for.
* @param into the ference to store the type into.
*/
void libab_get_type_function_list(libab* ab, libab_ref* into);
/** /**
* Executes the given string of code. * Executes the given string of code.
* @param ab the libabacus instance to use for executing code. * @param ab the libabacus instance to use for executing code.

View File

@ -342,6 +342,14 @@ libab_basetype* libab_get_basetype_function_list(libab* ab) {
return &_basetype_function_list; return &_basetype_function_list;
} }
void libab_get_type_num(libab* ab, libab_ref* into) {
libab_ref_copy(&ab->type_num, into);
}
void libab_get_type_function_list(libab* ab, libab_ref* into) {
libab_ref_copy(&ab->type_function_list, into);
}
libab_result libab_run(libab* ab, const char* string, libab_ref* value) { libab_result libab_run(libab* ab, const char* string, libab_ref* value) {
libab_result result = LIBAB_SUCCESS; libab_result result = LIBAB_SUCCESS;
ll tokens; ll tokens;