29 for (
size_t i = 0; i < decl_count; i++)
60 if (ctx->
tree == sema)
72 msg_note(evt,
"consider using import aliases; eg. `IMPORT my_%s := %s;", include->
name, include->
symbol);
85 for (
size_t i = 0; i < len; i++)
88 import_module(runtime, unit->
tree,
import);
CT_PUREFN CT_TREE_API const node_t * tree_get_node(const tree_t *tree)
CT_PUREFN CT_BASE_API text_view_t text_view_from(const char *text)
create a new non-owning text array this is a shortcut for
CT_BROKER_API void * unit_get_ast(compile_unit_t *unit)
CT_BROKER_API void unit_update(compile_unit_t *unit, void *ast, tree_t *tree)
CT_BROKER_API compile_unit_t * lang_get_unit(language_runtime_t *runtime, unit_id_t id)
CT_EVENTS_API event_builder_t evt_symbol_shadowed(logger_t *logger, const char *name, const node_t *prev, const node_t *next)
signal that a declaration would shadow a previous declaration
#define CT_UNUSED(x)
mark a variable as unused
CT_NOTIFY_API event_builder_t msg_notify(INOUT_NOTNULL logger_t *logs, const diagnostic_t *diagnostic, const node_t *node, STA_FORMAT_STRING const char *fmt,...)
notify the logger of a new message
CT_NOTIFY_API void msg_note(event_builder_t builder, STA_FORMAT_STRING const char *fmt,...)
add a note to an existing message
#define CTASSERT(expr)
assert a condition, prints the condition as a message
CT_NODISCARD CT_PUREFN CT_STD_API void * vector_get(const vector_t *vector, size_t index)
get a value from a vector
CT_NODISCARD CT_PUREFN CT_STD_API size_t vector_len(const vector_t *vector)
get the length of a vector
obr_forward_t obr_forward_decl(tree_t *sema, obr_t *decl)
tree_t * obr_add_init(tree_t *sema, obr_t *mod)
void obr_add_decl(tree_t *sema, obr_tag_t tag, const char *name, tree_t *decl)
add decls
tree_t * obr_get_namespace(tree_t *sema, const char *name)
void obr_forward_decls(language_runtime_t *runtime, compile_unit_t *unit)
void obr_process_imports(language_runtime_t *runtime, compile_unit_t *unit)
tree_t * tree
the tree for this unit is NULL if the unit has not been forward declared yet
an event builder handles adding additional information to an event
a non-owning view of text
const char * name
the name of the declaration