compiler/stage2_l0/src/signatures.l0
Module signatures
Overview Symbols grouped by source file: compiler/stage2_l0/src/signatures.l0
Module: signatures
Source: compiler/stage2_l0/src/signatures.l0 Language: Dea/L0
Imports / Includes
name_resolvertypessymbolsasttype_resolvedriverstd.vectorstd.textutil.diagstd.stringstd.hashsetstd.hashmap
Symbols
- sig_key
- sig_top_decl_name
- sig_top_decl_span
- sig_diag_error
- sig_type_vec_free
- sig_set_free_opt
- sig_type_vec_free_opt
- sig_struct_field_vec_temp_free
- sig_enum_variant_vec_temp_free
- sig_lookup_func_type
- sig_lookup_struct_info
- sig_lookup_enum_info
- sig_lookup_let_type
- sig_make_tables
- sig_resolve_struct
- sig_resolve_enum
- sig_resolve_func
- sig_infer_literal_type
- sig_symbol_is_zero_field_enum_variant
- sig_resolve_let
- sig_extract_dependencies
- sig_cycle_visit
- sig_detect_value_type_cycles
- sig_resolve
Function sig_key
func sig_key(module_name: string, name: string) -> string
Build a fully qualified signature-table key.
Parameters:
module_name: Defining module name.name: Symbol name.
Returns: Key in module::name form.
Function sig_top_decl_name
func sig_top_decl_name(top: TopLevelDecl*) -> string
Return the declared name carried by one top-level AST entry.
Parameters:
top: Top-level declaration to inspect.
Returns: Declaration name.
Function sig_top_decl_span
func sig_top_decl_span(top: TopLevelDecl*) -> Span
Return the source span carried by one top-level AST entry.
Parameters:
top: Top-level declaration to inspect.
Returns: Declaration span.
Function sig_diag_error
func sig_diag_error(diags: DiagCollector*, code: string, message: string, filename: string, span: Span)
Emit a signature-resolution error for a source span.
Parameters:
diags: Diagnostic collector.code: Diagnostic code.message: Diagnostic message.filename: Source filename.span: Source span to highlight.
Function sig_type_vec_free
func sig_type_vec_free(items: VectorBase*?)
Free a vector of owned types.
Parameters:
items: Optional vector ofType*values to free.
Function sig_set_free_opt
func sig_set_free_opt(self: StringSet*?)
Free an optional string set.
Parameters:
self: Optional string set to free.
Function sig_type_vec_free_opt
func sig_type_vec_free_opt(items: VectorBase*?)
Free an optional vector of owned types.
Parameters:
items: Optional vector ofType*values to free.
Function sig_struct_field_vec_temp_free
func sig_struct_field_vec_temp_free(items: VectorBase*?)
Free a temporary vector of struct-field metadata.
Parameters:
items: Optional vector ofStructFieldInfo*values to free.
Function sig_enum_variant_vec_temp_free
func sig_enum_variant_vec_temp_free(items: VectorBase*?)
Free a temporary vector of enum-variant metadata.
Parameters:
items: Optional vector ofEnumVariantInfo*values to free.
Function sig_lookup_func_type
func sig_lookup_func_type(self: SignatureTables*, module_name: string, name: string) -> Type*?
Look up a resolved function type.
Parameters:
self: Signature tables to inspect.module_name: Defining module name.name: Function name.
Returns: Function type, or null if absent.
Function sig_lookup_struct_info
func sig_lookup_struct_info(self: SignatureTables*, module_name: string, name: string) -> StructInfo*?
Look up resolved struct metadata.
Parameters:
self: Signature tables to inspect.module_name: Defining module name.name: Struct name.
Returns: Struct info, or null if absent.
Function sig_lookup_enum_info
func sig_lookup_enum_info(self: SignatureTables*, module_name: string, name: string) -> EnumInfo*?
Look up resolved enum metadata.
Parameters:
self: Signature tables to inspect.module_name: Defining module name.name: Enum name.
Returns: Enum info, or null if absent.
Function sig_lookup_let_type
func sig_lookup_let_type(self: SignatureTables*, module_name: string, name: string) -> Type*?
Look up a resolved top-level let type.
Parameters:
self: Signature tables to inspect.module_name: Defining module name.name: Binding name.
Returns: Resolved type, or null if absent.
Function sig_make_tables
func sig_make_tables() -> SignatureTables*
Create empty signature tables.
Returns: New signature tables.
Function sig_resolve_struct
func sig_resolve_struct(tables: SignatureTables*, nr: NameResolution*, env: ModuleEnv*, decl: StructDecl*, diags: DiagCollector*)
Resolve one struct declaration into stored signature metadata.
Parameters:
tables: Signature tables receiving resolved struct info.nr: Name-resolution data for symbol lookups.env: Module environment owning the declaration.decl: Struct declaration to resolve.diags: Diagnostic collector for resolution failures.
Function sig_resolve_enum
func sig_resolve_enum(tables: SignatureTables*, nr: NameResolution*, env: ModuleEnv*, decl: EnumDecl*, diags: DiagCollector*)
Resolve one enum declaration into stored signature metadata.
Parameters:
tables: Signature tables receiving resolved enum info.nr: Name-resolution data for symbol lookups.env: Module environment owning the declaration.decl: Enum declaration to resolve.diags: Diagnostic collector for resolution failures.
Function sig_resolve_func
func sig_resolve_func(tables: SignatureTables*, nr: NameResolution*, env: ModuleEnv*, decl: FuncDecl*, diags: DiagCollector*)
Resolve one function declaration into a stored function type.
Parameters:
tables: Signature tables receiving resolved function types.nr: Name-resolution data for symbol lookups.env: Module environment owning the declaration.decl: Function declaration to resolve.diags: Diagnostic collector for resolution failures.
Function sig_infer_literal_type
func sig_infer_literal_type(tables: SignatureTables*, nr: NameResolution*, env: ModuleEnv*, driver_state: DriverState*, expr_id: ExprId) -> Type*?
Infer a top-level literal initializer type without full expression checking.
Parameters:
tables: Signature tables available during signature resolution.nr: Name-resolution data for symbol lookups.env: Module environment owning the initializer.driver_state: Driver state providing parsed ASTs.expr_id: Expression id to inspect.
Returns: Inferred literal type, or null when inference is not supported.
Function sig_symbol_is_zero_field_enum_variant
func sig_symbol_is_zero_field_enum_variant(sym: Symbol*) -> bool
Report whether one symbol names a zero-field enum variant.
Parameters:
sym: Symbol to inspect.
Returns: true when sym is a zero-field enum variant.
Function sig_resolve_let
func sig_resolve_let(tables: SignatureTables*, nr: NameResolution*, env: ModuleEnv*, driver_state: DriverState*, decl: LetDecl*, diags: DiagCollector*)
Resolve or infer the type of one top-level let binding.
Parameters:
tables: Signature tables receiving resolvedlettypes.nr: Name-resolution data for symbol lookups.env: Module environment owning the declaration.driver_state: Driver state providing parsed ASTs.decl:letdeclaration to resolve.diags: Diagnostic collector for resolution failures.
Function sig_extract_dependencies
func sig_extract_dependencies(ty: Type*, out: StringSet*)
Collect value-type dependencies referenced by a type.
Parameters:
ty: Type to inspect.out: Set that receives fully qualified dependency keys.
Function sig_cycle_visit
func sig_cycle_visit(tables: SignatureTables*, key: string, visiting: StringSet*, visited: StringSet*, diags: DiagCollector*) -> bool
Visit one value-type node in the cycle-detection graph.
Parameters:
tables: Signature tables containing resolved struct and enum metadata.key: Fully qualified type key to visit.visiting: DFS stack set for cycle detection.visited: Set of nodes already proven acyclic.diags: Diagnostic collector for emitted cycle errors.
Returns: true if this visit reaches a value-type cycle.
Function sig_detect_value_type_cycles
func sig_detect_value_type_cycles(tables: SignatureTables*, diags: DiagCollector*)
Detect value-type cycles across resolved structs and enums.
Parameters:
tables: Signature tables to inspect.diags: Diagnostic collector.
Function sig_resolve
func sig_resolve(driver_state: DriverState*, nr: NameResolution*, diags: DiagCollector*) -> SignatureTables*
Resolve top-level type signatures for parsed modules.
Parameters:
driver_state: Parsed driver state.nr: Name-resolution result.diags: Diagnostic collector.
Returns: Populated signature tables.