class Savi::Compiler::Namespace
- Savi::Compiler::Namespace
- Reference
- Object
Overview
The purpose of the Namespace pass is to determine which type names are visible from which source files, and to raise an appropriate error in the event that two types visible from the same source file have the same identifier.
This pass does not mutate the Program topology. This pass does not mutate the AST. This pass may raise a compilation error. This pass keeps state at the program level. This pass produces output state at the source package level.
Defined in:
savi/compiler/namespace.crConstructors
Instance Method Summary
-
#[](package : Program::Package::Link) : Analysis
When given a package link, return the set of types accessible within it.
-
#[](source_package : Source::Package) : Analysis
When given a source package, return the set of types accessible within it.
- #[]?(package : Program::Package::Link) : Analysis | Nil
- #[]?(source_package : Source::Package) : Analysis | Nil
- #core_savi_package_link
-
#core_savi_type(ctx, name : String) : Program::Type::Link
When given a String name, try to find the type in the core_savi package.
-
#find_func!(ctx, source, type_name, func_name)
TODO Remove this method? This is only for use in testing.
- #main_type!(ctx)
- #main_type?(ctx) : Program::Type::Link | Nil
- #run(ctx)
Constructor Detail
Instance Method Detail
When given a package link, return the set of types accessible within it.
When given a source package, return the set of types accessible within it.
When given a String name, try to find the type in the core_savi package. This is a way to resolve a builtin type by name without more context.
TODO Remove this method? This is only for use in testing.