Documentation
¶
Index ¶
- Variables
- type Environment
- func (e *Environment) Define(name string, typ Type)
- func (e *Environment) Exports() map[string]Type
- func (e *Environment) Import(name string, env *Environment)
- func (e *Environment) IsTypeRegistered(expr ast.TypeExpr) bool
- func (e *Environment) RegisterImport(def *ast.IdentExpr) error
- func (e *Environment) RegisterType(def *ast.TypeDefStmt) error
- func (e Environment) ResolveType(expr ast.TypeExpr) (Type, error)
- type Fn
- type Indexer
- type List
- type Operation
- type Struct
- func (t *Struct) Assignable(o Type) bool
- func (t *Struct) Base() Type
- func (t *Struct) Comparable(o Type) bool
- func (t *Struct) Convertible(o Type) bool
- func (t *Struct) Index(v any) (Type, bool)
- func (t *Struct) IsRoot() bool
- func (t *Struct) Operable(o Type, op Operation) bool
- func (t *Struct) String() string
- type Template
- type Type
- type TypePair
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Invalid = &constant{"invalid", false} Bool = &constant{"bool", false} I8 = &constant{"i8", true} I16 = &constant{"i16", true} I32 = &constant{"i32", true} I64 = &constant{"i64", true} U8 = &constant{"u8", true} U16 = &constant{"u16", true} U32 = &constant{"u32", true} U64 = &constant{"u64", true} F32 = &constant{"f32", true} F64 = &constant{"f64", true} Int = New("int", I32) Uint = New("uint", U8) Byte = New("byte", U8) Rune = New("rune", U32) String = New("string", NewList(Rune)) )
Functions ¶
This section is empty.
Types ¶
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func NewEnvironment ¶
func NewEnvironment() *Environment
func (*Environment) Define ¶
func (e *Environment) Define(name string, typ Type)
func (*Environment) Exports ¶
func (e *Environment) Exports() map[string]Type
func (*Environment) Import ¶
func (e *Environment) Import(name string, env *Environment)
func (*Environment) IsTypeRegistered ¶
func (e *Environment) IsTypeRegistered(expr ast.TypeExpr) bool
func (*Environment) RegisterImport ¶
func (e *Environment) RegisterImport(def *ast.IdentExpr) error
func (*Environment) RegisterType ¶
func (e *Environment) RegisterType(def *ast.TypeDefStmt) error
func (Environment) ResolveType ¶
func (e Environment) ResolveType(expr ast.TypeExpr) (Type, error)
type List ¶
type List struct {
Type Type
}
func (*List) Assignable ¶
func (*List) Comparable ¶
func (*List) Convertible ¶
type Struct ¶
type Struct []TypePair
func (*Struct) Assignable ¶
func (*Struct) Comparable ¶
func (*Struct) Convertible ¶
type Template ¶
type Template struct {
In []Type
}
func NewTemplate ¶
func (*Template) Assignable ¶
func (*Template) Comparable ¶
func (*Template) Convertible ¶
Click to show internal directories.
Click to hide internal directories.