dis

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package dis supports analysis of Risor bytecode by disassembling it. This works with the opcodes defined in the `op` package and uses the InstructionIter type from the `compiler` package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(instructions []Instruction, writer io.Writer)

Print a string representation of the given instructions to the given writer.

Types

type Instruction

type Instruction struct {
	Offset     int
	Name       string
	Opcode     op.Code
	Operands   []op.Code
	Annotation string
	Constant   interface{}
}

Instruction represents a single bytecode instruction and its operands.

func Disassemble

func Disassemble(code *compiler.Code) ([]Instruction, error)

Disassemble returns a parsed representation of the given bytecode.

Jump to

Keyboard shortcuts

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