render

package module
v0.0.0-...-387e20d Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2018 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderCommentsText

func RenderCommentsText(rawComments instructions.RawComments) string

Render a sequence of raw comments as text. The rendered comments is compatible with the Human Resource Machine game (i.e. they can be pasted into the game) and should be appended to the rendered instructions. The returned text can be wrapped arbitrarily as long as the "DEFINE COMMENT xxx" text is not wrapped.

func RenderCommentsTextFromReader

func RenderCommentsTextFromReader(reader io.ReadSeeker) (string, error)

Render a textual representation of a program's comments from a given reader. The reader must be correctly positioned over the comment count of a sequence of comments.

See: RenderCommentsText

func RenderInstructionsText

func RenderInstructionsText(disassembled instructions.Disassembled, opts ...RenderInstructionsTextOption) string

Render a textual representation of a program given a sequence of disassembled instructions

Various options can be passed in order to show more information than would be possible with the default output which is compatible with Human Resource Machine (i.e. it can be pasted into the game)

func RenderInstructionsTextFromReader

func RenderInstructionsTextFromReader(reader io.Reader, opts ...RenderInstructionsTextOption) (string, error)

Render a textual representation of a program from a given reader. The reader must be correctly positioned over the instruction count of a sequence of instructions.

See: RenderInstructionsText

func RenderSVG

func RenderSVG(disassembled instructions.Disassembled, comments instructions.Comments) string

Render a sequence of disassembled instructions and comments into an SVG. The rendered SVG emulates the style of the game's display of instructions.

func RenderSVGFromReader

func RenderSVGFromReader(reader io.ReadSeeker) (string, error)

Render an SVG representation of a program. The reader must be correctly positioned instruction count of program.

See: RenderSVG

Types

type Colour

type Colour string

type RenderInstructionsTextOption

type RenderInstructionsTextOption func(*renderInstructionsTextOptions)

A RenderInstructionsText option

func RawInstructions

func RawInstructions(instructions instructions.Instructions) RenderInstructionsTextOption

Raw instruction data for use with ShowRawInstructions. Using this option does *not* imply that the data will be shown. To show the data use ShowRawInstructions

func ShowInstructionNumbers

func ShowInstructionNumbers() RenderInstructionsTextOption

Show instruction numbers (i.e. all decoded instructions are counted, including jump targets and comments)

func ShowLineNumbers

func ShowLineNumbers() RenderInstructionsTextOption

Show line numbers as would be shown in the Human Resource Machine game

func ShowRawInstructions

func ShowRawInstructions() RenderInstructionsTextOption

Show raw instruction (hex). Requires that the raw instruction data is passed using the RawInstructions option

type SVGMnemonics

type SVGMnemonics struct {
	Width    int
	Mnemonic string
	Colour   Colour
}

type TextStyle

type TextStyle string

func (TextStyle) Render

func (t TextStyle) Render(fontSize string) string

Jump to

Keyboard shortcuts

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