Arithmetic
This commit is contained in:
@@ -13,6 +13,10 @@ type Opcode byte
|
||||
const (
|
||||
OpConstant Opcode = iota
|
||||
OpAdd
|
||||
OpPop
|
||||
OpSub
|
||||
OpMul
|
||||
OpDiv
|
||||
)
|
||||
|
||||
type Definition struct {
|
||||
@@ -23,6 +27,10 @@ type Definition struct {
|
||||
var definitions = map[Opcode]*Definition{
|
||||
OpConstant: {"OpConstant", []int{2}},
|
||||
OpAdd: {"OpAdd", []int{}},
|
||||
OpPop: {"OpPop", []int{}},
|
||||
OpSub: {"OpSub", []int{}},
|
||||
OpMul: {"OpMul", []int{}},
|
||||
OpDiv: {"OpDiv", []int{}},
|
||||
}
|
||||
|
||||
func Lookup(op byte) (*Definition, error) {
|
||||
|
||||
Reference in New Issue
Block a user