Implement support for import and export directives in the symbols table
This commit is contained in:
parent
ac45c1ea84
commit
abf5e3063a
@ -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;
|
*name = node->token_entry->token.value;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
case NODE_IMPORT_DIRECTIVE:
|
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:
|
case NODE_EXPORT_DIRECTIVE:
|
||||||
assert(false && "not implemented");
|
*kind = SYMBOL_EXPORT;
|
||||||
// TODO: when .import and .export directives are created add them here
|
*name = node->children[1]->token_entry->token.value;
|
||||||
|
return nullptr;
|
||||||
default:
|
default:
|
||||||
return err_symbol_table_invalid_node;
|
return err_symbol_table_invalid_node;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user