Documentation ¶
Overview ¶
Package typecheck is a Neugram type checker.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Universe = &Scope{Objs: universeObjs}
Functions ¶
Types ¶
type Checker ¶
type Checker struct { ImportGo func(path string) (*gotypes.Package, error) Values map[expr.Expr]constant.Value NgPkgs map[string]*tipe.Package // abs file path -> pkg GoPkgs map[string]*tipe.Package // path -> pkg GoTypes map[gotypes.Type]tipe.Type // TODO: GoEquiv is tricky and deserving of docs. Particular type instance is associated with a Go type. That means EqualType(t1, t2)==true but t1 could have GoEquiv and t2 not. GoEquiv map[tipe.Type]gotypes.Type NumSpec map[expr.Expr]tipe.Basic // *tipe.Call, *tipe.CompLiteral -> numeric basic type Errs []error // contains filtered or unexported fields }
func (*Checker) NewScope ¶
NewScope make a copy of Checker with a new, blank current scope. The two checkers share all type checked data.
func (*Checker) TypesWithPrefix ¶
TypesWithPrefix returns the names of all types currently in scope that start with prefix.
type Obj ¶
type Obj struct { Kind ObjKind Type tipe.Type Decl interface{} // *expr.FuncLiteral, *stmt.MethodikDecl, constant.Value Used bool }
An Obj represents a declared constant, type, variable, or function.
Click to show internal directories.
Click to hide internal directories.