Implement support for import and export directives in the symbols table

This commit is contained in:
omicron 2025-04-08 21:01:59 +02:00
parent ac45c1ea84
commit abf5e3063a

View File

@ -66,10 +66,13 @@ error_t *symbol_table_get_node_info(ast_node_t *node, symbol_kind_t *kind,
*name = node->token_entry->token.value;
return nullptr;
case NODE_IMPORT_DIRECTIVE:
assert(false && "not implemented");
*kind = SYMBOL_IMPORT;
*name = node->children[1]->token_entry->token.value;
return nullptr;
case NODE_EXPORT_DIRECTIVE:
assert(false && "not implemented");
// TODO: when .import and .export directives are created add them here
*kind = SYMBOL_EXPORT;
*name = node->children[1]->token_entry->token.value;
return nullptr;
default:
return err_symbol_table_invalid_node;
}