internal

package
v0.0.0-...-c7f8db1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxStackSize = 0x0fffffff
)

Variables

This section is empty.

Functions

func CatchError

func CatchError(err *error)

func CloseBuffer

func CloseBuffer(p *bytes.Buffer, suffix string)

func CreateRawBytesInst

func CreateRawBytesInst(name string) []typ.Inst

func IfInt

func IfInt(v bool, t, f int) int

func IfQuote

func IfQuote(v bool, s string) string

func IfStr

func IfStr(v bool, t, f string) string

func IsDebug

func IsDebug() bool

func LineOf

func LineOf(text string, line int) (string, bool)

func Or

func Or(a, b interface{}) interface{}

func Panic

func Panic(msg string, args ...interface{})

func PanicErr

func PanicErr(err error)

func ParseNumber

func ParseNumber(v string) (vf float64, vi int64, isInt bool, err error)

func SanitizeName

func SanitizeName(s string) string

func ShouldNotHappen

func ShouldNotHappen(args ...interface{})

func StringifyTo

func StringifyTo(w io.Writer, i interface{})

func Unnamed

func Unnamed() string

func UnnamedFunc

func UnnamedFunc() string

func UnnamedLoadString

func UnnamedLoadString() string

func WriteString

func WriteString(w io.Writer, s string) (int, error)

Types

type LimitedBuffer

type LimitedBuffer struct {
	Limit int
	bytes.Buffer
}

func (*LimitedBuffer) Write

func (w *LimitedBuffer) Write(b []byte) (int, error)

func (*LimitedBuffer) WriteByte

func (w *LimitedBuffer) WriteByte(b byte) error

func (*LimitedBuffer) WriteRune

func (w *LimitedBuffer) WriteRune(b rune) (int, error)

func (*LimitedBuffer) WriteString

func (w *LimitedBuffer) WriteString(b string) (int, error)

type Packet

type Packet struct {
	Code []typ.Inst
	Pos  VByte32
}

func (*Packet) CodePtr

func (b *Packet) CodePtr() uintptr

func (*Packet) Copy

func (b *Packet) Copy() *Packet

func (*Packet) LastInst

func (b *Packet) LastInst() *typ.Inst

func (*Packet) Len

func (b *Packet) Len() int

func (*Packet) TruncLast

func (b *Packet) TruncLast()

func (*Packet) WriteInst

func (b *Packet) WriteInst(op byte, opa, opb uint16)

func (*Packet) WriteInst2Ext

func (b *Packet) WriteInst2Ext(sub byte, opa, opb uint16)

func (*Packet) WriteInst3

func (b *Packet) WriteInst3(op byte, opa, opb, opc uint16)

func (*Packet) WriteInst3Ext

func (b *Packet) WriteInst3Ext(sub byte, opa, opb, opc uint16)

func (*Packet) WriteJmpInst

func (b *Packet) WriteJmpInst(op byte, d int)

func (*Packet) WriteLineNum

func (b *Packet) WriteLineNum(line uint32)

type VByte32

type VByte32 struct {
	Name string

	Offset uint32
	// contains filtered or unexported fields
}

func (*VByte32) Append

func (p *VByte32) Append(idx uint32, line uint32)

func (*VByte32) Len

func (p *VByte32) Len() int

func (*VByte32) Pop

func (p *VByte32) Pop() (idx, line uint32)

func (*VByte32) Read

func (p *VByte32) Read(i int) (next int, idx, line uint32)

Jump to

Keyboard shortcuts

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