program

package
v10.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package steps provides facilities to represent and build collections of steps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSON

type JSON struct {
	shared.Opcode
}

JSON is used to store an opcode in JSON.

func (*JSON) MarshalJSON

func (self *JSON) MarshalJSON() ([]byte, error)

MarshalJSON marshals the opcode to JSON.

func (*JSON) UnmarshalJSON

func (self *JSON) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the opcode from JSON.

type Program

type Program []shared.Opcode

Program is a mutable collection of Opcodes.

func (*Program) Add

func (self *Program) Add(opcode ...shared.Opcode)

Append adds the given opcode to the end of this program.

func (*Program) AddProgram

func (self *Program) AddProgram(otherProgram Program)

AppendProgram adds all elements of the given Program to the end of this Program.

func (Program) IsEmpty

func (self Program) IsEmpty() bool

IsEmpty returns whether or not this Program has any elements.

func (Program) MarshalJSON

func (self Program) MarshalJSON() ([]byte, error)

MarshalJSON marshals this program to JSON.

func (*Program) MoveToEnd

func (self *Program) MoveToEnd(op shared.Opcode)

MoveToEnd moves all occurrences of the given opcode in this program to the end of this program.

func (Program) OpcodeTypes

func (self Program) OpcodeTypes() []string

OpcodeTypes provides the names of the types of the opcodes in this program.

func (Program) Peek

func (self Program) Peek() shared.Opcode

Peek provides the first element of this program.

func (*Program) Pop

func (self *Program) Pop() shared.Opcode

Pop removes and provides the first element of this program.

func (*Program) Prepend

func (self *Program) Prepend(other ...shared.Opcode)

Prepend adds the given opcode to the beginning of this program.

func (*Program) PrependProgram

func (self *Program) PrependProgram(otherProgram Program)

PrependProgram adds all elements of the given program to the start of this program.

func (*Program) RemoveAllButLast

func (self *Program) RemoveAllButLast(removeType string)

func (*Program) RemoveDuplicateCheckout

func (self *Program) RemoveDuplicateCheckout()

RemoveDuplicateCheckout removes checkout opcodes that immediately follow each other from this program.

func (Program) String

func (self Program) String() string

Implementation of the fmt.Stringer interface.

func (Program) StringIndented

func (self Program) StringIndented(indent string) string

func (*Program) UnmarshalJSON

func (self *Program) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the program from JSON.

Jump to

Keyboard shortcuts

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