|
Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
|
A namespace is an isolation for names nad technically a compilation unit. More...
#include <stdatomic.h>#include "serene/rt/context.h"#include "serene/rt/engine.h"#include "serene/rt/impl/hashmap.h"#include "serene/rt/source_manager.h"#include "serene/utils.h"Go to the source code of this file.
Data Structures | |
| struct | srn_namespace_t |
Typedefs | |
| typedef struct srn_namespace_t | srn_namespace_t |
Functions | |
| srn_namespace_t * | srn_namespace_get_or_create (srn_engine_t *engine, srn_string_t *name, srn_error_t **err) |
| Create a new and empty namespace if it is not already created in the engine, if it exists, return the namespace. | |
| srn_namespace_t * | srn_namespace_load (srn_namespace_t *ns) |
| Load the namespace's source from the filesystem into src_buffer, parse it, and populate the symbol table. | |
A namespace is an isolation for names nad technically a compilation unit.
Typically each namespace will resolve to a single file on the filesystem. Namespaces maintain a sym table that maps global names that the namespace provides to their definition.
Definition in file namespaces.h.
| typedef struct srn_namespace_t srn_namespace_t |
| srn_namespace_t * srn_namespace_get_or_create | ( | srn_engine_t * | engine, |
| srn_string_t * | name, | ||
| srn_error_t ** | err ) |
Create a new and empty namespace if it is not already created in the engine, if it exists, return the namespace.
Note that in case of creation, this function will register the new namespace with the engine.
Definition at line 30 of file namespaces.c.
| srn_namespace_t * srn_namespace_load | ( | srn_namespace_t * | ns | ) |
Load the namespace's source from the filesystem into src_buffer, parse it, and populate the symbol table.
Not implemented, the current body returns null unconditionally, so callers cannot rely on it yet.
Definition at line 101 of file namespaces.c.