runtime

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DrawActionClear    = DrawAction("clear")
	DrawActionColor    = DrawAction("color")
	DrawActionStroke   = DrawAction("stroke")
	DrawActionLine     = DrawAction("line")
	DrawActionRect     = DrawAction("rect")
	DrawActionLineRect = DrawAction("lineRect")
	DrawActionPoly     = DrawAction("poly")
	DrawActionLinePoly = DrawAction("linePoly")
	DrawActionTriangle = DrawAction("triangle")
	DrawActionImage    = DrawAction("image")
)

Variables

This section is empty.

Functions

func ConstructContext

func ConstructContext(objects map[string]interface{}) (*ExecutionContext, *Variable)

func ExecuteContext

func ExecuteContext(operations []Operation, context *ExecutionContext, counter *Variable) error

func ExecuteMLOG

func ExecuteMLOG(input string, objects map[string]interface{}) error

func ExecuteMLOGBytes

func ExecuteMLOGBytes(input []byte, objects map[string]interface{}) error

func ExecuteMLOGFile

func ExecuteMLOGFile(fileName string, objects map[string]interface{}) error

func FastAtan2

func FastAtan2(x float64, y float64) float64

func RegisterOperation

func RegisterOperation(name string, setup OperationSetup)

Types

type Display

type Display interface {
	DrawFlush(buffer []DrawStatement)
}

type DrawAction

type DrawAction string

type DrawStatement

type DrawStatement struct {
	Action    DrawAction
	Arguments []interface{}
}

type ExecutionContext

type ExecutionContext struct {
	Variables   map[string]*Variable
	PrintBuffer strings.Builder
	DrawBuffer  []DrawStatement
	Objects     map[string]interface{}
	Metrics     map[int64]*Metrics
}

func (ExecutionContext) Display

func (c ExecutionContext) Display(name string) (Display, error)

func (ExecutionContext) IsNumber

func (c ExecutionContext) IsNumber(val string) bool

func (ExecutionContext) Memory

func (c ExecutionContext) Memory(name string) (Memory, error)

func (ExecutionContext) Message

func (c ExecutionContext) Message(name string) (Message, error)

func (ExecutionContext) Object

func (c ExecutionContext) Object(name string) (interface{}, error)

func (ExecutionContext) Resolve

func (c ExecutionContext) Resolve(val string) interface{}

func (ExecutionContext) ResolveFloat

func (c ExecutionContext) ResolveFloat(val string) float64

func (ExecutionContext) ResolveInt

func (c ExecutionContext) ResolveInt(val string) int64

func (ExecutionContext) ResolveStr

func (c ExecutionContext) ResolveStr(val string) string

func (ExecutionContext) Set

func (c ExecutionContext) Set(variable string, value interface{})

type Memory

type Memory interface {
	Write(value float64, position int64)
	Read(position int64) float64
}

type Message

type Message interface {
	PrintFlush(buffer string)
}

type Metrics

type Metrics struct {
	Executions uint64
}

type Operation

type Operation struct {
	Line     mlog.MLOGLine
	Executor OperationExecutor
}

func Parse

func Parse(input string) ([]Operation, error)

type OperationExecutor

type OperationExecutor func(ctx *ExecutionContext)

type OperationSetup

type OperationSetup func(args []string) (OperationExecutor, error)

type PostExecute

type PostExecute interface {
	PostExecute()
}

type Variable

type Variable struct {
	Value    interface{}
	Constant bool
}

Jump to

Keyboard shortcuts

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