Documentation
¶
Overview ¶
Package typecheck is a Neugram type checker.
Index ¶
- Variables
- func IsError(t tipe.Type) bool
- type Checker
- func (c *Checker) Add(s stmt.Stmt) tipe.Type
- func (c *Checker) Check(path string) (*Package, error)
- func (c *Checker) Errs() []error
- func (c *Checker) Ident(e *expr.Ident) *Obj
- func (c *Checker) Lookup(name string) *Obj
- func (c *Checker) NewScope() *Checker
- func (c *Checker) Pkg(path string) *Package
- func (c *Checker) Type(e expr.Expr) (t tipe.Type)
- func (c *Checker) TypesWithPrefix(prefix string) (res []string)
- type Obj
- type ObjKind
- type Package
- type Scope
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) // contains filtered or unexported fields }
func (*Checker) Check ¶
Check typechecks a Neugram package.
func (*Checker) Errs ¶
Errs returns any errors encountered during type checking.
func (*Checker) Ident ¶
Ident reports the object an identifier refers to.
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) Pkg ¶
Pkg returns the type-checked Neugram or Go package. If the type checker has not processed the package, nil is returned.
type Obj ¶
type Obj struct { Name string Kind ObjKind Type tipe.Type Decl interface{} // *expr.FuncLiteral, *stmt.MethodikDecl, constant.Value, *stmt.TypeDecl, *Package Used bool }
An Obj represents a declared constant, type, variable, or function.
type Package ¶
Click to show internal directories.
Click to hide internal directories.