Luma 0.1.0
A low-level compiled alternative to C, C++, and more!
Loading...
Searching...
No Matches
Functions
module.c File Reference
#include "type.h"
#include <stdio.h>
#include <string.h>
Include dependency graph for module.c:

Functions

bool register_module (Scope *global_scope, const char *module_name, Scope *module_scope, ArenaAllocator *arena)
 Register a module scope in the global scope.
 
Scopefind_module_scope (Scope *global_scope, const char *module_name)
 Find a module scope by name.
 
bool add_module_import (Scope *importing_scope, const char *module_name, const char *alias, Scope *module_scope, ArenaAllocator *arena)
 Add a module import to a scope.
 
Symbollookup_qualified_symbol (Scope *scope, const char *module_alias, const char *symbol_name)
 Look up a qualified symbol (module_alias.symbol_name) with visibility rules.
 
Scopecreate_module_scope (Scope *global_scope, const char *module_name, ArenaAllocator *arena)
 Create a new module scope.
 
void build_dependency_graph (AstNode **modules, size_t module_count, GrowableArray *dep_graph, ArenaAllocator *arena)
 
bool process_module_in_order (const char *module_name, GrowableArray *dep_graph, AstNode **modules, size_t module_count, Scope *global_scope, ArenaAllocator *arena)
 Process modules in dependency order (topological sort)
 
bool typecheck_os_stmt (AstNode *node, Scope *scope, ArenaAllocator *arena)
 
bool typecheck_link_stmt (AstNode *node, Scope *scope, ArenaAllocator *arena)
 

Function Documentation

◆ add_module_import()

bool add_module_import ( Scope importing_scope,
const char *  module_name,
const char *  alias,
Scope module_scope,
ArenaAllocator arena 
)

Add a module import to a scope.

◆ build_dependency_graph()

void build_dependency_graph ( AstNode **  modules,
size_t  module_count,
GrowableArray dep_graph,
ArenaAllocator arena 
)

◆ create_module_scope()

Scope * create_module_scope ( Scope global_scope,
const char *  module_name,
ArenaAllocator arena 
)

Create a new module scope.

◆ find_module_scope()

Scope * find_module_scope ( Scope global_scope,
const char *  module_name 
)

Find a module scope by name.

◆ lookup_qualified_symbol()

Symbol * lookup_qualified_symbol ( Scope scope,
const char *  module_alias,
const char *  symbol_name 
)

Look up a qualified symbol (module_alias.symbol_name) with visibility rules.

◆ process_module_in_order()

bool process_module_in_order ( const char *  module_name,
GrowableArray dep_graph,
AstNode **  modules,
size_t  module_count,
Scope global_scope,
ArenaAllocator arena 
)

Process modules in dependency order (topological sort)

◆ register_module()

bool register_module ( Scope global_scope,
const char *  module_name,
Scope module_scope,
ArenaAllocator arena 
)

Register a module scope in the global scope.

◆ typecheck_link_stmt()

bool typecheck_link_stmt ( AstNode node,
Scope scope,
ArenaAllocator arena 
)

◆ typecheck_os_stmt()

bool typecheck_os_stmt ( AstNode node,
Scope scope,
ArenaAllocator arena 
)