Documentation ¶
Overview ¶
We make three passes over the CST in the checker.
1. Build lexical scopes and memoize semantic data into the CST. 2. Type checking and other semantic checks. 3. After imports have resolved, semantic checks of imported identifiers.
Index ¶
Constants ¶
const (
BuiltinFilename = "<builtin>"
)
Variables ¶
var GlobalScope = NewBuiltinScope(builtin.Lookup)
GlobalScope is a scope containing references to all builtins.
Functions ¶
func Check ¶
Check fills in semantic data in the module and check for semantic errors.
References that refer to imported identifiers are checked with CheckReferences after imports have been resolved.
func CheckReferences ¶
CheckReferences checks for semantic errors for references. Imported modules are assumed to be reachable through the given module.
func NewBuiltinScope ¶
func NewBuiltinScope(builtins builtin.BuiltinLookup) *ast.Scope
NewBuiltinScope returns a new scope containing synthetic FuncDecl Objects for builtins.
func SemanticPass ¶
Types ¶
This section is empty.