vm

package
v0.0.0-...-13dd584 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 33 Imported by: 0

README

README for the VM

Mainly, the vm needs to do two things

(1) Go round in a big loop running the bytecode. (2) Know how to describe things as text --- values, types, and its own workings.

  • descriptors contains functions for describing Pipefish values and types. In order to maintain DRYness and a single source of truth it does this for the rest of the application, by one route or another.

  • externals supplies ways for the hub to talk to external services.

  • gohandler contains functions for converting Pipefish values to Go values and vice versa.

  • iohandler lets you create iohandlers to modify where the vm gets its input and sends its output. Much of this has been moved to the pf package, which aliases the relevant types.

  • operations defines the opcodes of the machine are defined in the file, which also contains information about the number and semantic significance of the operands, and so constitutes an informal specification. It also contains the code for peeking at the workings of the VM for debugging purposes.

  • SQL contains utilities for the vm to talk to SQL, as you would guess.

  • vm contains the main loop: one big switch statement on the operands.

Note on the operations of the vm.

The opcodes of the vm, as found in the operations file, are based on English. They often have one or more suffix characters indicating the type to which they relate. Container types are capitalized.

Conditionals begin with Q, their last operand being a code location. The semantics of the conditional is "if the condition is met, continue to the next operation, otherwise jump to the given location". Qn means "if not".

The following suffixes may be used to indicate the types of the operands:

b - bool f - float i - int l - label L - list M - map n - a uint32 literal q - null s - string S - set t - type T - tuple x - anything Z - a struct

Documentation

Index

Constants

View Source
const (
	DEFAULT descriptionFlavor = iota
	LITERAL
)
View Source
const (
	NATIVE supertype = iota
	ENUM
	STRUCT
)
View Source
const (
	PREFIX uint32 = iota
	INFIX
	SUFFIX
	UNFIX
)

Constants for describing the syntax of functions.

View Source
const DUMMY = 4294967295

The maximum value of a `uint32`. Used as a dummy/sentinel value when `0` is not appropriate.

Variables

These inhabit the first few memory addresses of the VM.

View Source
var OPERANDS = map[Opcode]opDescriptor{}/* 154 elements not displayed */

Functions

func Do

func Do(host, service, line, username, password string) string

Types

type BuiltinType

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

func (BuiltinType) AddClone

func (t BuiltinType) AddClone(v values.ValueType) BuiltinType

func (BuiltinType) GetName

func (t BuiltinType) GetName(flavor descriptionFlavor) string

func (BuiltinType) IsClone

func (t BuiltinType) IsClone() bool

func (BuiltinType) IsClonedBy

func (t BuiltinType) IsClonedBy() values.AbstractType

func (BuiltinType) IsEnum

func (t BuiltinType) IsEnum() bool

func (BuiltinType) IsMandatoryImport

func (t BuiltinType) IsMandatoryImport() bool

func (BuiltinType) IsPrivate

func (t BuiltinType) IsPrivate() bool

func (BuiltinType) IsStruct

func (t BuiltinType) IsStruct() bool

func (BuiltinType) IsWrapperType

func (t BuiltinType) IsWrapperType() bool

type CapturingOutHandler

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

func MakeCapturingOutHandler

func MakeCapturingOutHandler(vm *Vm) *CapturingOutHandler

func (*CapturingOutHandler) Dump

func (oH *CapturingOutHandler) Dump() string

func (*CapturingOutHandler) Out

func (oH *CapturingOutHandler) Out(v values.Value)

func (*CapturingOutHandler) Write

func (oH *CapturingOutHandler) Write(s string)

type CloneType

type CloneType struct {
	Name          string
	Path          string
	Parent        values.ValueType
	Private       bool
	IsSliceable   bool
	IsFilterable  bool
	IsMappable    bool
	IsMI          bool
	Using         []token.Token // TODO --- this is used during API serialization only and can be stored somewhere else once we move that to initialization time.
	Validation    *TypeCheck
	TypeArguments []values.Value
}

func (CloneType) AddValidation

func (t CloneType) AddValidation(tc *TypeCheck) CloneType

func (CloneType) GetName

func (t CloneType) GetName(flavor descriptionFlavor) string

func (CloneType) IsClone

func (t CloneType) IsClone() bool

func (CloneType) IsClonedBy

func (CloneType) IsClonedBy() values.AbstractType

func (CloneType) IsEnum

func (t CloneType) IsEnum() bool

func (CloneType) IsMandatoryImport

func (t CloneType) IsMandatoryImport() bool

func (CloneType) IsPrivate

func (t CloneType) IsPrivate() bool

func (CloneType) IsStruct

func (t CloneType) IsStruct() bool

func (CloneType) IsWrapperType

func (t CloneType) IsWrapperType() bool

type ConsumingOutHandler

type ConsumingOutHandler struct{}

func (*ConsumingOutHandler) Out

func (oH *ConsumingOutHandler) Out(vals []values.Value, vm *Vm)

func (*ConsumingOutHandler) Write

func (oH *ConsumingOutHandler) Write(s string)

type DecIterator

type DecIterator struct {
	StartVal int
	Val      int
	MinVal   int
	// contains filtered or unexported fields
}

func (*DecIterator) GetKey

func (it *DecIterator) GetKey() values.Value

func (*DecIterator) GetKeyValuePair

func (it *DecIterator) GetKeyValuePair() (values.Value, values.Value)

func (*DecIterator) GetValue

func (it *DecIterator) GetValue() values.Value

func (*DecIterator) Unfinished

func (it *DecIterator) Unfinished() bool

type DescribeTypeOfValueAtLocation

type DescribeTypeOfValueAtLocation uint32

This is used for unthinking errors, since the `err` package can't describe the type of a value.

type EnumIterator

type EnumIterator struct {
	Type values.ValueType
	Max  int
	// contains filtered or unexported fields
}

func (*EnumIterator) GetKey

func (it *EnumIterator) GetKey() values.Value

func (*EnumIterator) GetKeyValuePair

func (it *EnumIterator) GetKeyValuePair() (values.Value, values.Value)

func (*EnumIterator) GetValue

func (it *EnumIterator) GetValue() values.Value

func (*EnumIterator) Unfinished

func (it *EnumIterator) Unfinished() bool

type EnumType

type EnumType struct {
	Name          string
	Path          string
	ElementNames  []string
	ElementValues values.Value // A list.
	Private       bool
	IsMI          bool
}

func (EnumType) GetName

func (t EnumType) GetName(flavor descriptionFlavor) string

func (EnumType) IsClone

func (t EnumType) IsClone() bool

func (EnumType) IsClonedBy

func (EnumType) IsClonedBy() values.AbstractType

func (EnumType) IsEnum

func (t EnumType) IsEnum() bool

func (EnumType) IsMandatoryImport

func (t EnumType) IsMandatoryImport() bool

func (EnumType) IsPrivate

func (t EnumType) IsPrivate() bool

func (EnumType) IsStruct

func (t EnumType) IsStruct() bool

func (EnumType) IsWrapperType

func (t EnumType) IsWrapperType() bool

type ExternalCallHandler

type ExternalCallHandler interface {
	Evaluate(line string) values.Value
	Problem() *err.Error
	GetAPI() string
}

Interface wrapping around external calls whether to the same hub or via HTTP.

type GoFn

type GoFn struct {
	Code reflect.Value
}

Contains a Go function in the form of a reflect.Value, and, currently, nothing else.

type HTMLInjector

type HTMLInjector struct {
	Data []any
}

Used for injecting data into HTML.

type InHandler

type InHandler interface {
	Get() string
}

type IncIterator

type IncIterator struct {
	StartVal int
	Val      int
	MaxVal   int
	// contains filtered or unexported fields
}

func (*IncIterator) GetKey

func (it *IncIterator) GetKey() values.Value

func (*IncIterator) GetKeyValuePair

func (it *IncIterator) GetKeyValuePair() (values.Value, values.Value)

func (*IncIterator) GetValue

func (it *IncIterator) GetValue() values.Value

func (*IncIterator) Unfinished

func (it *IncIterator) Unfinished() bool

type Iterator

type Iterator interface {
	Unfinished() bool
	GetKey() values.Value
	GetValue() values.Value
	GetKeyValuePair() (values.Value, values.Value)
}

type KeyIncIterator

type KeyIncIterator struct {
	Max int
	// contains filtered or unexported fields
}

This is for the case when we ask to range over the key only of something which has an integer key.

func (*KeyIncIterator) GetKey

func (it *KeyIncIterator) GetKey() values.Value

func (*KeyIncIterator) GetKeyValuePair

func (it *KeyIncIterator) GetKeyValuePair() (values.Value, values.Value)

func (*KeyIncIterator) GetValue

func (it *KeyIncIterator) GetValue() values.Value

func (*KeyIncIterator) Unfinished

func (it *KeyIncIterator) Unfinished() bool

type Lambda

type Lambda struct {
	CapturesStart  uint32
	CapturesEnd    uint32
	ParametersEnd  uint32
	ResultLocation uint32
	AddressToCall  uint32
	Captures       []values.Value
	Sig            []values.AbstractType // To represent the call signature. Unusual in that the types of the AbstractType will be nil in case the type is 'any?'
	RtnSig         []values.AbstractType // The return signature. If empty means ok/error for a command, anything for a function.
	Tok            *token.Token
	Gocode         *reflect.Value // If it's a lambda returned from Go code, this will be non-nil, and most of the other fields will be their zero value except the sig information.
}

Contains the information to execute a lambda at runtime; i.e. it is the payload of a FUNC type value.

type LambdaFactory

type LambdaFactory struct {
	Model            *Lambda  // Copy this to make the lambda.
	CaptureLocations []uint32 // Then these are the location of the values we're closing over, so we copy them into the lambda.
}

All the information we need to make a lambda at a particular point in the code.

type ListIterator

type ListIterator struct {
	VecIt vector.Iterator
	// contains filtered or unexported fields
}

func (*ListIterator) GetKey

func (it *ListIterator) GetKey() values.Value

func (*ListIterator) GetKeyValuePair

func (it *ListIterator) GetKeyValuePair() (values.Value, values.Value)

func (*ListIterator) GetValue

func (it *ListIterator) GetValue() values.Value

func (*ListIterator) Unfinished

func (it *ListIterator) Unfinished() bool

type LiteralOutHandler

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

func MakeLiteralOutHandler

func MakeLiteralOutHandler(out io.Writer, vm *Vm) *LiteralOutHandler

func (*LiteralOutHandler) Out

func (oH *LiteralOutHandler) Out(v values.Value)

func (*LiteralOutHandler) Write

func (oH *LiteralOutHandler) Write(s string)

type MapIterator

type MapIterator struct {
	KVPairs []values.MapPair
	Len     int
	// contains filtered or unexported fields
}

func (*MapIterator) GetKey

func (it *MapIterator) GetKey() values.Value

func (*MapIterator) GetKeyValuePair

func (it *MapIterator) GetKeyValuePair() (values.Value, values.Value)

func (*MapIterator) GetValue

func (it *MapIterator) GetValue() values.Value

func (*MapIterator) Unfinished

func (it *MapIterator) Unfinished() bool

type MaskedInHandler

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

func (*MaskedInHandler) Get

func (iH *MaskedInHandler) Get() string

type Opcode

type Opcode uint8
const (
	Addf Opcode = iota
	Addi
	AddL
	AddS
	Adds
	Adrs
	Adsr
	Adtk
	Andb
	Aref
	Asgm
	Auto
	Bcon
	Bsql
	Call
	CalT // Specialized for tuple capture.
	CasP
	Cast
	Casx
	Cc11
	Cc1T
	CcT1
	CcTT
	Ccxx
	Chck
	Chrf
	Clon
	ConL
	ConS
	CoSn
	Cpnt
	Cv1T
	CvTT
	Diif
	Divf
	Divi
	Dofn // For lambdas, as opposed to call for outer functions.
	Dref
	Dvfi
	Dvif
	Equb
	Equf
	Equi
	Equs
	Equt
	Eqxx
	Eval
	Extn
	Flti
	Flts
	Gofn
	Gsql
	Gtef
	Gtei
	Gthf
	Gthi
	IctS
	IdxL
	IdxM
	Idxp
	Idxs
	IdxT
	Inpt
	InxL
	InxS
	Inxt
	InxT
	Inte
	Intf
	Ints
	Itgk
	Itkv
	Itgv
	Itor
	IxSn
	IxTn
	IxXx
	IxZl
	IxZn
	Jmp
	Json
	Jsr
	KeyM
	KeyZ
	Lbls
	LenL
	Lens
	LenM
	LenS
	LenT
	List
	Litx
	LnSn
	Logn
	Logy
	Mker
	Mkfn
	Mkit
	MkEn
	Mkmp
	Mkpr
	MkSn
	Mkst
	Mlfi
	Modi
	Mulf
	Muli
	Negf
	Negi
	Notb
	Outp
	Outt
	Psql
	Mpar
	Qabt
	Qfls
	Qitr
	QleT
	QlnT
	Qlog
	Qnab
	Qntp
	Qsat
	Qsnq
	Qspt
	Qspq
	Qtpt
	Qtru
	Qtyp
	Ret
	Rpop
	Rpsh
	SliL
	Slis
	SliT
	SlTn
	Strc
	StrP
	Strx
	Subf
	Subi
	SubS
	Thnk
	Tinf
	Tplf
	Trak
	TupL
	TuLx
	Typu
	Typx
	UntE
	Untk
	Uwrp
	Vlid
	WthL
	WthM
	WthT
	WthZ
	WtoM
	Yeet
)

type Operation

type Operation struct {
	Opcode Opcode
	Args   []uint32
}

func MakeOp

func MakeOp(oc Opcode, args ...uint32) *Operation

func (*Operation) MakeLastArg

func (op *Operation) MakeLastArg(loc uint32)

type OutHandler

type OutHandler interface {
	Out(v values.Value)
	Write(s string)
}

type SetIterator

type SetIterator struct {
	Elements []values.Value
	Len      int
	// contains filtered or unexported fields
}

func (*SetIterator) GetKey

func (it *SetIterator) GetKey() values.Value

func (*SetIterator) GetKeyValuePair

func (it *SetIterator) GetKeyValuePair() (values.Value, values.Value)

func (*SetIterator) GetValue

func (it *SetIterator) GetValue() values.Value

func (*SetIterator) Unfinished

func (it *SetIterator) Unfinished() bool

type SimpleInHandler

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

func MakeSimpleInHandler

func MakeSimpleInHandler(in io.Reader) *SimpleInHandler

func (*SimpleInHandler) Get

func (iH *SimpleInHandler) Get() string

type SimpleOutHandler

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

func MakeSimpleOutHandler

func MakeSimpleOutHandler(out io.Writer, vm *Vm) *SimpleOutHandler

func (*SimpleOutHandler) Out

func (oH *SimpleOutHandler) Out(v values.Value)

func (*SimpleOutHandler) Write

func (oH *SimpleOutHandler) Write(s string)

type SnippetFactory

type SnippetFactory struct {
	Bindle *values.SnippetBindle // Points to the structure defined below.
}

All the information we need to make a snippet at a particular point in the code. Currently contains only the bindle but later may contain some secret sauce.

type StandardInHandler

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

func MakeStandardInHandler

func MakeStandardInHandler(prompt string) *StandardInHandler

func (*StandardInHandler) Get

func (iH *StandardInHandler) Get() string

type StringIterator

type StringIterator struct {
	Str string
	// contains filtered or unexported fields
}

func (*StringIterator) GetKey

func (it *StringIterator) GetKey() values.Value

func (*StringIterator) GetKeyValuePair

func (it *StringIterator) GetKeyValuePair() (values.Value, values.Value)

func (*StringIterator) GetValue

func (it *StringIterator) GetValue() values.Value

func (*StringIterator) Unfinished

func (it *StringIterator) Unfinished() bool

type StructIterator

type StructIterator struct {
	Labels []int
	Values []values.Value
	// contains filtered or unexported fields
}

func (*StructIterator) GetKey

func (it *StructIterator) GetKey() values.Value

func (*StructIterator) GetKeyValuePair

func (it *StructIterator) GetKeyValuePair() (values.Value, values.Value)

func (*StructIterator) GetValue

func (it *StructIterator) GetValue() values.Value

func (*StructIterator) Unfinished

func (it *StructIterator) Unfinished() bool

type StructType

type StructType struct {
	Name                 string
	Path                 string
	LabelNumbers         []int
	LabelValues          values.Value // A list.
	Snippet              bool
	Private              bool
	AbstractStructFields []values.AbstractType
	ResolvingMap         map[int]int // TODO --- it would probably be better to implment this as a linear search below a given threshhold and a binary search above it.
	IsMI                 bool
	Validation           *TypeCheck
	TypeArguments        []values.Value
}

func (StructType) AddLabels

func (t StructType) AddLabels(labels []int) StructType

func (StructType) AddValidation

func (t StructType) AddValidation(tc *TypeCheck) StructType

func (StructType) GetName

func (t StructType) GetName(flavor descriptionFlavor) string

func (StructType) IsClone

func (t StructType) IsClone() bool

func (StructType) IsClonedBy

func (StructType) IsClonedBy() values.AbstractType

func (StructType) IsEnum

func (t StructType) IsEnum() bool

func (StructType) IsMandatoryImport

func (t StructType) IsMandatoryImport() bool

func (StructType) IsPrivate

func (t StructType) IsPrivate() bool

func (StructType) IsStruct

func (t StructType) IsStruct() bool

func (StructType) IsWrapperType

func (t StructType) IsWrapperType() bool

func (StructType) Len

func (t StructType) Len() int

func (StructType) Resolve

func (t StructType) Resolve(labelNumber int) int

type TrackingData

type TrackingData struct {
	Flavor     TrackingFlavor
	Tok        *token.Token
	LogToLoc   uint32 // The memory location in the compiler storing what to do with the logging output.
	LogTimeLoc uint32 // The memory location in the compiler storing whether to attach the time to the logging output.
	Args       []any
}

type TrackingFlavor

type TrackingFlavor int
const (
	TR_CONDITION TrackingFlavor = iota
	TR_ELSE
	TR_FNCALL
	TR_LITERAL
	TR_RESULT
	TR_RETURN
)

type TupleIterator

type TupleIterator struct {
	Elements []values.Value
	Len      int
	// contains filtered or unexported fields
}

func (*TupleIterator) GetKey

func (it *TupleIterator) GetKey() values.Value

func (*TupleIterator) GetKeyValuePair

func (it *TupleIterator) GetKeyValuePair() (values.Value, values.Value)

func (*TupleIterator) GetValue

func (it *TupleIterator) GetValue() values.Value

func (*TupleIterator) Unfinished

func (it *TupleIterator) Unfinished() bool

type TypeCheck

type TypeCheck struct {
	CallAddress  uint32 // The address we `jsr“ to to perform the typecheck.
	InLoc        uint32 // The location of the first argument of the constructor.
	ResultLoc    uint32 // Where we put the error/ok.
	TokNumberLoc uint32 // Contains a location which contains an integer which is an index of the tokens in the vm.
}

Contains the information necessary to perform the runtime checks on type constructors on structs and clones.

type TypeInformation

type TypeInformation interface {
	GetName(flavor descriptionFlavor) string
	IsEnum() bool
	IsStruct() bool

	IsClone() bool
	IsWrapperType() bool
	IsPrivate() bool
	IsMandatoryImport() bool
	IsClonedBy() values.AbstractType
	// contains filtered or unexported methods
}

type UsefulTypes

type UsefulTypes struct {
	UnwrappedError values.ValueType
	LogTo          values.ValueType
}

In general, the VM can't convert from type names to type numbers, because it doesn't need to. And we don't need the whole map of them because only a tiny proportion are needed by the runtime, so a struct gives us quick access to what we do need.

type UsefulValues

type UsefulValues struct {
	OutputAs uint32
}

Similarly we need to know where some values are kept, if they have special effects on runtime behavior.

type ValidationError

type ValidationError struct {
	Tok       *token.Token
	Condition string
	Type      string
	Value     uint32
}

For containing the data needed to manufacture a typechecking error at runtime.

type ValueIterator

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

This takes the vm and a list of memory locations as arguments, and returns an iterator which which will return one value at a time, automatically decomposing any tuples.

We do this because as things like `WthL` don't pass through `CalT`, they don't autosplat tuples, and this is a way of doing it for us.

We don't just use something from `iter` because we want some extra logic.

TODO --- normally we can detect at compile time if there are going to be any tuples involved and compile to simpler logic if it isn't. This would involves making more opcodes, or a flag, or something.

type Vm

type Vm struct {
	// Temporary state: things we change at runtime.
	Mem  []values.Value
	Code []*Operation

	// TODO --- the LogToLoc field of TrackingData is never used by *live* tracking, which should therefore have its own data type.
	LiveTracking []TrackingData // "Live" tracking data in which the uint32s in the permanent tracking data have been replaced by the corresponding memory registers.
	PostHappened bool

	// These are things the ordinal of which can be an operand.
	Tokens           []*token.Token
	LambdaFactories  []*LambdaFactory
	SnippetFactories []*SnippetFactory
	GoFns            []GoFn
	Evaluators       []func(string) values.Value // One per compiler, to implement `eval`.

	// As sometimes can this; it is indexed by the numbers of concrete types.
	ConcreteTypeInfo []TypeInformation

	// This contains the information necessary to attach a suitable namespace to the literal
	// of a value; it is indexed first by the number of the compiler and second by the number of
	// the type.
	NamespaceInfo []map[values.ValueType]string

	Labels                     []string // Array from the number of a field label to its name.
	ValidationErrors           []*ValidationError
	Tracking                   []TrackingData // Data needed by the 'trak' opcode to produce the live tracking data.
	InHandle                   InHandler
	OutHandle                  OutHandler
	AbstractTypes              []values.AbstractTypeInfo
	ExternalCallHandlers       []ExternalCallHandler // The services declared external, whether on the same hub or a different one.
	UsefulTypes                UsefulTypes
	UsefulValues               UsefulValues
	TypeNumberOfUnwrappedError values.ValueType  // What it says. When we unwrap an 'error' to an 'Error' struct, the vm needs to know the number of the struct.
	StringifyLoReg             uint32            // |
	StringifyCallTo            uint32            // | These are so the vm knows how to call the stringify function.
	StringifyOutReg            uint32            // |
	FieldLabelsInMem           map[string]uint32 // Used to turn a string into a label.
	ParameterizedTypeInfo      []*values.Map     // A list of maps from type parameters (as TUPLE values) to types (as TYPE values). The list is itself keyed by a map from type operators to the position in the list, which is stored in the compiler.

	GoToPipefishTypes map[reflect.Type]values.ValueType
	GoConverter       [](func(t uint32, v any) any)
	GoEquals          func(x any, y any) bool
	GoLiteral         func(x any) string
	// contains filtered or unexported fields
}

func BlankVm

func BlankVm() *Vm

func (*Vm) DefaultDescription

func (vm *Vm) DefaultDescription(v values.Value) string

func (*Vm) DescribeAbstractType

func (vm *Vm) DescribeAbstractType(aT values.AbstractType, flavor descriptionFlavor, cpNumber uint32) string

func (*Vm) DescribeCode

func (vm *Vm) DescribeCode(loc uint32) string

func (*Vm) DescribeOperandValues

func (vm *Vm) DescribeOperandValues(addr uint32) string

func (*Vm) DescribeType

func (vm *Vm) DescribeType(t values.ValueType, flavor descriptionFlavor, cpNumber uint32) string

func (*Vm) DescribeTypeAndValue

func (vm *Vm) DescribeTypeAndValue(v values.Value, flavor descriptionFlavor, cpNumber uint32) string

func (*Vm) DumpStore

func (vm *Vm) DumpStore(store values.Map, password string) string

Actually this can dump any Map but why would you want to?

func (*Vm) Literal

func (vm *Vm) Literal(v values.Value, cpNumber uint32) string

func (*Vm) NewIterator

func (vm *Vm) NewIterator(container values.Value, keysOnly bool, tokLoc uint32) values.Value

Produces a Value of the internal type ITERATOR for use in implementing `for` loops.

func (*Vm) NewValueIterator

func (vm *Vm) NewValueIterator(locs []uint32) *ValueIterator

func (*Vm) Run

func (vm *Vm) Run(loc uint32)

The `run` function can and occasionally does call itself. If we want to catch a panic from the VM, we need to unwind the stack back to where we actually entered. This is what `Run` is for: everything calling `run` does so through `Run`, except `run` itself and a few other places in the VM itself.

In the same way we catch Ctrl+C interupts and return an appropriate error.

func (*Vm) StringifyValue

func (vm *Vm) StringifyValue(v values.Value, flavor descriptionFlavor, cpNumber uint32) string

func (*Vm) ToString

func (vm *Vm) ToString(v values.Value, flavor descriptionFlavor, cpNumber uint32) string

TODO --- LITERAL should produce an error on being fed something unserializable. Add an EXPLICIT option for LITERAL with fallback to STRING.

func (*Vm) TrackingToString

func (vm *Vm) TrackingToString(tdL []TrackingData) string

type WrapperType

type WrapperType struct {
	Name    string
	Path    string
	Private bool
	Gotype  string
}

func (WrapperType) GetName

func (t WrapperType) GetName(flavor descriptionFlavor) string

func (WrapperType) IsClone

func (t WrapperType) IsClone() bool

func (WrapperType) IsClonedBy

func (WrapperType) IsClonedBy() values.AbstractType

func (WrapperType) IsEnum

func (t WrapperType) IsEnum() bool

func (WrapperType) IsMandatoryImport

func (t WrapperType) IsMandatoryImport() bool

func (WrapperType) IsPrivate

func (t WrapperType) IsPrivate() bool

func (WrapperType) IsStruct

func (t WrapperType) IsStruct() bool

func (WrapperType) IsWrapperType

func (t WrapperType) IsWrapperType() bool

Jump to

Keyboard shortcuts

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