pkg

package
v0.0.0-...-2cb6afa Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 141 Imported by: 0

Documentation

Overview

Code generated by cmd/genstdlib/main.go; DO NOT EDIT.

Code generated by cmd/genstdlib/main.go; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallPackageFunction

func CallPackageFunction(pkg *Package, functionName string, args []any) ([]any, error)

func LoadGoMod

func LoadGoMod(filename string) (*modfile.File, error)

func LoadPackage

func LoadPackage(dir string, optionalConfig *packages.Config) (*packages.Package, error)

func OnOsExit

func OnOsExit(f func(int))

OnOsExit sets the function to be called when os.Exit is invoked in the interpreted code. The Go SDK os.Exit is not called.

func OnPanic

func OnPanic(f func(any))

OnPanic sets the function to be called when panic is invoked in the interpreted code. The Go SDK panic is not called.

func RegisterPackage

func RegisterPackage(pkgPath string, symbols map[string]reflect.Value)

Types

type ArrayType

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

func (ArrayType) String

func (a ArrayType) String() string

type AssignStmt

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

func (AssignStmt) String

func (a AssignStmt) String() string

type BasicLit

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

func (BasicLit) String

func (b BasicLit) String() string

type BinaryExpr

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

func (BinaryExpr) String

func (b BinaryExpr) String() string

type BinaryExprFunc

type BinaryExprFunc func(x, y reflect.Value) reflect.Value

type BlockStmt

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

func (BlockStmt) String

func (b BlockStmt) String() string

type BranchStmt

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

BranchStmt represents a break, continue, goto, or fallthrough statement.

func (BranchStmt) String

func (s BranchStmt) String() string

type CallExpr

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

func (CallExpr) String

func (c CallExpr) String() string

type CanAssign

type CanAssign interface {
	// contains filtered or unexported methods
}

type CanCompose

type CanCompose interface {
	// contains filtered or unexported methods
}

type CanMake

type CanMake interface {
	CanCompose
	// contains filtered or unexported methods
}

type CanSelect

type CanSelect interface {
	// contains filtered or unexported methods
}

CanSelect is implemented by types that support selection of fields or methods by name.

type CaseClause

type CaseClause struct {
	CasePos token.Pos // position of "case" or "default" keyword
	List    []Expr    // list of expressions; nil means default case
	Body    []Stmt
}

A CaseClause represents a case of an expression or type switch statement.

func (CaseClause) String

func (c CaseClause) String() string

type ChanType

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

func (ChanType) String

func (c ChanType) String() string

type CompositeLit

type CompositeLit struct {
	Lbrace     token.Pos  // position of "{"
	Type       Expr       // literal type; or nil
	ParserType types.Type // literal type; or nil
	Elts       []Expr     // list of composite elements; or nil
}

func (CompositeLit) String

func (c CompositeLit) String() string

type ConstVar

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

func (*ConstVar) String

func (cv *ConstVar) String() string

type ConstVarDecl

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

func (ConstVarDecl) String

func (c ConstVarDecl) String() string

type DAPAccess

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

func NewDAPAccess

func NewDAPAccess(vm *VM) *DAPAccess

NewDAPAccess creates a new wrapper around a VM instance to access DAP (Debug Adapter Protocol) data and control.

func (*DAPAccess) Launch

func (a *DAPAccess) Launch(functionName string, args []any)

Launch starts execution of the given function on the underlying VM with the provided arguments.

func (*DAPAccess) Next

func (a *DAPAccess) Next() error

Next advances the VM by a single debugging step.

func (*DAPAccess) Scopes

func (a *DAPAccess) Scopes(dap.ScopesArguments) (scopes []dap.Scope)

Scopes describes the variable scopes that are available for the current stack frame.

func (*DAPAccess) StackFrames

func (a *DAPAccess) StackFrames(dap.StackTraceArguments) (frames []dap.StackFrame)

StackFrames returns the current call stack for the selected thread.

func (*DAPAccess) Threads

func (a *DAPAccess) Threads() []dap.Thread

Threads reports the list of active debugger threads.

func (*DAPAccess) Variables

func (a *DAPAccess) Variables(args dap.VariablesArguments) (vars []dap.Variable)

Variables lists the variables for the provided scope reference.

type Decl

type Decl interface {
	Flowable
	Evaluable
}

type DeclStmt

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

func (DeclStmt) String

func (s DeclStmt) String() string

type DeferCallExpr

type DeferCallExpr struct {
	CallExpr
}

DeferCallExpr§ is a wrapper around CallExpr to distinguish defer calls from regular calls in the flow graph. For defer calls, the arguments are evaluated at the time of the defer statement creation.

func (DeferCallExpr) String

func (c DeferCallExpr) String() string

type DeferStmt

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

func (DeferStmt) String

func (d DeferStmt) String() string

type Ellipsis

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

func (Ellipsis) String

func (e Ellipsis) String() string

type Env

type Env interface {
	// contains filtered or unexported methods
}

type Environment

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

func (*Environment) String

func (e *Environment) String() string

type Evaluable

type Evaluable interface {
	// contains filtered or unexported methods
}

type Expr

type Expr interface {
	Flowable
	Evaluable
}

type ExprStmt

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

func (ExprStmt) String

func (s ExprStmt) String() string

type ExtendedType

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

type Count int

type ExtendedValue

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

ExtendedValue represents a value of an ExtendedType.

type ExternalPackage

type ExternalPackage struct {
	SDKPackage
}

func (ExternalPackage) String

func (p ExternalPackage) String() string

type Field

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

func (Field) String

func (l Field) String() string

type FieldAssignable

type FieldAssignable interface {
	// contains filtered or unexported methods
}

type FieldList

type FieldList struct {
	OpeningPos token.Pos
	List       []*Field
}

func (FieldList) String

func (l FieldList) String() string

type Flowable

type Flowable interface {
	// contains filtered or unexported methods
}

type ForStmt

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

func (ForStmt) String

func (f ForStmt) String() string

type Func

type Func interface {
	// contains filtered or unexported methods
}

FuncDecl and FuncLit implement this

type FuncDecl

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

func (FuncDecl) String

func (f FuncDecl) String() string

type FuncLit

type FuncLit struct {
	Type *FuncType
	Body *BlockStmt // TODO not sure what to do when Body and/or Type is nil
	// contains filtered or unexported fields
}

func (*FuncLit) String

func (f *FuncLit) String() string

type FuncType

type FuncType struct {
	FuncPos    token.Pos
	TypeParams *FieldList // type parameters; or nil
	Params     *FieldList // (incoming) parameters; non-nil
	Results    *FieldList // (outgoing) results; or nil
}

func (FuncType) String

func (t FuncType) String() string

type HasMethods

type HasMethods interface {
	// contains filtered or unexported methods
}

type Heap

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

type HeapPointer

type HeapPointer struct {
	Addr       uintptr      // unique address in the heap
	Type       reflect.Type // type of the pointed-to value
	EnvRef     Env          // if non-nil, this points to a variable in an environment
	EnvVarName string       // the variable name in the environment
}

HeapPointer represents a pointer to a value stored in the VM's heap. This is used to handle pointer escape analysis - when a local variable's address is taken, it needs to survive beyond its scope (in gi terms: environment).

func (*HeapPointer) String

func (hp *HeapPointer) String() string

String formats the HeapPointer to look like a real pointer address.

func (*HeapPointer) UnmarshalJSON

func (hp *HeapPointer) UnmarshalJSON(data []byte) error

type Ident

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

func (Ident) String

func (i Ident) String() string

type IfStmt

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

func (IfStmt) String

func (i IfStmt) String() string

type IncDecFunc

type IncDecFunc func(v reflect.Value) reflect.Value

type IncDecStmt

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

func (IncDecStmt) String

func (i IncDecStmt) String() string

type IndexExpr

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

func (IndexExpr) String

func (i IndexExpr) String() string

type InterfaceType

type InterfaceType struct {
	InterfacePos token.Pos
	Methods      *FieldList
}

InterfaceType represents an interface type definition. TODO needed?

func (InterfaceType) String

func (i InterfaceType) String() string

type KeyValueExpr

type KeyValueExpr struct {
	Value Expr
	// contains filtered or unexported fields
}

func (KeyValueExpr) String

func (k KeyValueExpr) String() string

type LabeledStmt

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

LabeledStmt represents a labeled statement. https://go.dev/ref/spec#Labeled_statements https://go.dev/ref/spec#Label_scopes

func (LabeledStmt) String

func (s LabeledStmt) String() string

type MapType

type MapType struct {
	MapPos token.Pos
	Key    Expr
	Value  Expr
}

type Package

type Package struct {
	*packages.Package // TODO look for actual data used here
	// contains filtered or unexported fields
}

func BuildPackage

func BuildPackage(goPkg *packages.Package) (*Package, error)

func ParseSource

func ParseSource(source string) (*Package, error)

ParseSource is a helper function that allows parsing and building a package directly from a source string, without needing to read from the filesystem. It creates a temporary directory, writes the source to a main.go file, and then uses the standard LoadPackage and BuildPackage functions to create the Package struct.

func (*Package) String

func (p *Package) String() string

type ParenExpr

type ParenExpr struct {
	LParen token.Pos
	X      Expr
}

func (ParenExpr) String

func (e ParenExpr) String() string

type PkgEnvironment

type PkgEnvironment struct {
	Env
	// contains filtered or unexported fields
}

func (*PkgEnvironment) String

func (p *PkgEnvironment) String() string

type RangeStmt

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

func (RangeStmt) String

func (r RangeStmt) String() string

type ReturnStmt

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

func (ReturnStmt) String

func (r ReturnStmt) String() string

type SDKPackage

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

func (SDKPackage) String

func (p SDKPackage) String() string

type SDKType

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

type SelectorExpr

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

func (SelectorExpr) String

func (s SelectorExpr) String() string

type SendStmt

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

func (SendStmt) String

func (s SendStmt) String() string

type SliceExpr

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

http://golang.org/ref/spec#Slice_expressions

func (SliceExpr) String

func (s SliceExpr) String() string

type StarExpr

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

func (StarExpr) String

func (s StarExpr) String() string

type Step

type Step interface {
	Evaluable
	StepTaker
	Traverseable

	// implemented by step
	Next() Step
	SetNext(s Step)
	ID() int
	SetID(id int)
}

type StepTaker

type StepTaker interface {
	// contains filtered or unexported methods
}

type Stmt

type Stmt interface {
	Flowable
	// contains filtered or unexported methods
}

All statement nodes implement the Stmt interface.

type StructType

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

StructType represents a struct type definition that is interpreted (IType).

func (StructType) String

func (s StructType) String() string

type StructValue

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

StructValue represents an instance of an interpreted struct.

func InstantiateStructValue

func InstantiateStructValue(vm *VM, t StructType) StructValue

InstantiateStructValue creates a new StructValue of the given StructType.

func (StructValue) Format

func (i StructValue) Format(f fmt.State, verb rune)

func (StructValue) MarshalJSON

func (i StructValue) MarshalJSON() ([]byte, error)

func (StructValue) MarshalXML

func (i StructValue) MarshalXML(enc *xml.Encoder, start xml.StartElement) error

func (StructValue) UnmarshalJSON

func (i StructValue) UnmarshalJSON(data []byte) error

type SwitchStmt

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

A SwitchStmt represents an expression switch statement.

func (SwitchStmt) String

func (s SwitchStmt) String() string

type ToStringer

type ToStringer interface {
	// contains filtered or unexported methods
}

for gi internal use

type Traverseable

type Traverseable interface {
	// contains filtered or unexported methods
}

type TypeAssertExpr

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

func (TypeAssertExpr) String

func (e TypeAssertExpr) String() string

type TypeSpec

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

func (TypeSpec) String

func (s TypeSpec) String() string

type TypeSwitchStmt

type TypeSwitchStmt struct {
	SwitchPos token.Pos
	Init      Stmt // initialization statement; or nil
	Assign    Stmt // x := y.(type) or y.(type)
	Body      *BlockStmt
}

func (TypeSwitchStmt) String

func (s TypeSwitchStmt) String() string

type UnaryExpr

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

func (UnaryExpr) String

func (u UnaryExpr) String() string

type UnaryExprFunc

type UnaryExprFunc func(reflect.Value) reflect.Value

type VM

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

Runtime represents a virtual machine that can execute Go code.

func NewVM

func NewVM(pkg *Package) *VM

func (*VM) Launch

func (vm *VM) Launch(functionName string, args []any)

Launch sets up the VM for execution of the given function name with the provided arguments.

func (*VM) Next

func (vm *VM) Next() error

Next takes the current step and advances to the next step, returning an error if there are no more steps to take (i.e., EOF). Pre: vm.currentFrame not nil

type ValueSpec

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

Const or Var declaration

func (ValueSpec) String

func (v ValueSpec) String() string

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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