Documentation
¶
Overview ¶
Package resolver turns syntax imports into project or compiler-known package identities before type checking. Backends therefore never interpret a raw TypeRB import path on their own.
Index ¶
- func CollectExports(statements []ast.Statement) map[string]Export
- func ValidateImportGraph(catalog *Catalog, results map[string]Result) map[string][]diagnostic.Diagnostic
- type Binding
- type Catalog
- type EnumVariant
- type Export
- type ExportKind
- type Import
- type ImportKind
- type Member
- type Module
- type Options
- type RecordField
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateImportGraph ¶
func ValidateImportGraph(catalog *Catalog, results map[string]Result) map[string][]diagnostic.Diagnostic
ValidateImportGraph rejects project import cycles with a deterministic path. A single cross-mode rule keeps initialization order independent of Ruby, TypeScript, or Go runtime loader behavior.
Types ¶
type Binding ¶
type Catalog ¶
func NewCatalog ¶
func NewCatalog(modules []Module) (*Catalog, map[string][]diagnostic.Diagnostic)
type EnumVariant ¶
type EnumVariant struct {
Name string
Fields []RecordField
}
type ExportKind ¶
type ExportKind string
const ( ClassExport ExportKind = "class" RecordExport ExportKind = "record" EnumExport ExportKind = "enum" ModuleExport ExportKind = "module" InterfaceExport ExportKind = "interface" FunctionExport ExportKind = "function" ValueExport ExportKind = "value" )
type Import ¶
type Import struct {
Node *ast.ImportStatement
Kind ImportKind
Path string
ModulePath string
Alias string
Symbols []string
Definition *stdlib.Package
Exports map[string]Export
Filename string
}
func (*Import) RuntimePath ¶
type ImportKind ¶
type ImportKind string
const ( StandardImport ImportKind = "standard" ProjectImport ImportKind = "project" )
type Result ¶
type Result struct {
Imports map[*ast.ImportStatement]*Import
Packages map[string]*Import
Symbols map[string]Binding
NativeSyntax bool
Declarations *declaration.Catalog
}
func Resolve ¶
func Resolve(program *ast.Program, options Options) (Result, []diagnostic.Diagnostic)
func (Result) ReceiverMethod ¶
ReceiverMethod returns an implicit portable method binding. The binding is deliberately backed by the same standard package definition as its function form, even though TypeRB source does not need to import the method.
Click to show internal directories.
Click to hide internal directories.