Versions in this module Expand all Collapse all v0 v0.2.8 Nov 4, 2024 Changes in this version type Kind + const KindDuration + const KindTime + func (k Kind) IsDuration() bool + func (k Kind) IsTime() bool v0.2.7 Oct 31, 2024 v0.2.6 Oct 24, 2024 Changes in this version type Annotation + func (a Annotation) Len() int + type Packages []*Package + func (Packages) Annotations() Annotations + func (Packages) Doc() *Doc + func (Packages) File() *File + func (Packages) Name() string + func (Packages) NamePos() Position + func (Packages) Package() *Package + func (Packages) Pos() Position + func (Packages) Typeof() string + func (x Packages) UsedKinds() Kinds v0.2.5 Oct 16, 2024 Changes in this version + func LenExpr(a *ArrayType) ast.Expr v0.2.4 Oct 14, 2024 Changes in this version + const NEXT_MAXSTACK + const NEXT_NOCOPYBUILTIN + const NEXT_PATH + const StubPrefix + var ErrParamNotFound = errors.New("param not found") + var ErrUnexpectedConstantType = errors.New("unexpected constant type") + var ErrUnpexpectedParamType = errors.New("unexpected param type") + func Compile(platform Platform, builtin FileSystem, args []string) + func FileNode(f *File) *ast.File + func Generate(c *Compiler) error + func IsTemplateNotFoundError(err error) bool + func UsedTypeNode(u *UsedType) ast.Type + type Annotation map[string]any + func (a Annotation) Has(name string) bool + func (a Annotation) NamePos(name string) Position + func (a Annotation) Node() Node + func (a Annotation) Pos() Position + func (a Annotation) ValuePos(name string) Position + type Annotations map[string]Annotation + func (a Annotations) Has(name string) bool + type ArrayType struct + ElemType Type + N int64 + func (*ArrayType) Kind() Kind + func (*ArrayType) Typeof() string + func (a *ArrayType) Actual() reflect.Value + func (a *ArrayType) String() string + func (x *ArrayType) Decl() Decl + func (x *ArrayType) UsedKinds() Kinds + type CallStmt struct + CallExpr *ast.CallExpr + func (*CallStmt) Typeof() string + type Comment struct + func (*Comment) Typeof() string + func (c *Comment) String() string + func (c *Comment) Text() string + type Compiler struct + func NewCompiler(platform Platform, builtin FileSystem) *Compiler + func (c *Compiler) AddFile(f *ast.File) (*File, error) + func (c *Compiler) Debug(msg string, args ...any) + func (c *Compiler) Error(args ...any) + func (c *Compiler) FileSet() *token.FileSet + func (c *Compiler) Files() map[string]*File + func (c *Compiler) GetFile(path string) *File + func (c *Compiler) Getenv(key string) (string, bool) + func (c *Compiler) Output() io.Writer + func (c *Compiler) Position() token.Position + func (c *Compiler) Resolve() error + func (c *Compiler) SetupCommandFlags(flagSet *flag.FlagSet, u flags.UsageFunc) + func (c *Compiler) Trace(msg string, args ...any) + func (c *Compiler) ValidateGrammar() error + type Const struct + Comment *Comment + func (*Const) Typeof() string + func (d Const) Annotations() Annotations + func (d Const) Doc() *Doc + func (x *Const) Type() *PrimitiveType + func (x *Const) UsedKinds() Kinds + func (x *Const) Value() *Value + func (x Const) File() *File + func (x Const) Name() string + func (x Const) NamePos() Position + func (x Const) Package() *Package + func (x Const) Pos() Position + type Consts = List[*Const] + type Decl interface + UsedKinds func() Kinds + type DeclType struct + func (d *DeclType[T]) Actual() reflect.Value + func (d *DeclType[T]) File() *File + func (d *DeclType[T]) String() string + func (x *DeclType[T]) Decl() Decl + func (x *DeclType[T]) Kind() Kind + func (x *DeclType[T]) Package() *Package + func (x *DeclType[T]) Pos() Position + func (x *DeclType[T]) Typeof() string + func (x *DeclType[T]) UsedKinds() Kinds + type Decls struct + Decl T + func (*Decls[T]) Typeof() string + func (d *Decls[T]) Consts() Consts + func (d *Decls[T]) Enums() Enums + func (d *Decls[T]) Interfaces() Interfaces + func (d *Decls[T]) List() []Decl + func (d *Decls[T]) Structs() Structs + type Doc struct + func (*Doc) Typeof() string + func (d *Doc) Format(indent string, beginAndEnd ...string) string + func (d *Doc) String() string + func (d *Doc) Text() string + type Enum struct + MemberType *PrimitiveType + Members *EnumMembers + Type *EnumType + func (*Enum) Typeof() string + func (d Enum) Annotations() Annotations + func (d Enum) Doc() *Doc + func (e *Enum) LookupLocalSymbol(name string) Symbol + func (x *Enum) UsedKinds() Kinds + func (x Enum) File() *File + func (x Enum) Name() string + func (x Enum) NamePos() Position + func (x Enum) Package() *Package + func (x Enum) Pos() Position + type EnumMember struct + Comment *Comment + Decl *Enum + func (*EnumMember) Typeof() string + func (d EnumMember) Annotations() Annotations + func (d EnumMember) Doc() *Doc + func (m *EnumMember) Index() int + func (m *EnumMember) IsFirst() bool + func (m *EnumMember) IsLast() bool + func (m *EnumMember) Value() *Value + func (x EnumMember) File() *File + func (x EnumMember) Name() string + func (x EnumMember) NamePos() Position + func (x EnumMember) Package() *Package + func (x EnumMember) Pos() Position + type EnumMembers = Fields[*Enum, *EnumMember] + type EnumType = DeclType[*Enum] + type Enums = List[*Enum] + type Fields struct + Decl D + List []F + func (f *Fields[D, F]) Lookup(name string) F + func (x *Fields[D, F]) Typeof() string + type File struct + Path string + func (*File) Typeof() string + func (f *File) Annotations() Annotations + func (f *File) Decls() *Decls[*File] + func (f *File) Doc() *Doc + func (f *File) Imports() *Imports[*File] + func (f *File) LookupLocalSymbol(name string) Symbol + func (f *File) LookupLocalType(name string) (Type, error) + func (f *File) LookupLocalValue(name string) (*Value, error) + func (x *File) File() *File + func (x *File) Name() string + func (x *File) NamePos() Position + func (x *File) Package() *Package + func (x *File) Pos() Position + func (x *File) UsedKinds() Kinds + type FileSystem interface + Abs func(name string) (string, error) + type Formatter func(filename string) error + type Import struct + Comment *Comment + Doc *Doc + FullPath string + Path string + func (*Import) Typeof() string + func (i *Import) File() *File + func (i *Import) Target() *File + type Imports struct + Decl Node + List []*Import + func (*Imports[T]) Typeof() string + func (i *Imports[T]) TrimmedList() []*Import + type Interface struct + Type *InterfaceType + func (*Interface) Typeof() string + func (d Interface) Annotations() Annotations + func (d Interface) Doc() *Doc + func (i *Interface) Methods() *InterfaceMethods + func (x *Interface) UsedKinds() Kinds + func (x Interface) File() *File + func (x Interface) Name() string + func (x Interface) NamePos() Position + func (x Interface) Package() *Package + func (x Interface) Pos() Position + type InterfaceMethod struct + Comment *Comment + Decl *Interface + Params *InterfaceMethodParams + Result *InterfaceMethodResult + func (*InterfaceMethod) Typeof() string + func (d InterfaceMethod) Annotations() Annotations + func (d InterfaceMethod) Doc() *Doc + func (m *InterfaceMethod) Index() int + func (m *InterfaceMethod) IsFirst() bool + func (m *InterfaceMethod) IsLast() bool + func (x InterfaceMethod) File() *File + func (x InterfaceMethod) Name() string + func (x InterfaceMethod) NamePos() Position + func (x InterfaceMethod) Package() *Package + func (x InterfaceMethod) Pos() Position + type InterfaceMethodParameter struct + Method *InterfaceMethod + Type Type + func (*InterfaceMethodParameter) Typeof() string + func (d InterfaceMethodParameter) Annotations() Annotations + func (d InterfaceMethodParameter) Doc() *Doc + func (p *InterfaceMethodParameter) Index() int + func (p *InterfaceMethodParameter) IsFirst() bool + func (p *InterfaceMethodParameter) IsLast() bool + func (x InterfaceMethodParameter) File() *File + func (x InterfaceMethodParameter) Name() string + func (x InterfaceMethodParameter) NamePos() Position + func (x InterfaceMethodParameter) Package() *Package + func (x InterfaceMethodParameter) Pos() Position + type InterfaceMethodParams = Fields[*InterfaceMethod, *InterfaceMethodParameter] + type InterfaceMethodResult struct + Method *InterfaceMethod + Type Type + func (*InterfaceMethodResult) Typeof() string + type InterfaceMethods = Fields[*Interface, *InterfaceMethod] + type InterfaceType = DeclType[*Interface] + type Interfaces = List[*Interface] + type Kind int + const KindAny + const KindArray + const KindBool + const KindByte + const KindBytes + const KindEnum + const KindFloat32 + const KindFloat64 + const KindInt + const KindInt16 + const KindInt32 + const KindInt64 + const KindInt8 + const KindInterface + const KindInvalid + const KindMap + const KindString + const KindStruct + const KindVector + func (i Kind) String() string + func (k *Kind) Set(s string) error + func (k Kind) Bits() int + func (k Kind) Compatible(other Kind) Kind + func (k Kind) IsAny() bool + func (k Kind) IsArray() bool + func (k Kind) IsBool() bool + func (k Kind) IsByte() bool + func (k Kind) IsBytes() bool + func (k Kind) IsEnum() bool + func (k Kind) IsFloat() bool + func (k Kind) IsInteger() bool + func (k Kind) IsInterface() bool + func (k Kind) IsMap() bool + func (k Kind) IsNumeric() bool + func (k Kind) IsPrimitive() bool + func (k Kind) IsString() bool + func (k Kind) IsStruct() bool + func (k Kind) IsVector() bool + func (k Kind) Valid() bool + type Kinds uint64 + func (ks Kinds) Has(k any) (bool, error) + type List []T + func (l List[T]) List() []T + func (x List[T]) Typeof() string + type LocatedObject interface + File func() *File + Package func() *Package + Pos func() Position + type MapType struct + ElemType Type + KeyType Type + func (*MapType) Kind() Kind + func (*MapType) Typeof() string + func (m *MapType) Actual() reflect.Value + func (m *MapType) String() string + func (x *MapType) Decl() Decl + func (x *MapType) UsedKinds() Kinds + type Meta map[string]string + type Node interface + Annotations func() Annotations + Doc func() *Doc + Name func() string + NamePos func() Position + type Object interface + Typeof func() string + func LookupFileObject(f *File, n ast.Node) Object + type Options struct + Env flags.Map + Formatter flags.Map + Grammar string + Head string + Mapping flags.Map + Output flags.Map + Perm int + Solvers flags.MapSlice + Strict bool + Templates flags.MapSlice + Verbose int + func (o *Options) SetupCommandFlags(flagSet *flag.FlagSet, u flags.UsageFunc) + type Package struct + func (*Package) Typeof() string + func (p *Package) Annotations() Annotations + func (p *Package) Decls() *Decls[*Package] + func (p *Package) Doc() *Doc + func (p *Package) File() *File + func (p *Package) Files() []*File + func (p *Package) Has(obj Object) (bool, error) + func (p *Package) Imports() *Imports[*Package] + func (p *Package) LookupLocalType(name string) (Type, error) + func (p *Package) LookupLocalValue(name string) (*Value, error) + func (p *Package) Name() string + func (p *Package) Package() *Package + func (p *Package) Pos() Position + func (p *Package) Types() []Type + func (x *Package) NamePos() Position + func (x *Package) UsedKinds() Kinds + type Platform interface + Getenv func(string) string + IsExist func(string) bool + IsNotExist func(string) bool + ReadFile func(string) ([]byte, error) + Stderr func() io.Writer + Stdin func() io.Reader + UserHomeDir func() (string, error) + WriteFile func(string, []byte, os.FileMode, Formatter) error + func StandardPlatform() Platform + type Position struct + Column int + Filename string + Line int + func (p Position) IsValid() bool + func (p Position) String() string + type PrimitiveType struct + func (b *PrimitiveType) Actual() reflect.Value + func (b *PrimitiveType) String() string + func (x *PrimitiveType) Decl() Decl + func (x *PrimitiveType) Kind() Kind + func (x *PrimitiveType) Typeof() string + func (x *PrimitiveType) UsedKinds() Kinds + type Scope interface + LookupLocalSymbol func(name string) Symbol + type Stmt interface + type Struct struct + Type *StructType + func (*Struct) Typeof() string + func (d Struct) Annotations() Annotations + func (d Struct) Doc() *Doc + func (s *Struct) Fields() *StructFields + func (x *Struct) UsedKinds() Kinds + func (x Struct) File() *File + func (x Struct) Name() string + func (x Struct) NamePos() Position + func (x Struct) Package() *Package + func (x Struct) Pos() Position + type StructField struct + Comment *Comment + Decl *Struct + Type Type + func (*StructField) Typeof() string + func (d StructField) Annotations() Annotations + func (d StructField) Doc() *Doc + func (f *StructField) Index() int + func (f *StructField) IsFirst() bool + func (f *StructField) IsLast() bool + func (x StructField) File() *File + func (x StructField) Name() string + func (x StructField) NamePos() Position + func (x StructField) Package() *Package + func (x StructField) Pos() Position + type StructFields = Fields[*Struct, *StructField] + type StructType = DeclType[*Struct] + type Structs = List[*Struct] + type Symbol interface + func LookupSymbol(scope Scope, name string) Symbol + type SymbolNotFoundError struct + Name string + func (e *SymbolNotFoundError) Error() string + type SymbolRedefinedError struct + Name string + Prev Symbol + func (e *SymbolRedefinedError) Error() string + type TemplateNotFoundError struct + Name string + func (e *TemplateNotFoundError) Error() string + type Type interface + Actual func() reflect.Value + Decl func() Decl + Kind func() Kind + String func() string + UsedKinds func() Kinds + func LookupType(scope Scope, name string) (Type, error) + type UnexpectedSymbolTypeError struct + Got string + Name string + Want string + func (e *UnexpectedSymbolTypeError) Error() string + type UsedType struct + Type Type + func Use(depth int, src ast.Type, node Node, t Type) *UsedType + func (*UsedType) Typeof() string + func (u *UsedType) Actual() reflect.Value + func (u *UsedType) File() *File + func (u *UsedType) Node() reflect.Value + func (u *UsedType) String() string + func (x *UsedType) Decl() Decl + func (x *UsedType) Kind() Kind + func (x *UsedType) UsedKinds() Kinds + type Value struct + func LookupValue(scope Scope, name string) (*Value, error) + func (v *Value) Actual() any + func (v *Value) Enum() *Enum + func (v *Value) File() *File + func (v *Value) String() string + func (v *Value) Type() *PrimitiveType + func (x *Value) Package() *Package + func (x *Value) Pos() Position + func (x *Value) Typeof() string + type VectorType struct + ElemType Type + func (*VectorType) Kind() Kind + func (*VectorType) Typeof() string + func (v *VectorType) Actual() reflect.Value + func (v *VectorType) String() string + func (x *VectorType) Decl() Decl + func (x *VectorType) UsedKinds() Kinds