pkg

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context int
const (
	CONST Context = iota
	IMPORT
	FN
)

type Package

type Package struct {
	Name   string
	TypEnv *types.Environment
	Scope  *Scope
}

func New

func New(name string) *Package

type Scope

type Scope struct {
	// contains filtered or unexported fields
}

func NewScope

func NewScope() *Scope

func NewSubScope

func NewSubScope(parent *Scope) *Scope

func (*Scope) Define

func (s *Scope) Define(name string, typ types.Type)

func (*Scope) DefineBuiltin

func (s *Scope) DefineBuiltin(name string, typ types.Type)

func (*Scope) Exports

func (s *Scope) Exports() map[string]types.Type

func (*Scope) Import

func (s *Scope) Import(name string, scope *Scope)

func (*Scope) Pop

func (s *Scope) Pop() *Scope

func (*Scope) RegisterFn

func (s *Scope) RegisterFn(def *ast.FnDefStmt) error

func (*Scope) RegisterImport

func (s *Scope) RegisterImport(def *ast.IdentExpr) error

func (Scope) ResolveExpr

func (s Scope) ResolveExpr(expr ast.Expr) (types.Type, error)

Jump to

Keyboard shortcuts

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