checker

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

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

View Source
const (
	BuiltinFilename = "<builtin>"
)

Variables

GlobalScope is a scope containing references to all builtins.

Functions

func Check

func Check(mod *ast.Module) error

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

func CheckReferences(mod *ast.Module, name string) error

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

func SemanticPass(mod *ast.Module) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL