File: jump_list.go

package info (click to toggle)
golang-github-hydrogen18-stalecucumber 0.0~git20180226.6de214d-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 280 kB
  • sloc: python: 71; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 402 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package stalecucumber

import "errors"

type opcodeFunc func(*PickleMachine) error

var ErrOpcodeInvalid = errors.New("Opcode is invalid")

func (pm *PickleMachine) Opcode_Invalid() error {
	return ErrOpcodeInvalid
}

type opcodeJumpList [256]opcodeFunc

func buildEmptyJumpList() opcodeJumpList {
	jl := opcodeJumpList{}

	for i := range jl {
		jl[i] = (*PickleMachine).Opcode_Invalid
	}
	return jl
}