code

package
v0.0.0-...-ec5cb73 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Make

func Make(opcode Opcode, operands ...int) []byte

func ReadOperands

func ReadOperands(def *Definition, ins Instructions) ([]int, int)

func ReadUint16

func ReadUint16(ins Instructions) uint16

func ReadUint8

func ReadUint8(ins Instructions) byte

Types

type Definition

type Definition struct {
	Name          string
	OperandWidths []int
}

func Lookup

func Lookup(op byte) (*Definition, error)

type Instructions

type Instructions []byte

func (Instructions) String

func (inst Instructions) String() string

type Opcode

type Opcode byte
const (
	OpConstant Opcode = iota
	OpAdd
	OpSub
	OpMul
	OpDiv
	OpPop
	OpTrue
	OpFalse
	OpEqual
	OpNotEqual
	OpGreaterThan
	OpMinus
	OpBang
	OpJumpNotTruthy
	OpJump
	OpNull
	OpSetGlobal
	OpGetGlobal
	OpArray
	OpIndex
	OpHash
	OpCall
	OpReturn
	OpReturnValue
	OpSetLocal
	OpGetLocal
	OpGetBuiltin
	OpClosure
	OpGetFree
	OpRange
)

Jump to

Keyboard shortcuts

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