types

package
v0.0.0-...-6a25f69 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array struct {
	KeysTypes Types
	ElemTypes Types
	ArrayDim  uint8

	IsAssociative bool
}

type Base

type Base uint8
const (
	Undefined Base = iota
	Void
	Integer
	Float
	Bool
	String
	Null

	Arr

	Lazy
)

type LazyType

type LazyType uint8
const (
	None LazyType = iota
	FunctionCall
)

type LazyTypeFields

type LazyTypeFields struct {
	FunctionName string
}

type Type

type Type struct {
	BaseType Base

	LazyType LazyType
	LazyTypeFields

	Array
}

func NewArrayType

func NewArrayType(baseType Base) Type

func NewAssociativeArrayType

func NewAssociativeArrayType(keyTypes Types, elemTypes Types, dim uint8) Type

func NewLazyFunctionCallType

func NewLazyFunctionCallType(fn string) Type

func NewPlainArrayType

func NewPlainArrayType(elemTypes Types, dim uint8) Type

func NewType

func NewType(baseType Base) Type

func (Type) ElementTypes

func (t Type) ElementTypes() (Types, bool)

func (Type) Is

func (t Type) Is(tp Base) bool

func (Type) IsLazy

func (t Type) IsLazy() bool

func (Type) String

func (t Type) String() string

type Types

type Types struct {
	Types []Type
}

func NewBaseTypes

func NewBaseTypes(tp ...Base) Types

func NewTypes

func NewTypes(tp ...Type) Types

func (*Types) Add

func (ts *Types) Add(t Type)

func (*Types) AddArrayType

func (ts *Types) AddArrayType(keyTypes Types, elemTypes Types, dim uint8)

func (*Types) Contains

func (ts *Types) Contains(t Type) bool

func (*Types) ContainsMap

func (ts *Types) ContainsMap(ts2 Types) bool

func (*Types) ElementType

func (ts *Types) ElementType() Types

func (*Types) Equal

func (ts *Types) Equal(ts2 Types) bool

func (Types) GenerateCreation

func (ts Types) GenerateCreation(ts2 Types) (string, bool)

func (Types) GenerateName

func (ts Types) GenerateName() string

func (Types) Is

func (ts Types) Is(t Base) bool

func (*Types) KeyType

func (ts *Types) KeyType() Types

func (*Types) Len

func (ts *Types) Len() int

func (*Types) Merge

func (ts *Types) Merge(ts2 Types)

func (*Types) Resolved

func (ts *Types) Resolved() bool

func (*Types) SingleType

func (ts *Types) SingleType() bool

func (Types) String

func (ts Types) String() string

type VarInfo

type VarInfo struct {
	Fields       map[string]struct{}
	NeedGenerate bool
}

func NewVarInfo

func NewVarInfo() VarInfo

func (*VarInfo) Add

func (v *VarInfo) Add(f string)

func (*VarInfo) AddTypes

func (v *VarInfo) AddTypes(types Types)

func (*VarInfo) Generate

func (v *VarInfo) Generate() string

Jump to

Keyboard shortcuts

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