Implement support for import and export directives in the symbols table
This commit is contained in:
		| @@ -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; | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user