Allow tree-based function implementations.
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
void libab_behavior_free(libab_behavior* behavior) {
|
||||
libab_ref_free(&behavior->type);
|
||||
if(behavior->impl.variant == BIMPL_TREE) {
|
||||
libab_ref_free(&behavior->impl.data_u.tree);
|
||||
}
|
||||
}
|
||||
|
||||
void libab_operator_free(libab_operator* op) {
|
||||
|
||||
@@ -38,6 +38,8 @@ libab_result _initialize_behavior(libab* ab, libab_behavior* behavior,
|
||||
|
||||
ll_init(&tokens);
|
||||
|
||||
behavior->impl.variant = BIMPL_INTERNAL;
|
||||
behavior->impl.data_u.internal = func;
|
||||
result = libab_lexer_lex(&ab->lexer, type, &tokens);
|
||||
if(result == LIBAB_SUCCESS) {
|
||||
result = libab_parser_parse_type(&ab->parser, &tokens, type, &behavior->type);
|
||||
|
||||
Reference in New Issue
Block a user